static void load_link_keys_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
- bt_adapter_ready cb = user_data;
+ bt_bluetooth_ready cb = user_data;
int err;
if (status) {
cb(err, NULL);
}
-static void load_link_keys(GSList *keys, bt_adapter_ready cb)
+static void load_link_keys(GSList *keys, bt_bluetooth_ready cb)
{
struct mgmt_cp_load_link_keys *cp;
struct mgmt_link_key_info *key;
const void *param, void *user_data)
{
const struct mgmt_rp_read_info *rp = param;
- bt_adapter_ready cb = user_data;
+ bt_bluetooth_ready cb = user_data;
uint32_t missing_settings, supported_settings;
int err;
static void mgmt_index_added_event(uint16_t index, uint16_t length,
const void *param, void *user_data)
{
- bt_adapter_ready cb = user_data;
+ bt_bluetooth_ready cb = user_data;
DBG("index %u", index);
const void *param, void *user_data)
{
const struct mgmt_rp_read_index_list *rp = param;
- bt_adapter_ready cb = user_data;
+ bt_bluetooth_ready cb = user_data;
uint16_t num;
int i;
{
const struct mgmt_rp_read_version *rp = param;
uint8_t mgmt_version, mgmt_revision;
- bt_adapter_ready cb = user_data;
+ bt_bluetooth_ready cb = user_data;
DBG("");
cb(-EIO, NULL);
}
-bool bt_adapter_start(int index, bt_adapter_ready cb)
+bool bt_bluetooth_start(int index, bt_bluetooth_ready cb)
{
DBG("index %d", index);
static void shutdown_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
- bt_adapter_stopped cb = user_data;
+ bt_bluetooth_stopped cb = user_data;
if (status != MGMT_STATUS_SUCCESS)
error("Clean controller shutdown failed");
cb();
}
-bool bt_adapter_stop(bt_adapter_stopped cb)
+bool bt_bluetooth_stop(bt_bluetooth_stopped cb)
{
struct mgmt_mode cp;
NULL) > 0;
}
-void bt_adapter_cleanup(void)
+void bt_bluetooth_cleanup(void)
{
g_free(adapter.name);
adapter.name = NULL;
return browse_remote_sdp(&addr);
}
-void bt_adapter_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len)
+void bt_bluetooth_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len)
{
uint8_t status = HAL_STATUS_FAILED;
ipc_send_rsp(sk, HAL_SERVICE_ID_BLUETOOTH, status);
}
-bool bt_adapter_register(int sk)
+bool bt_bluetooth_register(int sk)
{
DBG("");
return true;
}
-void bt_adapter_unregister(void)
+void bt_bluetooth_unregister(void)
{
DBG("");
*
*/
-typedef void (*bt_adapter_ready)(int err, const bdaddr_t *addr);
-bool bt_adapter_start(int index, bt_adapter_ready cb);
+typedef void (*bt_bluetooth_ready)(int err, const bdaddr_t *addr);
+bool bt_bluetooth_start(int index, bt_bluetooth_ready cb);
-typedef void (*bt_adapter_stopped)(void);
-bool bt_adapter_stop(bt_adapter_stopped cb);
+typedef void (*bt_bluetooth_stopped)(void);
+bool bt_bluetooth_stop(bt_bluetooth_stopped cb);
-void bt_adapter_cleanup(void);
+void bt_bluetooth_cleanup(void);
-void bt_adapter_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
+void bt_bluetooth_handle_cmd(int sk, uint8_t opcode, void *buf, uint16_t len);
-bool bt_adapter_register(int sk);
-void bt_adapter_unregister(void);
+bool bt_bluetooth_register(int sk);
+void bt_bluetooth_unregister(void);
int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint);
void bt_adapter_remove_record(uint32_t handle);
switch (m->service_id) {
case HAL_SERVICE_ID_BLUETOOTH:
- if (!bt_adapter_register(sk))
+ if (!bt_bluetooth_register(sk))
goto failed;
break;
switch (m->service_id) {
case HAL_SERVICE_ID_BLUETOOTH:
- bt_adapter_unregister();
+ bt_bluetooth_unregister();
break;
case HAL_SERVICE_ID_SOCK:
bt_socket_unregister();
__stop = true;
- if (!bt_adapter_stop(bluetooth_stopped)) {
+ if (!bt_bluetooth_stop(bluetooth_stopped)) {
g_main_loop_quit(event_loop);
return;
}
handle_service_core(msg->opcode, msg->payload, msg->len);
break;
case HAL_SERVICE_ID_BLUETOOTH:
- bt_adapter_handle_cmd(fd, msg->opcode, msg->payload, msg->len);
+ bt_bluetooth_handle_cmd(fd, msg->opcode, msg->payload,
+ msg->len);
break;
case HAL_SERVICE_ID_HIDHOST:
bt_hid_handle_cmd(fd, msg->opcode, msg->payload, msg->len);
return EXIT_FAILURE;
}
- if (!bt_adapter_start(option_index, adapter_ready))
+ if (!bt_bluetooth_start(option_index, adapter_ready))
return EXIT_FAILURE;
/* Use params: mtu = 0, flags = 0 */
cleanup_hal_connection();
stop_sdp_server();
- bt_adapter_cleanup();
+ bt_bluetooth_cleanup();
g_main_loop_unref(event_loop);
info("Exit");