+ DBG("Create wifi object.");
+ GDBusInterfaceSkeleton *interface_wifi = NULL;
+ GDBusInterfaceSkeleton *interface_connman_agent = NULL;
+ GDBusInterfaceSkeleton *interface_wifi_firmware = NULL;
+ GDBusConnection *connection = NULL;
+ GDBusObjectManagerServer *server = netdbus_get_wifi_manager();
+ if (server == NULL)
+ return;
+
+ connection = netdbus_get_connection();
+ g_dbus_object_manager_server_set_connection(server, connection);
+
+ /*Interface netconfig.wifi*/
+ wifi_object = wifi_skeleton_new();
+ interface_wifi = G_DBUS_INTERFACE_SKELETON(wifi_object);
+
+ /* WIFI power */
+ g_signal_connect(wifi_object, "handle-load-driver",
+ G_CALLBACK(handle_load_driver), NULL);
+ g_signal_connect(wifi_object, "handle-remove-driver",
+ G_CALLBACK(handle_remove_driver), NULL);
+ g_signal_connect(wifi_object, "handle-load-p2p-driver",
+ G_CALLBACK(handle_load_p2p_driver), NULL);
+ g_signal_connect(wifi_object, "handle-remove-p2p-driver",
+ G_CALLBACK(handle_remove_p2p_driver), NULL);
+
+ /* WIFI state */
+ g_signal_connect(wifi_object, "handle-get-wifi-state",
+ G_CALLBACK(handle_get_wifi_state), NULL);
+
+ /* WIFI scan */
+ g_signal_connect(wifi_object, "handle-request-bssid-scan",
+ G_CALLBACK(handle_request_bssid_scan), NULL);
+ g_signal_connect(wifi_object, "handle-get-bssid-list",
+ G_CALLBACK(handle_get_bssid_list), NULL);
+ g_signal_connect(wifi_object, "handle-netlink-scan",
+ G_CALLBACK(handle_netlink_scan), NULL);
+
+ /* WPS Connect */
+ g_signal_connect(wifi_object, "handle-request-wps-connect",
+ G_CALLBACK(handle_request_wps_connect), NULL);
+ g_signal_connect(wifi_object, "handle-request-wps-cancel",
+ G_CALLBACK(handle_request_wps_cancel), NULL);
+
+ /* WIFI direct */
+ g_signal_connect(wifi_object, "handle-launch-direct",
+ G_CALLBACK(handle_launch_direct), NULL);
+
+ /* EAP config */
+ g_signal_connect(wifi_object, "handle-create-eap-config",
+ G_CALLBACK(handle_create_eap_config), NULL);
+ g_signal_connect(wifi_object, "handle-delete-eap-config",
+ G_CALLBACK(handle_delete_eap_config), NULL);
+
+ /* VSIE methods */
+ g_signal_connect(wifi_object, "handle-add-vsie",
+ G_CALLBACK(handle_add_vsie), NULL);
+ g_signal_connect(wifi_object, "handle-get-vsie",
+ G_CALLBACK(handle_get_vsie), NULL);
+ g_signal_connect(wifi_object, "handle-remove-vsie",
+ G_CALLBACK(handle_remove_vsie), NULL);
+
+ /* IP conflict methods */
+ g_signal_connect(wifi_object, "handle-ip-conflict-set-enable",
+ G_CALLBACK(handle_ip_conflict_set_enable), NULL);
+ g_signal_connect(wifi_object, "handle-is-ip-conflict-detect-enabled",
+ G_CALLBACK(handle_is_ip_conflict_detect_enabled), NULL);
+ g_signal_connect(wifi_object, "handle-set-ip-conflict-period",
+ G_CALLBACK(handle_set_ip_conflict_period), NULL);
+ g_signal_connect(wifi_object, "handle-get-ip-conflict-state",
+ G_CALLBACK(handle_get_ip_conflict_state), NULL);
+ g_signal_connect(wifi_object, "handle-get-ip-conflict-period",
+ G_CALLBACK(handle_get_ip_conflict_period), NULL);
+
+ /* WIFI configuration */
+ g_signal_connect(wifi_object, "handle-save-configuration",
+ G_CALLBACK(handle_save_configuration), NULL);
+ g_signal_connect(wifi_object, "handle-remove-configuration",
+ G_CALLBACK(handle_remove_configuration), NULL);
+ g_signal_connect(wifi_object, "handle-get-config-ids",
+ G_CALLBACK(handle_get_config_ids), NULL);
+ g_signal_connect(wifi_object, "handle-load-configuration",
+ G_CALLBACK(handle_load_configuration), NULL);
+ g_signal_connect(wifi_object, "handle-set-config-field",
+ G_CALLBACK(handle_set_config_field), NULL);
+ g_signal_connect(wifi_object, "handle-get-config-passphrase",
+ G_CALLBACK(handle_get_config_passphrase), NULL);
+
+ /* WIFI EAP configuration */
+ g_signal_connect(wifi_object, "handle-save-eap-configuration",
+ G_CALLBACK(handle_save_eap_configuration), NULL);
+ g_signal_connect(wifi_object, "handle-load-eap-configuration",
+ G_CALLBACK(handle_load_eap_configuration), NULL);
+
+ /* BG scan mode */
+ g_signal_connect(wifi_object, "handle-set-bgscan",
+ G_CALLBACK(handle_set_bgscan), NULL);
+ g_signal_connect(wifi_object, "handle-resume-bgscan",
+ G_CALLBACK(handle_resume_bgscan), NULL);
+ g_signal_connect(wifi_object, "handle-pause-bgscan",
+ G_CALLBACK(handle_pause_bgscan), NULL);
+ g_signal_connect(wifi_object, "handle-reset-bgscan-interval",
+ G_CALLBACK(handle_reset_bgscan_interval), NULL);
+
+ /* Auto Scan Mode */
+ g_signal_connect(wifi_object, "handle-get-autoscan",
+ G_CALLBACK(handle_get_autoscan), NULL);
+ g_signal_connect(wifi_object, "handle-get-autoscanmode",
+ G_CALLBACK(handle_get_autoscanmode), NULL);
+
+ /* Extension API methods */
+ g_signal_connect(wifi_object, "handle-flush-bss",
+ G_CALLBACK(handle_flush_bss), NULL);
+
+ /* Passpoint */
+ g_signal_connect(wifi_object, "handle-set-passpoint",
+ G_CALLBACK(handle_set_passpoint), NULL);
+ g_signal_connect(wifi_object, "handle-get-passpoint",
+ G_CALLBACK(handle_get_passpoint), NULL);
+
+ /* EAP authentication */
+ g_signal_connect(wifi_object, "handle-get-aka-auth",
+ G_CALLBACK(handle_get_aka_auth), NULL);
+ g_signal_connect(wifi_object, "handle-get-sim-auth",
+ G_CALLBACK(handle_get_sim_auth), NULL);
+ g_signal_connect(wifi_object, "handle-get-sim-imsi",
+ G_CALLBACK(handle_get_sim_imsi), NULL);
+ g_signal_connect(wifi_object, "handle-req-aka-auth",
+ G_CALLBACK(handle_req_aka_auth), NULL);
+ g_signal_connect(wifi_object, "handle-req-sim-auth",
+ G_CALLBACK(handle_req_sim_auth), NULL);
+
+ /* WIFI MDM blacklist */
+ g_signal_connect(wifi_object, "handle-check-black-list",
+ G_CALLBACK(handle_check_black_list), NULL);
+
+ /* TDLS methods */
+ g_signal_connect(wifi_object, "handle-tdls-disconnect",
+ G_CALLBACK(handle_tdls_disconnect), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-connected-peer",
+ G_CALLBACK(handle_tdls_connected_peer), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-discover",
+ G_CALLBACK(handle_tdls_discover), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-connect",
+ G_CALLBACK(handle_tdls_connect), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-channel-switch",
+ G_CALLBACK(handle_tdls_channel_switch), NULL);
+ g_signal_connect(wifi_object, "handle-tdls-cancel-channel-switch",
+ G_CALLBACK(handle_tdls_cancel_channel_switch), NULL);
+
+ /* Passphrase Encryption */
+ g_signal_connect(wifi_object, "handle-encrypt-passphrase",
+ G_CALLBACK(handle_encrypt_passphrase), NULL);
+ g_signal_connect(wifi_object, "handle-decrypt-passphrase",
+ G_CALLBACK(handle_decrypt_passphrase), NULL);
+
+ if (!g_dbus_interface_skeleton_export(interface_wifi, connection,
+ NETCONFIG_WIFI_PATH, NULL)) {
+ ERR("Export WIFI_PATH for wifi failed");
+ }
+
+ /* Interface connman.Agent */
+ connman_agent_object = net_connman_agent_skeleton_new();
+
+ interface_connman_agent = G_DBUS_INTERFACE_SKELETON(connman_agent_object);
+ g_signal_connect(connman_agent_object, "handle-report-error",
+ G_CALLBACK(handle_report_error), NULL);
+ g_signal_connect(connman_agent_object, "handle-request-browser",
+ G_CALLBACK(handle_request_browser), NULL);
+ g_signal_connect(connman_agent_object, "handle-request-input",
+ G_CALLBACK(handle_request_input), NULL);
+ g_signal_connect(connman_agent_object, "handle-set-field",
+ G_CALLBACK(handle_set_field), NULL);
+
+ if (!g_dbus_interface_skeleton_export(interface_connman_agent, connection,
+ NETCONFIG_WIFI_PATH, NULL)) {
+ ERR("Export WIFI_PATH for agent failed");
+ }
+
+ /*Interface netconfig.wifi.Firmware*/
+ wififirmware_object = wifi_firmware_skeleton_new();