Dan Winship | 1 Feb 15:24
Picon
Gravatar

[PATCH] libnm-glib cleanups and fixes

From 9b662ac8676f6a823a1fadee90645c65036e7953 Mon Sep 17 00:00:00 2001
From: Dan Winship <danw <at> gnome.org>
Date: Thu, 5 Jan 2012 13:36:03 -0500
Subject: [PATCH 01/12] libnm-glib: Fix _nm_string_array_demarshal

dbus-glib returns 'as' results as G_TYPE_STRV (NULL-terminated
char**), not DBUS_TYPE_G_ARRAY_OF_STRING (GPtrArray of char*).
---
 libnm-glib/nm-types.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c
index 6d76787..8598113 100644
--- a/libnm-glib/nm-types.c
+++ b/libnm-glib/nm-types.c
@@ -172,9 +172,9 @@ nm_string_array_get_type (void)
 gboolean
 _nm_string_array_demarshal (GValue *value, GPtrArray **dest)
 {
-	GPtrArray *array;
+	char **array;

-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_STRING))
+	if (!G_VALUE_HOLDS (value, G_TYPE_STRV))
 		return FALSE;

 	if (*dest) {
@@ -182,13 +182,13 @@ _nm_string_array_demarshal (GValue *value, GPtrArray **dest)
 		*dest = NULL;
 	}
(Continue reading)

Dan Winship | 1 Feb 15:27
Picon
Gravatar

[PATCH] libnm-glib async patches

depends on the previous two patch sets

With just the first patch, libnm-glib users will completely avoid
synchronous D-Bus calls after the initial nm_client_new() /
nm_remote_settings_new() calls. The patches to add async constructors
for those types allow getting rid of the synchronous D-Bus calls at
startup as well.
From c2b85a0fa4785ef13290eefcc75f7a39c42d59b3 Mon Sep 17 00:00:00 2001
From: Dan Winship <danw <at> gnome.org>
Date: Tue, 20 Dec 2011 15:15:42 -0500
Subject: [PATCH 10/12] libnm-glib: Implement GInitable/GAsyncInitable in
 NMObject

Implement GInitable and GAsyncInitable in NMObject, with
implementations that synchronously or asynchonously load all
properties, and change _nm_object_ensure_inited() to run
g_initable_init().

Update the object/object-array property handling to initialize the
objects after creating them (synchronously or asynchronously,
according to the situation), so that they will have all of their
properties preloaded before they are ever visible to the caller.

Move the non-blocking/non-failable parts of various objects'
constructor() methods to constructed(), and move the blocking/failable
parts to init(), and implement init_async() methods with non-blocking
versions of the blocking methods.

(Continue reading)

Dan Winship | 1 Feb 15:25
Picon
Gravatar

[PATCH] libnm-glib property handling simplifications

(depends on the previous patches)
From 3d45ef3e5117c42529755aaa5fdcad085726ec1a Mon Sep 17 00:00:00 2001
From: Dan Winship <danw <at> gnome.org>
Date: Fri, 20 Jan 2012 07:52:17 -0500
Subject: [PATCH 06/12] libnm-glib: simplify and genericize property
 declaration

Rename _nm_object_handle_properties_changed(), etc, to be about
properties in general, rather than just property changes.

Interpret func==NULL in NMPropertiesInfo as meaning "use
_nm_object_demarshal_generic", and then reorder the fields so that you
can just leave that field out in the declarations when it's NULL.

Add a way to register properties that exist in D-Bus but aren't
tracked by the NMObjects, and use that for NMDevice's D-Bus Ip4Address
property, replacing the existing hack.

Also add a few other missing properties noticed along the way.
---
 libnm-glib/nm-access-point.c      |   30 ++++----
 libnm-glib/nm-active-connection.c |   26 +++---
 libnm-glib/nm-client.c            |   32 ++++----
 libnm-glib/nm-device-bt.c         |   18 ++--
 libnm-glib/nm-device-ethernet.c   |   20 +++---
 libnm-glib/nm-device-infiniband.c |   16 ++--
 libnm-glib/nm-device-modem.c      |   16 ++--
 libnm-glib/nm-device-wifi.c       |   24 +++---
(Continue reading)

Dan Williams | 1 Feb 22:39
Picon
Favicon

Re: Modemmanager - how to send sms? - receiving is ok

