BT_MAP_SERVICE_ID, /* Message Access Profile */
BT_MN_SERVICE_ID, /* Message Notification Service */
BT_HDP_SERVICE_ID, /* Health Device Profile */
- BT_PCE_SERVICE_ID /* PhoneBook Access Client*/
+ BT_PCE_SERVICE_ID, /* PhoneBook Access Client*/
+#ifdef TIZEN_BT_HAL
+ BT_IOTIVITY_SERVICE_ID, /* Custom IOTIVITY UUID */
+#endif
} bt_service_id_t;
#define BT_MAX_NUM_UUIDS 32
#define BT_HAL_HFP_AUDIO_GATEWAY_UUID "0000111f-0000-1000-8000-00805f9b34fb"
#define BT_HAL_HSP_AUDIO_GATEWAY_UUID "00001112-0000-1000-8000-00805f9b34fb"
#define BT_HAL_HFP_HF_UUID "0000111e-0000-1000-8000-00805f9b34fb"
+#define BT_HAL_HSP_HS_UUID "00001108-0000-1000-8000-00805f9b34fb"
#define BT_HAL_A2DP_PROFILE_UUID "0000110d-0000-1000-8000-00805f9b34fb" /* This is A2DP Profile UUID */
#define BT_HAL_A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb" /* This is A2DP Profile Role(SRC) UUID */
#define BT_HAL_A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb" /* This is A2DP Profile Role(SNK) UUID */
#define BT_HAL_HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
#define BT_HAL_SAP_UUID_OLD "a49eb41e-cb06-495c-9f4f-bb80a90cdf00"
#define BT_HAL_SAP_UUID_NEW "a49eb41e-cb06-495c-9f4f-aa80a90cdf4a"
+
+#ifdef TIZEN_BT_HAL
+#define BT_HAL_HID_DEVICE_UUID "00001124-0000-1000-8000-00805f9b43bf"
+#define BT_HAL_IOTIVITY_UUID "12341234-1c25-481f-9dfb-59193d238280"
+#endif
+
// List of Protocols
#define BASE 0x0000 //Base
#define SDP 0x0001 //Bluetooth Core Specification
if (!name)
name = address;
-#ifdef TIZEN_SYSPOPUP_SUPPORTED
- __bt_hal_get_auth_info(reply, (char *)auth_info);
- if (__bt_hal_device_is_hid_keyboard(device_class)) {
- DBG("Device is HID Keyboard");
- char str_passkey[BT_HAL_PASSKEY_MAX_LENGTH + 1] = { 0 };
- if (__bt_hal_device_generate_passkey(str_passkey,
- BT_HAL_PASSKEY_MAX_LENGTH) != 0) {
- gap_agent_reply_pin_code(agent, GAP_AGENT_REJECT,
- "", NULL);
- goto done;
- }
- gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT,
- str_passkey, NULL);
+ if (headed_plugin_info->plugin_headed_enabled) {
+ __bt_hal_get_auth_info(reply, (char *)auth_info);
+ if (__bt_hal_device_is_hid_keyboard(device_class)) {
+ char str_passkey[BT_HAL_PASSKEY_MAX_LENGTH + 1] = { 0 };
+
+ DBG("Device is HID Keyboard");
+ if (__bt_hal_device_generate_passkey(str_passkey,
+ BT_HAL_PASSKEY_MAX_LENGTH) != 0) {
+ gap_agent_reply_pin_code(agent, GAP_AGENT_REJECT,
+ "", NULL);
+ goto done;
+ }
- DBG("Launch BT Syspopup");
+ gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT,
+ str_passkey, NULL);
- if (headed_plugin_info->plugin_headed_enabled) {
- headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
+ DBG("Launch BT Syspopup");
+ headed_plugin_info->headed_plugin->bt_launch_system_popup(
+ BT_HAL_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
name, auth_info, str_passkey, NULL, _gap_agent_get_path(agent));
- } else {
-#if TODO_40
- GVariant *param = NULL;
- param = g_variant_new("(isss)", ret, address, name, str_passkey);
- _bt_send_event(BT_ADAPTER_EVENT, BLUETOOTH_EVENT_KEYBOARD_PASSKEY_DISPLAY, param);
-#endif
- }
- } else if (!__bt_hal_device_is_auto_response(device_class, address, name)) {
- DBG("Device is not of AUto response class, Show PIN Entry");
- if (headed_plugin_info->plugin_headed_enabled) {
- DBG("Show Pin entry");
- headed_plugin_info->headed_plugin->bt_launch_system_popup(BT_HAL_AGENT_EVENT_PIN_REQUEST, name, auth_info,
+ } else if (!__bt_hal_device_is_auto_response(device_class, address, name)) {
+ DBG("Device is not of Auto response class, Show PIN Entry");
+ headed_plugin_info->headed_plugin->bt_launch_system_popup(
+ BT_HAL_AGENT_EVENT_PIN_REQUEST, name, auth_info,
NULL, NULL, _gap_agent_get_path(agent));
} else {
- INFO("Plugin Headed not Enabled");
+ DBG("Device is of Type Auto response, send event to HAL");
__bt_hal_send_pin_request_event(address, name, device_class);
}
} else {
- DBG("Device is of Type Auto response, send event to HAL");
+ INFO("Plugin Headed not Enabled");
__bt_hal_send_pin_request_event(address, name, device_class);
}
-#else
- DBG("PIN CODE request, device class [%u]", device_class);
- __bt_hal_send_pin_request_event(address, name, device_class);
-#endif
done:
g_variant_unref(reply);
INFO("Device is not Trusted, so prompt user to accept or reject authorization \n");
}
+ if (!strcasecmp(uuid, BT_HAL_HFP_AUDIO_GATEWAY_UUID) ||
+ !strcasecmp(uuid, BT_HAL_HSP_AUDIO_GATEWAY_UUID) ||
+ !strcasecmp(uuid, BT_HAL_HFP_HF_UUID) ||
+ !strcasecmp(uuid, BT_HAL_HSP_HS_UUID) ||
+ !strcasecmp(uuid, BT_HAL_A2DP_PROFILE_UUID) ||
+ !strcasecmp(uuid, BT_HAL_HID_UUID) ||
+ !strcasecmp(uuid, BT_HAL_HID_DEVICE_UUID) ||
+ !strcasecmp(uuid, BT_HAL_SAP_UUID_OLD) ||
+ !strcasecmp(uuid, BT_HAL_SAP_UUID_NEW) ||
+#ifdef TIZEN_BT_HAL
+ !strcasecmp(uuid, BT_HAL_IOTIVITY_UUID) ||
+#endif
+ !strcasecmp(uuid, BT_HAL_AVRCP_TARGET_UUID)) {
+ DBG("Authorization for UUID: %s, send event", uuid);
+ __bt_hal_send_authorize_request_event(address, uuid);
+ goto done;
+ }
+
#ifdef TIZEN_BT_HAL
if (!strcasecmp(uuid, BT_HAL_OPP_UUID) &&
(NULL != _bt_hal_gap_agent_find_osp_server_by_type(
return TRUE;
}
-#ifdef TIZEN_SYSPOPUP_SUPPORTED
static gboolean __bt_hal_device_is_hid_keyboard(unsigned int dev_class)
{
switch ((dev_class & 0x1f00) >> 8) {
return TRUE;
}
-#endif
static GVariant *__bt_hal_service_getall(GDBusProxy *device, const char *interface)
{
service_id = BT_SAP_SERVICE_ID;
else if (!strcasecmp(uuid, BT_HAL_SAP_UUID_NEW))
service_id = BT_SAP_SERVICE_ID;
+ else if (!strcasecmp(uuid, BT_HAL_HSP_HS_UUID))
+ service_id = BT_HSP_HS_SERVICE_ID;
+ else if (!strcasecmp(uuid, BT_HAL_HFP_HF_UUID))
+ service_id = BT_HFP_HS_SERVICE_ID;
+#ifdef TIZEN_BT_HAL
+ else if (!strcasecmp(uuid, BT_HAL_HID_DEVICE_UUID))
+ service_id = BT_HID_SERVICE_ID;
+ else if (!strcasecmp(uuid, BT_HAL_IOTIVITY_UUID))
+ service_id = BT_IOTIVITY_SERVICE_ID;
+#endif
else
ERR("Unknwon Service uuid, return BT_RES_SERVICE_ID");
switch (service_id) {
case BT_HFP_SERVICE_ID:
- return g_strdup(BT_HAL_HFP_HF_UUID);
+ return g_strdup(BT_HAL_HFP_AUDIO_GATEWAY_UUID);
case BT_HSP_SERVICE_ID:
return g_strdup(BT_HAL_HSP_AUDIO_GATEWAY_UUID);
case BT_A2DP_SERVICE_ID:
case BT_PANU_SERVICE_ID:
case BT_VDP_SERVICE_ID:
case BT_HSP_HS_SERVICE_ID:
+ return g_strdup(BT_HAL_HSP_HS_UUID);
case BT_HFP_HS_SERVICE_ID:
+ return g_strdup(BT_HAL_HFP_HF_UUID);
case BT_MN_SERVICE_ID:
case BT_HDP_SERVICE_ID:
case BT_PCE_SERVICE_ID:
+#ifdef TIZEN_BT_HAL
+ case BT_IOTIVITY_SERVICE_ID:
+ return g_strdup(BT_HAL_IOTIVITY_UUID);
+#endif
default:
ERR("Unknwon Service id: %d, return NULL");
}
/* NOTE: If anything changes in bt_service_id_t enum definition of Bluedroid header, change here too */
typedef enum {
A2DP_SRC_SERVICE_ID = 3,
- HFP_HF_SERVICE_ID = 6,
+ HSP_SERVICE_ID = 5,
+ HFP_SERVICE_ID = 6,
OPP_SERVICE_ID = 7,
AVRCP_CT_SERVICE_ID = 9,
+ SAP_SERVICE_ID = 17,
A2DP_SERVICE_ID = 18,
AVRCP_SERVICE_ID = 19,
- HID_SERVICE_ID = 20
+ HID_SERVICE_ID = 20,
+ HSP_HS_SERVICE_ID = 23,
+ HFP_HS_SERVICE_ID = 24,
+#ifdef TIZEN_BT_HAL
+ IOTIVITY_SERVICE_ID = 29,
+#endif
} oal_service_t;
/** Bluetooth 128-bit UUID */
BT_INFO("service_d: %d", service_d);
- switch(service_d) {
- case HID_SERVICE_ID:
- BT_INFO("Incoming HID Profile conn Req from device addr [%s]", address);
- break;
- case A2DP_SERVICE_ID:
- BT_INFO("Incoming A2DP(Remote Sink) profile conn Req from device addr [%s]", address);
- _bt_a2dp_src_handle_incoming_authorization(address, service_d);
- return;
- case A2DP_SRC_SERVICE_ID:
+ switch(service_d) {
+ case HID_SERVICE_ID:
+ BT_INFO("Incoming HID Profile conn Req from device addr [%s]", address);
+ break;
+ case A2DP_SERVICE_ID:
+ BT_INFO("Incoming A2DP(Remote Sink) profile conn Req from device addr [%s]", address);
+ _bt_a2dp_src_handle_incoming_authorization(address, service_d);
+ return;
+ case A2DP_SRC_SERVICE_ID:
BT_INFO("Incoming A2DP(Remote Source) Profile conn Req from device addr [%s]", address);
_bt_a2dp_sink_handle_incoming_authorization(address, service_d);
- break;
- case AVRCP_SERVICE_ID:
- BT_INFO("Incoming AVRCP (Remote) Profile conn Req from device addr [%s]", address);
- break;
- case AVRCP_CT_SERVICE_ID:
- BT_INFO("Incoming AVRCP (Controller) Profile conn Req from device addr [%s]", address);
- break;
+ break;
+ case AVRCP_SERVICE_ID:
+ BT_INFO("Incoming AVRCP (Remote) Profile conn Req from device addr [%s]", address);
+ break;
+ case AVRCP_CT_SERVICE_ID:
+ BT_INFO("Incoming AVRCP (Controller) Profile conn Req from device addr [%s]", address);
+ break;
#ifdef TIZEN_FEATURE_BT_OBEX
case OPP_SERVICE_ID: {
GVariant *param = NULL;
char *name = g_strdup(address); /* TODO: Retrieve and send correct name in OBEX conn auth req event */
- BT_INFO("Incoming OPP conn Req from device addr [%s]", address);
+ BT_INFO("Incoming OPP conn Req from device addr [%s]", address);
_bt_obex_server_set_pending_conn_auth_device_addr(address);
param = g_variant_new("(iss)", BLUETOOTH_ERROR_NONE, address, name);
_bt_send_event(BT_OPP_SERVER_EVENT,
return;
}
#endif
- default:
- /* For now, reject authorization for any service apart from above switch cases */
- BT_INFO("Incoming Profile conn req with service ID [%d] from device addr [%s]", service_d, address);
- res = device_reply_auth_request((bt_address_t*)&auth_event->address, service_d, FALSE, FALSE);
- if (res != OAL_STATUS_SUCCESS)
- BT_ERR("authorize_response: %d", res);
- return;
- }
+ case HSP_SERVICE_ID:
+ BT_INFO("Incoming HSP_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+ case HFP_SERVICE_ID:
+ BT_INFO("Incoming HFP_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+ case SAP_SERVICE_ID:
+ BT_INFO("Incoming SAP_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+ case HSP_HS_SERVICE_ID:
+ BT_INFO("Incoming HSP_HS_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+ case HFP_HS_SERVICE_ID:
+ BT_INFO("Incoming HFP_HS_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+#ifdef TIZEN_BT_HAL
+ case IOTIVITY_SERVICE_ID:
+ BT_INFO("Incoming IOTIVITY_SERVICE_ID conn Req from device addr [%s]", address);
+ break;
+#endif
+ default:
+ /* For now, reject authorization for any service apart from above switch cases */
+ BT_INFO("Incoming Profile conn req with service ID [%d] from device addr [%s]", service_d, address);
+ res = device_reply_auth_request((bt_address_t*)&auth_event->address, service_d, FALSE, FALSE);
+ if (res != OAL_STATUS_SUCCESS)
+ BT_ERR("authorize_response: %d", res);
+ return;
+ }
/* Auto accept authorization request for HID, A2DP and AVRCP profiles */
BT_INFO("Auto Accept authorization");
svc_id = A2DP_SRC_SERVICE_ID; /* Remote is A2DP Source*/
break;
case BT_PROFILE_CONN_HSP:
- svc_id = HFP_HF_SERVICE_ID; /* Remote is HFP HF Unit */
+ svc_id = HFP_HS_SERVICE_ID; /* Remote is HFP HF Unit */
break;
default:
BT_DBG("Unknown svc_type: %d", svc_type);