It is no longer needed as proper socket is use by IPC helpers.
#define L2CAP_PSM_AVDTP 0x19
#define SVC_HINT_CAPTURING 0x08
-static int notification_sk = -1;
static GIOChannel *server = NULL;
static GSList *devices = NULL;
static bdaddr_t adapter_addr;
return record;
}
-bool bt_a2dp_register(int sk, const bdaddr_t *addr)
+bool bt_a2dp_register(const bdaddr_t *addr)
{
GError *err = NULL;
sdp_record_t *rec;
DBG("");
- if (notification_sk >= 0)
- return false;
-
bacpy(&adapter_addr, addr);
server = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
}
record_id = rec->handle;
- notification_sk = sk;
-
return true;
}
{
DBG("");
- if (notification_sk < 0)
- return;
-
g_slist_foreach(devices, a2dp_device_disconnected, NULL);
devices = NULL;
- notification_sk = -1;
-
bt_adapter_remove_record(record_id);
record_id = 0;
void bt_a2dp_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_a2dp_register(int sk, const bdaddr_t *addr);
+bool bt_a2dp_register(const bdaddr_t *addr);
void bt_a2dp_unregister(void);
static uint16_t option_index = MGMT_INDEX_NONE;
-static int notification_sk = -1;
-
#define BASELEN_REMOTE_DEV_PROP (sizeof(struct hal_ev_remote_device_props) \
+ sizeof(struct hal_property))
/* This list contains addresses which are asked for records */
ipc_send_rsp(HAL_SERVICE_ID_BLUETOOTH, opcode, status);
}
-bool bt_bluetooth_register(int sk)
+void bt_bluetooth_register(void)
{
DBG("");
-
- if (notification_sk >= 0)
- return false;
-
- notification_sk = sk;
-
- return true;
}
void bt_bluetooth_unregister(void)
{
DBG("");
-
- if (notification_sk < 0)
- return;
-
- notification_sk = -1;
}
void bt_bluetooth_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_bluetooth_register(int sk);
+void bt_bluetooth_register(void);
void bt_bluetooth_unregister(void);
int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint);
static bdaddr_t adapter_addr;
-static int notification_sk = -1;
static GIOChannel *ctrl_io = NULL;
static GIOChannel *intr_io = NULL;
static GSList *devices = NULL;
}
}
-bool bt_hid_register(int sk, const bdaddr_t *addr)
+bool bt_hid_register(const bdaddr_t *addr)
{
GError *err = NULL;
DBG("");
- if (notification_sk >= 0)
- return false;
-
bacpy(&adapter_addr, addr);
ctrl_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
return false;
}
- notification_sk = sk;
-
return true;
}
{
DBG("");
- if (notification_sk < 0)
- return;
-
g_slist_foreach(devices, free_hid_devices, NULL);
devices = NULL;
- notification_sk = -1;
if (ctrl_io) {
g_io_channel_shutdown(ctrl_io, TRUE, NULL);
void bt_hid_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_hid_register(int sk, const bdaddr_t *addr);
+bool bt_hid_register(const bdaddr_t *addr);
void bt_hid_unregister(void);
static void service_register(void *buf, uint16_t len)
{
struct hal_cmd_register_module *m = buf;
- int sk = g_io_channel_unix_get_fd(hal_notif_io);
if (m->service_id > HAL_SERVICE_ID_MAX || services[m->service_id])
goto failed;
switch (m->service_id) {
case HAL_SERVICE_ID_BLUETOOTH:
- if (!bt_bluetooth_register(sk))
- goto failed;
+ bt_bluetooth_register();
break;
case HAL_SERVICE_ID_SOCK:
- if (!bt_socket_register(sk, &adapter_bdaddr))
- goto failed;
+ bt_socket_register(&adapter_bdaddr);
break;
case HAL_SERVICE_ID_HIDHOST:
- if (!bt_hid_register(sk, &adapter_bdaddr))
+ if (!bt_hid_register(&adapter_bdaddr))
goto failed;
break;
case HAL_SERVICE_ID_A2DP:
- if (!bt_a2dp_register(sk, &adapter_bdaddr))
+ if (!bt_a2dp_register(&adapter_bdaddr))
goto failed;
break;
case HAL_SERVICE_ID_PAN:
- if (!bt_pan_register(sk, &adapter_bdaddr))
+ if (!bt_pan_register(&adapter_bdaddr))
goto failed;
break;
#include "hal-msg.h"
#include "ipc.h"
-static int notification_sk = -1;
-
static uint8_t bt_pan_enable(struct hal_cmd_pan_enable *cmd, uint16_t len)
{
DBG("Not Implemented");
ipc_send_rsp(HAL_SERVICE_ID_PAN, opcode, status);
}
-bool bt_pan_register(int sk, const bdaddr_t *addr)
+bool bt_pan_register(const bdaddr_t *addr)
{
DBG("");
- if (notification_sk >= 0)
- return false;
-
- notification_sk = sk;
-
return true;
}
void bt_pan_unregister(void)
{
DBG("");
-
- if (notification_sk < 0)
- return;
-
- notification_sk = -1;
}
void bt_pan_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_pan_register(int sk, const bdaddr_t *addr);
+bool bt_pan_register(const bdaddr_t *addr);
void bt_pan_unregister(void);
ipc_send_rsp(HAL_SERVICE_ID_SOCK, opcode, HAL_STATUS_FAILED);
}
-bool bt_socket_register(int sk, const bdaddr_t *addr)
+void bt_socket_register(const bdaddr_t *addr)
{
DBG("");
bacpy(&adapter_addr, addr);
-
- return true;
}
void bt_socket_unregister(void)
void bt_sock_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_socket_register(int sk, const bdaddr_t *addr);
+void bt_socket_register(const bdaddr_t *addr);
void bt_socket_unregister(void);