E_SIGNAL_NET_CLOSED = 0,
E_SIGNAL_WIFI_TETHER_ON,
E_SIGNAL_WIFI_TETHER_OFF,
+ E_SIGNAL_P2P_TETHER_ON,
+ E_SIGNAL_P2P_TETHER_OFF,
E_SIGNAL_USB_TETHER_ON,
E_SIGNAL_USB_TETHER_OFF,
E_SIGNAL_BT_TETHER_ON,
#define SIGNAL_NAME_STA_DISCONNECT "sta_disconnected"
#define SIGNAL_NAME_WIFI_TETHER_ON "wifi_on"
#define SIGNAL_NAME_WIFI_TETHER_OFF "wifi_off"
+#define SIGNAL_NAME_P2P_TETHER_ON "p2p_on"
+#define SIGNAL_NAME_P2P_TETHER_OFF "p2p_off"
#define SIGNAL_NAME_USB_TETHER_ON "usb_on"
#define SIGNAL_NAME_USB_TETHER_OFF "usb_off"
#define SIGNAL_NAME_BT_TETHER_ON "bluetooth_on"
const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
GVariant *parameters, gpointer user_data);
+static void __handle_p2p_tether_on(GDBusConnection *connection, const gchar *sender_name,
+ const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
+ GVariant *parameters, gpointer user_data);
+
+static void __handle_p2p_tether_off(GDBusConnection *connection, const gchar *sender_name,
+ const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
+ GVariant *parameters, gpointer user_data);
+
static void __handle_usb_tether_on(GDBusConnection *connection, const gchar *sender_name,
const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
GVariant *parameters, gpointer user_data);
{0, SIGNAL_NAME_NET_CLOSED, __handle_net_closed},
{0, SIGNAL_NAME_WIFI_TETHER_ON, __handle_wifi_tether_on},
{0, SIGNAL_NAME_WIFI_TETHER_OFF, __handle_wifi_tether_off},
+ {0, SIGNAL_NAME_P2P_TETHER_ON, __handle_p2p_tether_on},
+ {0, SIGNAL_NAME_P2P_TETHER_OFF, __handle_p2p_tether_off},
{0, SIGNAL_NAME_USB_TETHER_ON, __handle_usb_tether_on},
{0, SIGNAL_NAME_USB_TETHER_OFF, __handle_usb_tether_off},
{0, SIGNAL_NAME_BT_TETHER_ON, __handle_bt_tether_on},
DBG("-\n");
}
+static void __handle_p2p_tether_on(GDBusConnection *connection, const gchar *sender_name,
+ const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
+ GVariant *parameters, gpointer user_data)
+{
+ DBG("+\n");
+ TETHERING_LOCK;
+ __invoke_enable_cb((__tethering_h *)user_data, TETHERING_TYPE_P2P, false);
+ TETHERING_UNLOCK;
+ DBG("-\n");
+}
+
+static void __handle_p2p_tether_off(GDBusConnection *connection, const gchar *sender_name,
+ const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
+ GVariant *parameters, gpointer user_data)
+{
+ DBG("+\n");
+ TETHERING_LOCK;
+ __invoke_disabled_cb((__tethering_h *)user_data, TETHERING_TYPE_P2P, parameters);
+ TETHERING_UNLOCK;
+ DBG("-\n");
+}
+
static void __handle_usb_tether_on(GDBusConnection *connection, const gchar *sender_name,
const gchar *object_path, const gchar *interface_name, const gchar *signal_name,
GVariant *parameters, gpointer user_data)