Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Gustavo Sverzut Barbieri
On Wednesday, August 29, 2012, Kok, Auke-jan H wrote:

> On Wednesday, August 29, 2012, Marcel Holtmann 
> >
> wrote:
> > Hi Tudor,
> >
> >> This patch set introduces a new CLI for Connman to use with the current
> tree.
> >> The new files in the client directory compile under a single executable
> >> called "cmn", which provides a larger range of functions. It consists of
> >> patches that add the new client and documentation, remove the old
> client,
> >> and update the Makefile.am and other associated files.
> >
> > I do not really like the name cmn. I can not even make out what it is
> > suppose to be standing for.
> >
> > So either just short cm as it is right now or connmanctl to follow in
> > line with what we have with systemctl, journalctl etc.
>
> Agreed. I'm partial to connmanctl myself...


Me too

While at that, an auto-pager like git and systemd would be nice... Some
output I'd big enough to be annoying without it :-)


>
> Auke
> ___
> connman mailing list
> connman@connman.net 
> http://lists.connman.net/listinfo/connman
>


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Kok, Auke-jan H
On Wednesday, August 29, 2012, Marcel Holtmann  wrote:
> Hi Tudor,
>
>> This patch set introduces a new CLI for Connman to use with the current
tree.
>> The new files in the client directory compile under a single executable
>> called "cmn", which provides a larger range of functions. It consists of
>> patches that add the new client and documentation, remove the old client,
>> and update the Makefile.am and other associated files.
>
> I do not really like the name cmn. I can not even make out what it is
> suppose to be standing for.
>
> So either just short cm as it is right now or connmanctl to follow in
> line with what we have with systemctl, journalctl etc.

Agreed. I'm partial to connmanctl myself...

Auke
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Marcel Holtmann
Hi Tudor,

> This patch set introduces a new CLI for Connman to use with the current tree.
> The new files in the client directory compile under a single executable
> called "cmn", which provides a larger range of functions. It consists of
> patches that add the new client and documentation, remove the old client,
> and update the Makefile.am and other associated files.

I do not really like the name cmn. I can not even make out what it is
suppose to be standing for.

So either just short cm as it is right now or connmanctl to follow in
line with what we have with systemctl, journalctl etc.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Patrik Flykt

Hi,

Noticed a few things while testing:

client/cmn services --properties  produces a really sparse
output of the service properties. I'd like to have it similar to
test/list-services and client/cmn tech. It's also good to print empty
arrays and dictionaries as '[ ]' and '{ }' respectively.

client/cmn scan outputs 'Scan requires an argument, see help'. Since we
know a technology name is wanted, the message should be about that.

client/cmn scan ethernet will return an net.connman.Error.NotSupported
error containing a text string "Not supported", since ethernet does not
support scanning. Please print out the error and/or text and give some
other return value than zero. This might be true for other commands as
well, please check them also.

client/cmn scan foobar and client/cmn enable/disable foobar should
complain nicely that 'foobar' is an unknown technology and return an
appropriate non-zero value.

client/cmn state is heavily indented without any visible clues why.

client/cmn monitor could also just print out e.g. [Powered] = True just
like client/cmn tech does.

client/cmn monitor --services doesn't seem to be reacting to
ServicesChanged, it seems to only print out WiFi signal changes after a
while.


Despite the above, the command line client starts to be quite promising!


Cheers,

Patrik


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Patrik Flykt

Hi,

On Tue, 2012-08-28 at 17:05 -0700, Tudor Marcu wrote:
> This patch set introduces a new CLI for Connman to use with the current tree.

Please fix up blank lines EOF in patches 1-5,7 and 9. I spent quite a
while with 'git am' on this and it's quite annoying with .gitconfig
'[apply]' section containing 'whitespace = error'. 

There are still some strncmp found, please fix.

Cheers,

Patrik


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: [PATCH 00/12] New CLI v3

2012-08-29 Thread Jukka Rissanen

