diff options
-rw-r--r-- | src/manager.c | 1 | ||||
-rw-r--r-- | src/modem.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c index 285844ab..043b3e31 100644 --- a/src/manager.c +++ b/src/manager.c @@ -35,6 +35,7 @@ static GDBusMethodTable manager_methods[] = { static GDBusSignalTable manager_signals[] = { { "ModemAdded", "oa{sv}" }, + { "ModemRemoved", "o" }, { } }; diff --git a/src/modem.c b/src/modem.c index 2c101786..412dfb96 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1417,6 +1417,16 @@ int ofono_modem_register(struct ofono_modem *modem) return 0; } +static void emit_modem_removed(struct ofono_modem *modem) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = modem->path; + + g_dbus_emit_signal(conn, OFONO_MANAGER_PATH, OFONO_MANAGER_INTERFACE, + "ModemRemoved", DBUS_TYPE_OBJECT_PATH, &path, + DBUS_TYPE_INVALID); +} + static void modem_unregister(struct ofono_modem *modem) { DBusConnection *conn = ofono_dbus_get_connection(); @@ -1462,6 +1472,8 @@ static void modem_unregister(struct ofono_modem *modem) modem->properties = NULL; modem->driver = NULL; + + emit_modem_removed(modem); } void ofono_modem_remove(struct ofono_modem *modem) |