static void __bt_device_services_callback(event_dev_services_t* uuid_list);
static void __bt_handle_ongoing_device_service_search(bt_remote_dev_info_t *remote_dev_info);
+static void __bt_device_trusted_callback(gboolean trusted, event_dev_trust_t* info);
+
void _bt_device_state_handle_callback_set_request(void)
{
_bt_service_register_event_handler_callback(
__bt_device_authorization_request_callback((event_dev_authorize_req_t*)event_data);
break;
}
+ case OAL_EVENT_DEVICE_TRUSTED: {
+ BT_INFO("Remote Device Trusted");
+ __bt_device_trusted_callback(TRUE, (event_dev_trust_t*)event_data);
+ break;
+ }
+ case OAL_EVENT_DEVICE_UNTRUSTED: {
+ BT_INFO("Remote Device UnTrusted");
+ __bt_device_trusted_callback(FALSE, (event_dev_trust_t*)event_data);
+ break;
+ }
default:
BT_INFO("Unhandled event..");
}
BT_DBG("-");
}
+static void __bt_device_trusted_callback(gboolean trusted, event_dev_trust_t* info)
+{
+ gchar address[BT_ADDRESS_STR_LEN];
+ int result = BLUETOOTH_ERROR_NONE;
+ GVariant *param = NULL;
+ int event;
+ BT_DBG("+");
+
+ _bt_convert_addr_type_to_string(address, info->address.addr);
+
+ param = g_variant_new("(is)", result, address);
+
+ event = trusted ? BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
+ BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED;
+ /* Send event to application */
+ _bt_send_event(BT_DEVICE_EVENT,
+ event,
+ param);
+ BT_DBG("-");
+}
+
static void __bt_free_pairing_info(bt_pairing_data_t **p_info)
{
bt_pairing_data_t * info = *p_info;