On Tue, 2012-01-31 at 13:08 +0100, PongráczI wrote:
> Dear All,
> 
> I  spent several days to make sms sending work, but in one hand, I
> failed, in the other hand, I did not find clear answer/solution on the
> internet.

I did recently add a test tool to ModemManager git to show how this is
done, after I fixed MM to use PDU mode on devices that don't support
text mode.  freedesktop cgit is down to the relevant parts are (in
python+dbus):

msg_dict = dbus.Dictionary(
    {
        dbus.String('number') : dbus.String(number),
        dbus.String('text') : dbus.String(message),
        dbus.String('smsc') : dbus.String(smsc),
        dbus.String('validity') : dbus.UInt32(validity)
    },
    signature=dbus.Signature("sv")
)

sms_iface = dbus.Interface(proxy, dbus_interface='org.freedesktop.ModemManager.Modem.Gsm.SMS')
try:
    indexes = sms_iface.Send(msg_dict)
    print "Message index: %d" % indexes[0]
except Exception, e:
    print "Sending message failed: %s" % e

> So, I decided to ask you, experts about this question.
(Continue reading)

Dan Williams | 1 Feb 22:42
Picon
Favicon

Re: GSM Settings verification doc or code wrong

On Tue, 2012-01-31 at 16:47 +0100, Thomas Bechtold wrote:
> Hi,
> 
> i use NM 0.8.6 and try to set a blank gsm number in NM settings.
> 
> on [1] and [2] is written for GSM setting:
> """... Many modems do not require PPP for connections to the mobile 
> network and thus this property should be left blank, which allows 
> NetworkManager to select the appropriate settings automatically."""
> 
> So i tried to leave the number blank but then nm_connection_verify failed.
> The reason is in nm-util/nm-setting-gsm.c:verify() (the code is in 0.8.6 
> and 0.9 equal):
> 
> if (!priv->number) {
> 		g_set_error (error,
> 		             NM_SETTING_GSM_ERROR,
> 		             NM_SETTING_GSM_ERROR_MISSING_PROPERTY,
> 		             NM_SETTING_GSM_NUMBER);
> 		return FALSE;
> 	} else if (!strlen (priv->number)) {
> 		g_set_error (error,
> 		             NM_SETTING_GSM_ERROR,
> 		             NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
> 		             NM_SETTING_GSM_NUMBER);
> 		return FALSE;
> 	}
> 
> 
> 
(Continue reading)

Dan Williams | 1 Feb 23:05
Picon
Favicon

Re: [PATCH 1/3] time: implement ModemTime in ModemBase

On Fri, 2012-01-27 at 13:23 -0500, Thomas Tuttle wrote:
> Signed-off-by: Thomas Tuttle <ttuttle <at> chromium.org>
> ---
>  src/mm-modem-base.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  src/mm-modem-base.h |    4 +++
>  src/mm-modem.h      |    3 +-
>  3 files changed, 77 insertions(+), 2 deletions(-)

Pushed, thanks.

Dan

> diff --git a/src/mm-modem-base.c b/src/mm-modem-base.c
> index 372367a..6348621 100644
> --- a/src/mm-modem-base.c
> +++ b/src/mm-modem-base.c
> @@ -29,15 +29,18 @@
>  #include "mm-properties-changed-signal.h"
>  #include "mm-callback-info.h"
>  #include "mm-modem-helpers.h"
> +#include "mm-modem-time.h"
>  
>  static void modem_init (MMModem *modem_class);
>  static void pc_init (MMPropertiesChanged *pc_class);
> +static void modem_time_init (MMModemTime *modem_time_class);
>  
>  G_DEFINE_TYPE_EXTENDED (MMModemBase, mm_modem_base,
>                          G_TYPE_OBJECT,
>                          G_TYPE_FLAG_VALUE_ABSTRACT,
>                          G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM, modem_init)
(Continue reading)

Dan Williams | 1 Feb 23:05
Picon
Favicon

Re: [PATCH 2/3] time: Poll for timezone

On Fri, 2012-01-27 at 13:24 -0500, Thomas Tuttle wrote:
> Signed-off-by: Thomas Tuttle <ttuttle <at> chromium.org>
> ---
>  src/mm-modem-base.c |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  src/mm-modem-base.h |    3 ++
>  src/mm-modem-time.c |   15 +++++++++
>  src/mm-modem-time.h |    8 +++++
>  4 files changed, 114 insertions(+), 0 deletions(-)

