diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-19 00:58:36 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-19 00:58:36 +0200 |
commit | 79fdddccbfccd50f2c4d98d90fc707061c39d1f5 (patch) | |
tree | 49e2eb7f44cf05b8d869ceeeebe0164c9a512ee8 /src | |
parent | e123c7d5b43cd4fb63d7f1fbdb44fbb641e410ac (diff) |
api,modem: new 'PrimaryPort' property
We do need to specify which is the primary port being used for controlling the
modem. This allows us to match the device with an already existing bluetooth
device in NetworkManager.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 4222dda6..68b6ba55 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -3328,6 +3328,21 @@ interface_initialization_step (InitializationContext *ctx) mm_gdbus_modem_set_plugin (ctx->skeleton, plugin); g_free (plugin); } + /* Load primary port if not done before */ + if (!mm_gdbus_modem_get_primary_port (ctx->skeleton)) { + MMPort *primary; + +#if defined WITH_QMI + primary = MM_PORT (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (ctx->self))); + if (!primary) + primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self))); +#else + primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (ctx->self))); +#endif + + g_assert (primary != NULL); + mm_gdbus_modem_set_primary_port (ctx->skeleton, mm_port_get_device (primary)); + } /* Fall down to next step */ ctx->step++; |