static void cmd_scan(int argc, char *argv[]) { char *value; DBusMessageIter iter; if (!check_default_player()) return bt_shell_noninteractive_quit(EXIT_FAILURE); if (!g_dbus_proxy_get_property(default_player, "Shuffle", &iter)) { bt_shell_printf("Operation not supported\n"); return bt_shell_noninteractive_quit(EXIT_FAILURE); } value = g_strdup(argv[1]); if (g_dbus_proxy_set_property_basic(default_player, "Shuffle", DBUS_TYPE_STRING, &value, generic_callback, value, g_free) == FALSE) { bt_shell_printf("Failed to set scan\n"); g_free(value); return bt_shell_noninteractive_quit(EXIT_FAILURE); } bt_shell_printf("Attempting to set scan\n"); }
static int bluetooth_device_disable(struct connman_device *device) { GDBusProxy *proxy = connman_device_get_data(device); dbus_bool_t device_powered = FALSE; const char *path; if (!proxy) return 0; path = g_dbus_proxy_get_path(proxy); if (!proxy_get_bool(proxy, "Powered")) { DBG("already disabled %p %s", device, path); return -EALREADY; } DBG("device %p %s", device, path); g_dbus_proxy_set_property_basic(proxy, "Powered", DBUS_TYPE_BOOLEAN, &device_powered, device_disable_cb, g_strdup(path), NULL); return -EINPROGRESS; }