static DBusMessage *connect_provider(DBusConnection *conn, DBusMessage *msg, void *data) { int err; DBG("conn %p", conn); if (__connman_session_mode() == TRUE) { connman_info("Session mode enabled: " "direct provider connect disabled"); return __connman_error_failed(msg, -EINVAL); } err = __connman_provider_create_and_connect(msg); if (err < 0) { if (err == -EINPROGRESS) { connman_error("Invalid return code from connect"); err = -EINVAL; } return __connman_error_failed(msg, -err); } return NULL; }
static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { DBusMessage *reply; DBusMessageIter array, dict; connman_bool_t offlinemode, sessionmode; const char *str; DBG("conn %p", conn); reply = dbus_message_new_method_return(msg); if (reply == NULL) return NULL; dbus_message_iter_init_append(reply, &array); connman_dbus_dict_open(&array, &dict); str = __connman_notifier_get_state(); connman_dbus_dict_append_basic(&dict, "State", DBUS_TYPE_STRING, &str); offlinemode = __connman_technology_get_offlinemode(); connman_dbus_dict_append_basic(&dict, "OfflineMode", DBUS_TYPE_BOOLEAN, &offlinemode); sessionmode = __connman_session_mode(); connman_dbus_dict_append_basic(&dict, "SessionMode", DBUS_TYPE_BOOLEAN, &sessionmode); connman_dbus_dict_close(&array, &dict); return reply; }
static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { DBusMessage *reply; DBusMessageIter array, dict; connman_bool_t offlinemode, sessionmode; const char *str; DBG("conn %p", conn); reply = dbus_message_new_method_return(msg); if (reply == NULL) return NULL; dbus_message_iter_init_append(reply, &array); connman_dbus_dict_open(&array, &dict); connman_dbus_dict_append_array(&dict, "Services", DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL); connman_dbus_dict_append_array(&dict, "Technologies", DBUS_TYPE_OBJECT_PATH, __connman_technology_list, NULL); str = __connman_notifier_get_state(); connman_dbus_dict_append_basic(&dict, "State", DBUS_TYPE_STRING, &str); offlinemode = __connman_technology_get_offlinemode(); connman_dbus_dict_append_basic(&dict, "OfflineMode", DBUS_TYPE_BOOLEAN, &offlinemode); connman_dbus_dict_append_array(&dict, "AvailableTechnologies", DBUS_TYPE_STRING, __connman_notifier_list_registered, NULL); connman_dbus_dict_append_array(&dict, "EnabledTechnologies", DBUS_TYPE_STRING, __connman_notifier_list_enabled, NULL); connman_dbus_dict_append_array(&dict, "ConnectedTechnologies", DBUS_TYPE_STRING, __connman_notifier_list_connected, NULL); str = __connman_service_default(); if (str != NULL) connman_dbus_dict_append_basic(&dict, "DefaultTechnology", DBUS_TYPE_STRING, &str); connman_dbus_dict_append_array(&dict, "AvailableDebugs", DBUS_TYPE_STRING, __connman_debug_list_available, NULL); connman_dbus_dict_append_array(&dict, "EnabledDebugs", DBUS_TYPE_STRING, __connman_debug_list_enabled, NULL); sessionmode = __connman_session_mode(); connman_dbus_dict_append_basic(&dict, "SessionMode", DBUS_TYPE_BOOLEAN, &sessionmode); connman_dbus_dict_close(&array, &dict); return reply; }
static DBusMessage *connect_provider(DBusConnection *conn, DBusMessage *msg, void *data) { int err; DBG("conn %p", conn); if (__connman_session_mode()) { connman_info("Session mode enabled: " "direct provider connect disabled"); return __connman_error_failed(msg, EINVAL); } err = __connman_provider_create_and_connect(msg); if (err < 0) return __connman_error_failed(msg, -err); return NULL; }