Hi Tudor,

some general comments below

On 08/29/2012 03:05 AM, Tudor Marcu wrote:

This patch set introduces a new CLI for Connman to use with the current tree.
The new files in the client directory compile under a single executable
called "cmn", which provides a larger range of functions. It consists of
patches that add the new client and documentation, remove the old client,
and update the Makefile.am and other associated files.

The first 6 patches add the files containing the functions used in the
CLI, and the main CLI file and the files for interactive mode. The seventh
patch includes a new man page for cmn, and changes to TODO, AUTHORS, and
.gitignore. The last patch removes the old client and updates the Makefile.am
to compile the client and install the man page.



- git am complains about whitespace errors (blank lines at eof), just 
check that you do not have extra newlines at the end of the files. Use 
checkpatch.pl script from kernel sources to check the patches before 
sending.

- when generating patch please do something like this
git format-patch -o patches --cover-letter \
--subject-prefix="PATCH vXX" HEAD~YY
  where XX is the patchset version (your next one is 4)
  And the patch sending should be done like this
  git send-email patches/0*.patch
  and press enter when asked what what is the message-id, this way you 
will get nicely threaded mails where individual patches are under the 
cover letter mail


- client still uses dbus-glib (includes dbus-glib-lowlevel.h) but does 
not require that in configure, why do we need dbus-glib anyway? Connmand 
works just fine without it. Something like this could be used instead


diff --git a/Makefile.am b/Makefile.am
index fee2e7a..68c0b96 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -146,7 +146,7 @@ client_cmn_SOURCES =  $(gdbus_sources) src/log.c 
include/log.h src/dbus.c \

client/interactive.h client/monitor.c \
client/monitor.h client/main.c

-client_cmn_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ -ldbus-glib-1 -lreadline -ldl
+client_cmn_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ -lreadline -ldl
 endif

 if WISPR
diff --git a/client/main.c b/client/main.c
index 45808c6..38aa4b8 100644
--- a/client/main.c
+++ b/client/main.c
@@ -29,7 +29,7 @@
 #include 

 #include 
-#include 
+#include 

 #include "client/data_manager.h"
 #include "client/services.h"
@@ -110,7 +110,12 @@ static int monitor_connman(DBusConnection 
*connection, char *interface,

DBusError err;

dbus_error_init(&err);
-   dbus_connection_setup_with_g_main(connection, NULL);
+   g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, &err);
+   if (dbus_error_is_set(&err)) {
+   fprintf(stderr, "Bus setup error: %s\n", err.message);
+   return -1;
+   }
+
dbus_bus_add_match(connection, rule, &err);

if (dbus_error_is_set(&err)) {
@@ -342,7 +347,6 @@ int main(int argc, char *argv[])
{0, 0, 0, 0}
};

-   g_type_init();
main_loop = g_main_loop_new(NULL, TRUE);

dbus_error_init(&err);
diff --git a/client/monitor.c b/client/monitor.c
index 2cb5f76..757edf1 100644
--- a/client/monitor.c
+++ b/client/monitor.c
@@ -29,7 +29,6 @@
 #include 

 #include 
-#include 

 #include "client/monitor.h"
 #include "client/services.h"


- "cmn services" shows "* ARO foobar ". The 'O'nline or 'R'eady 
state chars are mutually exclusive so it is either R or O, not both at 
the same time.


- "cmn tech" is a bit weird command, should we name it to "cmn 
technology" and allow shorter version also. This is also true for other 
commands meaning that we should match shorter command names also, like 
"cmn conf" would match "cmn config", but "cmn con" would give error 
because there are two options now "cmn connect" and "cmn config". So 
work the same way as ip command from iproute package where you can say 
"ip r g 1.2.3.4" instead of "ip route get 1.2.3.4". This is not top 
level priority but nice to have.


- in interactive mode, the ctrl-d should exit the mode like in normal shell

