+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!DOCTYPE node PUBLIC
- "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
- "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
-
-<node>
- <interface name="org.tizen.tethering">
-
- <!-- Method definitions -->
-
- <method name="init">
- </method>
-
- <method name="deinit">
- </method>
-
- <method name="disable">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="enable_wifi_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="ssid" direction="in"/>
- <arg type="s" name="key" direction="in"/>
- <arg type="i" name="visibility" direction="in"/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="disable_wifi_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="enable_bt_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="disable_bt_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="enable_usb_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="disable_usb_tethering">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="u" name="result" direction="out"/>
- </method>
-
- <method name="get_station_info">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="a(usssu)" name="station" direction="out"/>
- </method>
-
- <method name="get_usb_station_info">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="a(sss)" name="usb_station" direction="out"/>
- </method>
-
- <method name="get_data_packet_usage">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="u" name="type" direction="out"/>
- <arg type="t" name="rx_data" direction="out"/>
- <arg type="t" name="tx_data" direction="out"/>
- </method>
-
- <method name="get_usb_interface_info">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="a(ssss)" name="interface" direction="out"/>
- </method>
-
- <method name="set_ip_forward_status">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="i" name="forward_status" direction="in"/>
- <arg type="i" name="result" direction="out"/>
- </method>
-
- <method name="get_ip_forward_status">
- <arg type="i" name="forward_status" direction="out"/>
- </method>
-
- <method name="get_wifi_tethering_hide_mode">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="i" name="hide_mode" direction="out"/>
- </method>
-
- <method name="set_wifi_tethering_hide_mode">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="i" name="hide_mode" direction="in"/>
- </method>
-
- <method name="get_wifi_tethering_ssid">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="ssid" direction="out"/>
- </method>
-
- <method name="get_wifi_tethering_security_type">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="security_type" direction="out"/>
- </method>
-
- <method name="set_wifi_tethering_security_type">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="security_type" direction="in"/>
- </method>
-
- <method name="get_wifi_tethering_passphrase">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="passphrase" direction="out"/>
- <arg type="u" name="len" direction="out"/>
- </method>
-
- <method name="set_wifi_tethering_passphrase">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="passphrase" direction="in"/>
- <arg type="u" name="len" direction="in"/>
- </method>
-
- <!-- Signal (D-Bus) definitions -->
- <signal name="net_closed">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="sta_connected">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="sta_disconnected">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="wifi_on">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="wifi_off">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="usb_on">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="usb_off">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="bluetooth_on">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="bluetooth_off">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="no_data_timeout">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="low_batt_mode">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="flight_mode">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="dhcp_status">
- <arg type="s" name="member" direction="out"/>
- <arg type="s" name="ip" direction="out"/>
- <arg type="s" name="mac" direction="out"/>
- <arg type="s" name="name" direction="out"/>
- <arg type="u" name="time" direction="out"/>
- </signal>
-
- <signal name="security_type_changed">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="ssid_visibility_changed">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- <signal name="passphrase_changed">
- <arg type="s" name="arg1" direction="out"/>
- </signal>
-
- </interface>
-</node>
-
#include <vconf.h>
-#include "tethering-client-stub.h"
-#include "marshal.h"
+#include "connman-lib.h"
+#include "connman-technology.h"
+/*#include "tethering-client-stub.h"
+#include "marshal.h"*/
#include "tethering_private.h"
-static void __handle_wifi_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data);
+/*static void __handle_wifi_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_wifi_tether_off(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_usb_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_usb_tether_off(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_flight_mode(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_security_type_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
static void __handle_ssid_visibility_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
-static void __handle_passphrase_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);
+static void __handle_passphrase_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data);*/
-static __tethering_sig_t sigs[] = {
+static void __handle_wifi_tether_changed(struct connman_technology *technology, void *user_data);
+static void __handle_usb_tether_changed(struct connman_technology *technology, void *user_data);
+static void __handle_bt_tether_changed(struct connman_technology *technology, void *user_data);
+static void __handle_passphrase_changed(struct connman_technology *technology, void *user_data);
+
+static void __handle_wifi_tether_on(void* user_data);
+static void __handle_wifi_tether_off(void* user_data);
+static void __handle_bt_tether_on(void* user_data);
+static void __handle_bt_tether_off(void* user_data);
+static void __handle_usb_tether_on(void* user_data);
+static void __handle_usb_tether_off(void* user_data);
+
+/*static __tethering_sig_t sigs[] = {
{SIGNAL_NAME_NET_CLOSED, __handle_net_closed},
{SIGNAL_NAME_WIFI_TETHER_ON, __handle_wifi_tether_on},
{SIGNAL_NAME_WIFI_TETHER_OFF, __handle_wifi_tether_off},
{SIGNAL_NAME_SECURITY_TYPE_CHANGED, __handle_security_type_changed},
{SIGNAL_NAME_SSID_VISIBILITY_CHANGED, __handle_ssid_visibility_changed},
{SIGNAL_NAME_PASSPHRASE_CHANGED, __handle_passphrase_changed},
- {"", NULL}};
+ {"", NULL}};*/
static bool __any_tethering_is_enabled(tethering_h tethering)
{
return false;
}
-
+/*
static tethering_error_e __get_error(int agent_error)
{
tethering_error_e err = TETHERING_ERROR_NONE;
return;
}
+*/
+static void __handle_wifi_tether_changed(struct connman_technology *technology, void* user_data)
+{
+ bool tether = connman_get_technology_tethering(technology);
+
+ if (tether)
+ {
+ g_print("=====wifi tethering has been enabled=====\n");
+ __handle_wifi_tether_on(user_data);
+ }
+ else
+ {
+ g_print("=====wifi tethering has been disabled=====\n");
+ __handle_wifi_tether_off(user_data);
+ }
+}
-static void __handle_wifi_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_usb_tether_changed(struct connman_technology *technology, void* user_data)
{
- DBG("+\n");
+ bool tether = connman_get_technology_tethering(technology);
+ if (tether)
+ {
+ g_print("=====usb tethering has been enabled=====\n");
+ __handle_usb_tether_on(user_data);
+ }
+ else
+ {
+ g_print("=====usb tethering has been disabled=====\n");
+ __handle_usb_tether_off(user_data);
+ }
+}
+
+static void __handle_bt_tether_changed(struct connman_technology *technology, void* user_data)
+{
+ bool tether = connman_get_technology_tethering(technology);
+
+ if (tether)
+ {
+ g_print("=====bt tethering has been enabled=====\n");
+ __handle_bt_tether_on(user_data);
+ }
+ else
+ {
+ g_print("=====bt tethering has been disabled=====\n");
+ __handle_bt_tether_off(user_data);
+ }
+}
+
+static void __handle_wifi_tether_on(void* user_data)
+{
+ DBG("+\n");
_retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
__tethering_h *th = (__tethering_h *)user_data;
return;
data = th->enabled_user_data[type];
+ g_print("=====wifi_tether_on callback is called=====\n");
ecb(TETHERING_ERROR_NONE, type, is_requested, data);
}
-static void __handle_wifi_tether_off(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_wifi_tether_off(void* user_data)
{
DBG("+\n");
dcb = th->disabled_cb[type];
if (dcb == NULL)
return;
- data = th->disabled_user_data[type];
+ data = th->disabled_user_data[type];
+/*
if (!g_strcmp0(value_name, SIGNAL_MSG_NOT_AVAIL_INTERFACE))
code = TETHERING_DISABLED_BY_WIFI_ON;
else if (!g_strcmp0(value_name, SIGNAL_MSG_TIMEOUT))
code = TETHERING_DISABLED_BY_TIMEOUT;
-
+*/
+ g_print("=====wifi_tether_off callback is called=====\n");
dcb(TETHERING_ERROR_NONE, type, code, data);
return;
}
-static void __handle_usb_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_usb_tether_on(void* user_data)
{
DBG("+\n");
return;
data = th->enabled_user_data[type];
+ g_print("=====usb_tether_on callback is called=====\n");
ecb(TETHERING_ERROR_NONE, type, is_requested, data);
}
-static void __handle_usb_tether_off(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_usb_tether_off(void* user_data)
{
DBG("+\n");
return;
data = th->disabled_user_data[type];
- if (!g_strcmp0(value_name, SIGNAL_MSG_NOT_AVAIL_INTERFACE))
+/* if (!g_strcmp0(value_name, SIGNAL_MSG_NOT_AVAIL_INTERFACE))
code = TETHERING_DISABLED_BY_USB_DISCONNECTION;
-
+*/
+ g_print("=====usb_tether_off callback is called=====\n");
dcb(TETHERING_ERROR_NONE, type, code, data);
return;
}
-static void __handle_bt_tether_on(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_bt_tether_on(void* user_data)
{
DBG("+\n");
return;
data = th->enabled_user_data[type];
+ g_print("=====bt_tether_on callback is called=====\n");
ecb(TETHERING_ERROR_NONE, type, is_requested, data);
}
-static void __handle_bt_tether_off(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+static void __handle_bt_tether_off(void* user_data)
{
DBG("+\n");
if (dcb == NULL)
return;
data = th->disabled_user_data[type];
-
+/*
if (!g_strcmp0(value_name, SIGNAL_MSG_NOT_AVAIL_INTERFACE))
code = TETHERING_DISABLED_BY_BT_OFF;
else if (!g_strcmp0(value_name, SIGNAL_MSG_TIMEOUT))
code = TETHERING_DISABLED_BY_TIMEOUT;
-
+*/
+ g_print("=====bt_tether_off callback is called=====\n");
dcb(TETHERING_ERROR_NONE, type, code, data);
return;
}
-
+/*
static void __handle_no_data_timeout(DBusGProxy *proxy, const char *value_name, gpointer user_data)
{
DBG("+\n");
return;
}
+*/
+static void set_connman_tethering_changed_cb(tethering_type_e type, void *user_data)
+{
+ struct connman_technology *technology;
+
+ if (type == TETHERING_TYPE_ALL) {
+ /* TETHERING_TYPE_ALL */
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_usb_tether_changed,
+ user_data);
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_wifi_tether_changed,
+ user_data);
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_bt_tether_changed,
+ user_data);
+ return;
+ }
-static void __handle_passphrase_changed(DBusGProxy *proxy, const char *value_name, gpointer user_data)
+ if (type == TETHERING_TYPE_USB) {
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_usb_tether_changed,
+ user_data);
+ }
+ else if (type == TETHERING_TYPE_WIFI) {
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_wifi_tether_changed,
+ user_data);
+ }
+ else if (type == TETHERING_TYPE_BT) {
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ if (technology != NULL)
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING,
+ __handle_bt_tether_changed,
+ user_data);
+ }
+}
+
+static void __handle_passphrase_changed(struct connman_technology* technology, void *user_data)
{
DBG("+\n");
data = th->passphrase_user_data;
+ g_print("=====wifi_passphrase_changed callback is called=====\n");
+
pcb(data);
return;
}
-
+/*
static void __cfm_cb(DBusGProxy *remoteobj, guint event, guint info,
GError *g_error, gpointer user_data)
{
return;
}
-
+*/
static bool __get_intf_name(tethering_type_e type, char *buf, unsigned int len)
{
_retvm_if(buf == NULL, false, "parameter(buf) is NULL\n");
return true;
}
-static void __deinit_cb(DBusGProxy *remoteobj,
+/*static void __deinit_cb(DBusGProxy *remoteobj,
GError *error, gpointer user_data)
{
_retm_if(user_data == NULL, "parameter(user_data) is NULL\n");
return;
}
-
+*/
/**
* @brief Creates the handle of tethering.
* @remarks The @a tethering must be released tethering_destroy() by you.
"parameter(tethering) is NULL\n");
__tethering_h *th = NULL;
- GError *error = NULL;
+/* GError *error = NULL;
int retry = TETHERING_DBUS_MAX_RETRY_COUNT;
-
+*/
th = (__tethering_h *)malloc(sizeof(__tethering_h));
_retvm_if(th == NULL, TETHERING_ERROR_OUT_OF_MEMORY,
"malloc is failed\n");
memset(th, 0x00, sizeof(__tethering_h));
-
+/*
#if !GLIB_CHECK_VERSION(2,35,0)
g_type_init();
#endif
}
__connect_signals((tethering_h)th);
-
+*/
*tethering = (tethering_h)th;
DBG("Tethering Handle : 0x%X\n", th);
+ connman_lib_init();
+
return TETHERING_ERROR_NONE;
}
__tethering_h *th = (__tethering_h *)tethering;
DBG("Tethering Handle : 0x%X\n", th);
- __disconnect_signals(tethering);
+/* __disconnect_signals(tethering);
org_tizen_tethering_deinit_async(th->client_bus_proxy, __deinit_cb,
(gpointer)tethering);
-
+*/
if (th->ssid)
free(th->ssid);
- g_object_unref(th->client_bus_proxy);
+/* g_object_unref(th->client_bus_proxy);
dbus_g_connection_unref(th->client_bus);
+*/
memset(th, 0x00, sizeof(__tethering_h));
free(th);
_retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
"parameter(tethering) is NULL\n");
- __tethering_h *th = (__tethering_h *)tethering;
- DBusGProxy *proxy = th->client_bus_proxy;
+ /*__tethering_h *th = (__tethering_h *)tethering;
+ DBusGProxy *proxy = th->client_bus_proxy;*/
+ struct connman_technology *technology;
switch (type) {
case TETHERING_TYPE_USB:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_ON,
G_CALLBACK(__handle_usb_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_usb_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering); */
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ connman_enable_tethering(technology);
break;
case TETHERING_TYPE_WIFI:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_ON,
G_CALLBACK(__handle_wifi_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_wifi_tethering_async(proxy,
th->ssid ? th->ssid : "", "", false,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ connman_enable_tethering(technology);
break;
case TETHERING_TYPE_BT:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_ON,
G_CALLBACK(__handle_bt_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_bt_tethering_async(proxy,
__cfm_cb, (gpointer)tethering);
-
+ */
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ connman_enable_tethering(technology);
break;
case TETHERING_TYPE_ALL:
/* TETHERING_TYPE_USB */
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_ON,
G_CALLBACK(__handle_usb_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_usb_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
/* TETHERING_TYPE_WIFI */
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_ON,
G_CALLBACK(__handle_wifi_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_wifi_tethering_async(proxy,
th->ssid ? th->ssid : "", "", false,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering); */
/* TETHERING_TYPE_BT */
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_ON,
+ /* dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_ON,
G_CALLBACK(__handle_bt_tether_on),
(gpointer)tethering);
org_tizen_tethering_enable_bt_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ connman_enable_tethering(technology);
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ connman_enable_tethering(technology);
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ connman_enable_tethering(technology);
break;
default:
_retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
"parameter(tethering) is NULL\n");
- __tethering_h *th = (__tethering_h *)tethering;
- DBusGProxy *proxy = th->client_bus_proxy;
+ /*__tethering_h *th = (__tethering_h *)tethering;
+ DBusGProxy *proxy = th->client_bus_proxy;*/
+ struct connman_technology *technology;
switch (type) {
case TETHERING_TYPE_USB:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_OFF,
+ /*dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_OFF,
G_CALLBACK(__handle_usb_tether_off),
(gpointer)tethering);
org_tizen_tethering_disable_usb_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ connman_disable_tethering(technology);
break;
case TETHERING_TYPE_WIFI:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_OFF,
+ /*dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_WIFI_TETHER_OFF,
G_CALLBACK(__handle_wifi_tether_off),
(gpointer)tethering);
org_tizen_tethering_disable_wifi_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ connman_disable_tethering(technology);
break;
case TETHERING_TYPE_BT:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_OFF,
+ /*dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_BT_TETHER_OFF,
G_CALLBACK(__handle_bt_tether_off),
(gpointer)tethering);
org_tizen_tethering_disable_bt_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ connman_disable_tethering(technology);
break;
case TETHERING_TYPE_ALL:
- dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_OFF,
+ /*dbus_g_proxy_disconnect_signal(proxy, SIGNAL_NAME_USB_TETHER_OFF,
G_CALLBACK(__handle_usb_tether_off),
(gpointer)tethering);
org_tizen_tethering_disable_usb_tethering_async(proxy,
G_CALLBACK(__handle_bt_tether_off),
(gpointer)tethering);
org_tizen_tethering_disable_bt_tethering_async(proxy,
- __cfm_cb, (gpointer)tethering);
+ __cfm_cb, (gpointer)tethering);*/
+ technology = connman_get_technology(TECH_TYPE_GADGET);
+ connman_disable_tethering(technology);
+ technology = connman_get_technology(TECH_TYPE_WIFI);
+ connman_disable_tethering(technology);
+ technology = connman_get_technology(TECH_TYPE_BLUETOOTH);
+ connman_disable_tethering(technology);
break;
default :
"tethering is not enabled\n");
__tethering_h *th = (__tethering_h *)tethering;
- DBusGProxy *proxy = th->client_bus_proxy;
-
+/* DBusGProxy *proxy = th->client_bus_proxy;
+*/
th->data_usage_cb = callback;
th->data_usage_user_data = user_data;
- org_tizen_tethering_get_data_packet_usage_async(proxy,
+/* org_tizen_tethering_get_data_packet_usage_async(proxy,
__get_data_usage_cb, (gpointer)th);
-
+*/
return TETHERING_ERROR_NONE;
}
TETHERING_ERROR_NOT_ENABLED,
"tethering is not enabled\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
__tethering_client_h client = {0, };
guint event = 0;
if (array->len > 0)
g_ptr_array_free(array, TRUE);
-
+*/
return TETHERING_ERROR_NONE;
}
_retvm_if(tethering == NULL, TETHERING_ERROR_INVALID_PARAMETER,
"parameter(tethering) is NULL\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
org_tizen_tethering_set_ip_forward_status_async(proxy, status,
__ip_forward_cb, (gpointer)tethering);
-
+*/
return TETHERING_ERROR_NONE;
}
_retvm_if(status == NULL, TETHERING_ERROR_INVALID_PARAMETER,
"parameter(status) is NULL\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
GError *error = NULL;
int forward_mode = 0;
*status = true;
else
*status = false;
-
+*/
return TETHERING_ERROR_NONE;
}
if (type != TETHERING_TYPE_ALL) {
th->enabled_cb[type] = callback;
th->enabled_user_data[type] = user_data;
-
- return TETHERING_ERROR_NONE;
}
-
- /* TETHERING_TYPE_ALL */
- for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
- th->enabled_cb[ti] = callback;
- th->enabled_user_data[ti] = user_data;
+ else {
+ /* TETHERING_TYPE_ALL */
+ for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
+ th->enabled_cb[ti] = callback;
+ th->enabled_user_data[ti] = user_data;
+ }
}
+ set_connman_tethering_changed_cb(type, tethering);
+
return TETHERING_ERROR_NONE;
}
if (type != TETHERING_TYPE_ALL) {
th->disabled_cb[type] = callback;
th->disabled_user_data[type] = user_data;
-
- return TETHERING_ERROR_NONE;
}
-
- /* TETHERING_TYPE_ALL */
- for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
- th->disabled_cb[ti] = callback;
- th->disabled_user_data[ti] = user_data;
+ else {
+ /* TETHERING_TYPE_ALL */
+ for (ti = TETHERING_TYPE_USB; ti <= TETHERING_TYPE_BT; ti++) {
+ th->disabled_cb[ti] = callback;
+ th->disabled_user_data[ti] = user_data;
+ }
}
+ set_connman_tethering_changed_cb(type, tethering);
+
return TETHERING_ERROR_NONE;
}
th->passphrase_changed_cb = callback;
th->passphrase_user_data = user_data;
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ connman_technology_set_property_changed_cb(technology,
+ TECH_PROP_TETHERING_PASSPHRASE,
+ __handle_passphrase_changed,
+ tethering);
return TETHERING_ERROR_NONE;
}
th->passphrase_changed_cb = NULL;
th->passphrase_user_data = NULL;
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ connman_technology_unset_property_changed_cb(
+ technology,
+ TECH_PROP_TETHERING_PASSPHRASE);
return TETHERING_ERROR_NONE;
}
"parameter(tethering) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
char *type_str = NULL;
org_tizen_tethering_set_wifi_tethering_security_type_async(proxy, type_str,
__wifi_set_security_type_cb, (gpointer)tethering);
-
+*/
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(type) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
GError *error = NULL;
char *type_str = NULL;
}
g_free(type_str);
-
+*/
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(tethering) is NULL\n");
_retvm_if(ssid == NULL, TETHERING_ERROR_INVALID_PARAMETER,
"parameter(ssid) is NULL\n");
-
+/*
__tethering_h *th = (__tethering_h *)tethering;
char *p_ssid;
int ssid_len;
if (th->ssid)
free(th->ssid);
th->ssid = p_ssid;
-
+*/
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ connman_set_wifi_tethering_identifier(technology, ssid);
return TETHERING_ERROR_NONE;
}
"parameter(ssid) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
GError *error = NULL;
char *ssid_buf = NULL;
}
g_free(ssid_buf);
-
+*/
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ *ssid = strdup(connman_get_wifi_tethering_identifier(technology));
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(tethering) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
int hide_mode = 0;
org_tizen_tethering_set_wifi_tethering_hide_mode_async(proxy, hide_mode,
__wifi_set_ssid_visibility_cb, (gpointer)tethering);
-
+*/
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(visible) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
GError *error = NULL;
int hide_mode = 0;
*visible = true;
else
*visible = false;
-
+*/
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(passphrase) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
int passphrase_len;
org_tizen_tethering_set_wifi_tethering_passphrase_async(proxy,
passphrase, passphrase_len,
__wifi_set_passphrase_cb, (gpointer)tethering);
-
+*/
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ connman_set_wifi_tethering_passphrase(technology, passphrase);
DBG("-\n");
return TETHERING_ERROR_NONE;
}
"parameter(passphrase) is NULL\n");
DBG("+\n");
- __tethering_h *th = (__tethering_h *)tethering;
+/* __tethering_h *th = (__tethering_h *)tethering;
DBusGProxy *proxy = th->client_bus_proxy;
GError *error = NULL;
char *passphrase_buf = NULL;
}
g_free(passphrase_buf);
-
+*/
+ struct connman_technology *technology = connman_get_technology(
+ TECH_TYPE_WIFI);
+ *passphrase = strdup(connman_get_wifi_tethering_passphrase(technology));
DBG("-\n");
return TETHERING_ERROR_NONE;
}