Pushed, thanks.

Dan

> diff --git a/src/mm-modem-base.c b/src/mm-modem-base.c
> index 6348621..08c098d 100644
> --- a/src/mm-modem-base.c
> +++ b/src/mm-modem-base.c
> @@ -80,6 +80,8 @@ typedef struct {
>      GHashTable *ports;
>  
>      GHashTable *tz_data;
> +    guint tz_poll_id;
> +    guint tz_poll_count;
>  } MMModemBasePrivate;
>  
> 
> @@ -503,6 +505,81 @@ value_destroy (gpointer data)
>      g_slice_free (GValue, v);
>  }
>  
(Continue reading)

Dan Williams | 1 Feb 23:06
Picon
Favicon

Re: [PATCH 3/3] time: Implement in icera

On Fri, 2012-01-27 at 13:24 -0500, Thomas Tuttle wrote:
> Signed-off-by: Thomas Tuttle <ttuttle <at> chromium.org>
> ---
>  plugins/mm-modem-icera.c       |   91 ++++++++++++++++++++++++++++++++++++++++
>  plugins/mm-modem-icera.h       |   21 +++++++++
>  plugins/mm-modem-samsung-gsm.c |   54 +++++++++++++++++++++++-
>  3 files changed, 165 insertions(+), 1 deletions(-)

Pushed, thanks.

Dan

> diff --git a/plugins/mm-modem-icera.c b/plugins/mm-modem-icera.c
> index 8933142..8dd75da 100644
> --- a/plugins/mm-modem-icera.c
> +++ b/plugins/mm-modem-icera.c
> @@ -729,6 +729,97 @@ mm_modem_icera_get_ip4_config (MMModemIcera *self,
>      g_free (command);
>  }
>  
> +static void
> +invoke_mm_modem_icera_timestamp_fn (MMCallbackInfo *info)
> +{
> +    MMModemIceraTimestampFn callback;
> +    MMModemIceraTimestamp *timestamp;
> +
> +    callback = (MMModemIceraTimestampFn) info->callback;
> +    timestamp = (MMModemIceraTimestamp *) mm_callback_info_get_result (info);
> +
> +    callback (MM_MODEM_ICERA (info->modem),
(Continue reading)

PongráczI | 1 Feb 23:27

Re: Modemmanager - how to send sms? - receiving is ok

 Dear Dan,

Thank you very much for your support!
I check my debian testing packages regarding the mentioned version and the possibility how to use the
latest (and greatest) release, even from git.

modemmanager: 0.5-1
dbus,dbus-x11, dbus-1-3: 1.4.16-1
python-dbus-glib: 0.98-1

I need a bash working version (quick and dirty), later we will change to python or C/C++, at this moment we
make a proof-of-concept version with necessary functions.
I check this dict with dbus-send.

Check
 |
 |
 |
 V

----------------eredeti üzenet-----------------
Feladó: "Dan Williams" dcbw <at> redhat.com 
Címzett: "PongráczI" 
CC: networkmanager-list <at> gnome.org 
Dátum: Wed, 01 Feb 2012 15:39:54 -0600
-------------------------------------------------

 
> You can use dicts with dbus-send if dbus-send is new enough; it won't
> look very pretty but it's possible. Python is a lot nicer.
(Continue reading)

Thomas Bechtold | 2 Feb 09:39
Picon
Favicon
Gravatar

[PATCH] libnm-util: allow empty number for gsm settings

---
 libnm-util/nm-setting-gsm.c     |   14 --------------
 libnm-util/tests/test-general.c |   23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 80d3fd3..19c59f2 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -292,20 +292,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
 {
 	NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (setting);

-	if (!priv->number) {
-		g_set_error (error,
-		             NM_SETTING_GSM_ERROR,
-		             NM_SETTING_GSM_ERROR_MISSING_PROPERTY,
-		             NM_SETTING_GSM_NUMBER);
-		return FALSE;
-	} else if (!strlen (priv->number)) {
-		g_set_error (error,
-		             NM_SETTING_GSM_ERROR,
-		             NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
-		             NM_SETTING_GSM_NUMBER);
-		return FALSE;
-	}
-
 	if (priv->apn) {
 		guint32 apn_len = strlen (priv->apn);
 		guint32 i;
(Continue reading)


Gmane