- "cmn scan foobar" returns 0 even thou there was an error

- "cmn config foobar" returns 255 for errors but for example "cmn config 
foobar --proxy manual servers 1.2.3.4 excludes 2.3.4.5" says "foobar is 
not a valid service" but returns still 0. So as a general rule, if the 
command fails, we need to return != 0 value.


- "cmn services --properties ethernet_001122334455_cable" returns the 
properties like this

 [Nameservers]
  1.2.3.4 5.6.7.8 NULL
  do we need the NULL here (especially at the end of the array)? Also 
if the property is empty, we can just print empty line instead of lonely 
NULL. This works ok for dicts which do not print any NULLs if the dict 
is empty.



Cheers,
Jukka

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH 00/12] New CLI v3

2012-08-28 Thread Tudor Marcu
This patch set introduces a new CLI for Connman to use with the current tree.
The new files in the client directory compile under a single executable
called "cmn", which provides a larger range of functions. It consists of
patches that add the new client and documentation, remove the old client,
and update the Makefile.am and other associated files.

The first 6 patches add the files containing the functions used in the
CLI, and the main CLI file and the files for interactive mode. The seventh
patch includes a new man page for cmn, and changes to TODO, AUTHORS, and
.gitignore. The last patch removes the old client and updates the Makefile.am
to compile the client and install the man page.

Description
---
With the current functionality, the cmn CLI can be used to handle most
simple network connections. It is able to connect and configure all options
regarding wired or unsecured services. Any type of technology can be enabled
or disabled, as long as it actually exists on the system. The current state
of the system and current technology can be retrieved, as well as a list
of services.  The list will show favorite services and currently connected
ones. Connecting and disconnecting to a service works as long as the service
is not secured.  The cmn client can also be used to monitor changes to the
services, technologies, or the state of the system. Users can run an instance
of cmn as a monitor, and use another to configure and connect to services,
allowing them to view the changes in real-time.

Future Plans

The next task we plan to focus on is providing functionality to connect
to secured networks. We must create and register an agent, as well as the
required functions that can reply to connman's request.

We also plan to be able to asyncronously display a list of changed services
upon the user running the "scan" command. This should display a list of
updated services if they have changed, or a message stating that that the
services have not changed.

Smaller updates include configuring some options such as enabling tethering
and clearing properties. More options will also be added to the interactive
mode so users can actually configure from there.

Tudor Marcu (12):
  Add service files for new client.
  Add technology files.
  Add data_manager files.
  Add connman monitor files.
  Add interactive mode files.
  Update include/dbus.h to open more types.
  Add manpage for cmn client.
  Update configure.ac checks.
  Update Makefile.am and add new client main file.
  Update gitignore with new CLI name.
  Update AUTHORS file.
  Update TODO CLI authors.

 .gitignore|2 +-
 AUTHORS   |2 +
 Makefile.am   |   17 +-
 TODO  |3 +-
 client/data_manager.c |  183 +++
 client/data_manager.h |   52 +
 client/interactive.c  |  202 
 client/interactive.h  |   30 +++
 client/main.c |  622 +++--
 client/monitor.c  |  214 +
 client/monitor.h  |   40 
 client/services.c |  489 ++
 client/services.h |   57 +
 client/technology.c   |  170 ++
 client/technology.h   |   45 
 configure.ac  |5 +
 doc/cmn.1 |  198 
 include/dbus.h|   19 ++
 18 files changed, 2173 insertions(+), 177 deletions(-)
 create mode 100644 client/data_manager.c
 create mode 100644 client/data_manager.h
 create mode 100644 client/interactive.c
 create mode 100644 client/interactive.h
 create mode 100644 client/monitor.c
 create mode 100644 client/monitor.h
 create mode 100644 client/services.c
 create mode 100644 client/services.h
 create mode 100644 client/technology.c
 create mode 100644 client/technology.h
 create mode 100644 doc/cmn.1

-- 
1.7.9.5

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman