static void proxy_added(GDBusProxy *proxy, void *user_data) { struct external_app *eapp = user_data; const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); path = g_dbus_proxy_get_path(proxy); if (!g_str_has_prefix(path, eapp->path)) return; if (g_strcmp0(interface, GATT_CHR_IFACE) != 0 && g_strcmp0(interface, GATT_SERVICE_IFACE) != 0 && g_strcmp0(interface, GATT_DESCRIPTOR_IFACE) != 0) return; DBG("path %s iface %s", path, interface); /* * Object path follows a hierarchical organization. Add the * proxies sorted by path helps the logic to register the * object path later. */ eapp->proxies = g_slist_insert_sorted(eapp->proxies, proxy, proxy_path_cmp); }
static void object_removed(GDBusProxy *proxy, void *user_data) { const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); if (!interface) { connman_warn("Interface or proxy missing when removing " "bluetooth object"); return; } if (strcmp(interface, "org.bluez.Adapter1") == 0) { path = g_dbus_proxy_get_path(proxy); DBG("%s %s", interface, path); g_hash_table_remove(devices, path); } if (strcmp(interface, "org.bluez.Network1") == 0) { path = g_dbus_proxy_get_path(proxy); DBG("%s %s", interface, path); g_hash_table_remove(networks, path); } }
static void proxy_added_cb(GDBusProxy *proxy, void *user_data) { const char *iface; iface = g_dbus_proxy_get_interface(proxy); if (g_strcmp0(iface, GATT_MGR_IFACE)) return; register_app(proxy); }
static void proxy_added(GDBusProxy *proxy, void *user_data) { const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); path = g_dbus_proxy_get_path(proxy); if (g_str_equal(BLUEZ_DEVICE_INTERFACE, interface) == FALSE) return; modem_register_from_proxy(proxy, path); }
static void proxy_removed(GDBusProxy *proxy, void *user_data) { struct external_app *eapp = user_data; const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); path = g_dbus_proxy_get_path(proxy); DBG("path %s iface %s", path, interface); eapp->proxies = g_slist_remove(eapp->proxies, proxy); }
void gatt_notify_attribute(GDBusProxy *proxy, bool enable) { const char *iface; iface = g_dbus_proxy_get_interface(proxy); if (!strcmp(iface, "org.bluez.GattCharacteristic1")) { notify_attribute(proxy, enable); return; } rl_printf("Unable to notify attribute %s\n", g_dbus_proxy_get_path(proxy)); }
static void proxy_removed(GDBusProxy *proxy, void *user_data) { const char *interface; interface = g_dbus_proxy_get_interface(proxy); if (!strcmp(interface, BLUEZ_MEDIA_PLAYER_INTERFACE)) player_removed(proxy); if (!strcmp(interface, BLUEZ_MEDIA_FOLDER_INTERFACE)) folder_removed(proxy); if (!strcmp(interface, BLUEZ_MEDIA_ITEM_INTERFACE)) item_removed(proxy); }
void gatt_write_attribute(GDBusProxy *proxy, const char *arg) { const char *iface; iface = g_dbus_proxy_get_interface(proxy); if (!strcmp(iface, "org.bluez.GattCharacteristic1") || !strcmp(iface, "org.bluez.GattDescriptor1")) { write_attribute(proxy, (char *) arg); return; } rl_printf("Unable to write attribute %s\n", g_dbus_proxy_get_path(proxy)); }
static void property_changed(GDBusProxy *proxy, const char *name, DBusMessageIter *iter, void *user_data) { const char *interface; interface = g_dbus_proxy_get_interface(proxy); if (!strcmp(interface, BLUEZ_MEDIA_PLAYER_INTERFACE)) player_property_changed(proxy, name, iter); else if (!strcmp(interface, BLUEZ_MEDIA_FOLDER_INTERFACE)) folder_property_changed(proxy, name, iter); else if (!strcmp(interface, BLUEZ_MEDIA_ITEM_INTERFACE)) item_property_changed(proxy, name, iter); }
static void property_changed(GDBusProxy *proxy, const char *name, DBusMessageIter *iter, void *user_data) { const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); path = g_dbus_proxy_get_path(proxy); if (g_str_equal(BLUEZ_DEVICE_INTERFACE, interface) == FALSE) return; if (g_str_equal("Paired", name) != TRUE) return; modem_register_from_proxy(proxy, path); }
static void object_added(GDBusProxy *proxy, void *user_data) { const char *interface; interface = g_dbus_proxy_get_interface(proxy); if (strcmp(interface, "org.bluez.Adapter1") == 0) { DBG("%s %s", interface, g_dbus_proxy_get_path(proxy)); device_create(proxy); return; } if (strcmp(interface, "org.bluez.Network1") == 0) { DBG("%s %s", interface, g_dbus_proxy_get_path(proxy)); pan_create(proxy); return; } }
static void object_removed(GDBusProxy *proxy, void *user_data) { const char *interface, *path; interface = g_dbus_proxy_get_interface(proxy); if (strcmp(interface, "org.bluez.Adapter1") == 0) { path = g_dbus_proxy_get_path(proxy); DBG("%s %s", interface, path); g_hash_table_remove(devices, path); } if (strcmp(interface, "org.bluez.Network1") == 0) { path = g_dbus_proxy_get_path(proxy); DBG("%s %s", interface, path); g_hash_table_remove(networks, path); } }
static void object_added(GDBusProxy *proxy, void *user_data) { const char *interface; interface = g_dbus_proxy_get_interface(proxy); if (!interface) { connman_warn("Interface or proxy missing when adding " "bluetooth object"); return; } if (strcmp(interface, "org.bluez.Adapter1") == 0) { DBG("%s %s", interface, g_dbus_proxy_get_path(proxy)); device_create(proxy); return; } if (strcmp(interface, "org.bluez.Network1") == 0) { DBG("%s %s", interface, g_dbus_proxy_get_path(proxy)); pan_create(proxy); return; } }