break;
#endif
#ifdef TIZEN_GATT_CLIENT
- case BLUETOOTH_EVENT_GATT_READ_CHAR: /* GATT Client */
- signal = BT_GATT_CLIENT_READ_CHAR;
- break;
- case BLUETOOTH_EVENT_GATT_WRITE_CHAR: /* GATT Client */
- signal = BT_GATT_CLIENT_WRITE_CHAR;
- break;
- case BLUETOOTH_EVENT_GATT_READ_DESC: /* GATT Client */
- signal = BT_GATT_CLIENT_READ_DESC;
- break;
- case BLUETOOTH_EVENT_GATT_WRITE_DESC: /* GATT Client */
- signal = BT_GATT_CLIENT_WRITE_DESC;
- break;
case BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED: /* GATT Client */
signal = BT_GATT_CLIENT_SERVICE_CHANGED;
break;
case BT_HDP_EVENT:
path = BT_HDP_DEVICE_PATH;
break;
+#ifdef TIZEN_GATT_CLIENT
+ case BT_GATT_CLIENT_EVENT:
+ path = BT_GATT_CLIENT_PATH;
+ break;
+#endif
default:
BT_ERR("Unknown event");
return BLUETOOTH_ERROR_INTERNAL;
case BLUETOOTH_EVENT_HDP_DISCONNECTED:
signal = BT_HDP_DISCONNECTED;
break;
+#ifdef TIZEN_GATT_CLIENT
+ case BLUETOOTH_EVENT_GATT_READ_CHAR: /* GATT Client */
+ signal = BT_GATT_CLIENT_READ_CHAR;
+ break;
+ case BLUETOOTH_EVENT_GATT_WRITE_CHAR: /* GATT Client */
+ signal = BT_GATT_CLIENT_WRITE_CHAR;
+ break;
+ case BLUETOOTH_EVENT_GATT_READ_DESC: /* GATT Client */
+ signal = BT_GATT_CLIENT_READ_DESC;
+ break;
+ case BLUETOOTH_EVENT_GATT_WRITE_DESC: /* GATT Client */
+ signal = BT_GATT_CLIENT_WRITE_DESC;
+ break;
+#endif
+
default:
BT_ERR("Unknown event");
return BLUETOOTH_ERROR_INTERNAL;
} bt_gatt_included_service_info_t;
static GSList *list_gatt_info = NULL;
-
#endif
/* App Information structure */
}
/* Event handlers */
+static void __bt_gatt_get_pending_request_info(int service_function,
+ char **sender)
+{
+ GSList *l;
+ invocation_info_t *req_info = NULL;
+
+ for (l = _bt_get_invocation_list(); l != NULL; l = g_slist_next(l)) {
+ req_info = l->data;
+ if (req_info == NULL)
+ continue;
+
+ if (req_info->service_function == service_function) {
+ *sender = req_info->sender;
+ break;
+ }
+ }
+}
+
static void __bt_gatt_handle_pending_request_info(int result,
int service_function, void *data, unsigned int size)
{
data);
/* Send Event */
- _bt_send_event(BT_GATT_CLIENT_EVENT,
+ char *sender = NULL;
+ __bt_gatt_get_pending_request_info(BT_GATT_READ_CHARACTERISTIC, &sender);
+ _bt_send_event_to_dest(sender, BT_GATT_CLIENT_EVENT,
BLUETOOTH_EVENT_GATT_READ_CHAR,
param);
}
conn_info = __bt_find_remote_gatt_server_info_from_conn_id(
event_data->uuid_status.conn_status.conn_id);
- BT_INFO("Descriptor Read result from addr [%s] status [%d]",
+ BT_DBG("Descriptor Read result from addr [%s] status [%d]",
conn_info->addr, event_data->uuid_status.conn_status.status);
/* Fill descriptor informations in buffer */
if (event_data->uuid_status.conn_status.status != OAL_STATUS_SUCCESS)
result = BLUETOOTH_ERROR_INTERNAL;
else {
- BT_INFO("desc data len:%d", event_data->data_len);
if (event_data->data_len > 0) {
/* DEBUG */
for (i = 0; i < event_data->data_len; i++)
data);
/* Send Event */
- _bt_send_event(BT_GATT_CLIENT_EVENT,
+ char *sender = NULL;
+ __bt_gatt_get_pending_request_info(BT_GATT_READ_DESCRIPTOR_VALUE, &sender);
+ _bt_send_event_to_dest(sender, BT_GATT_CLIENT_EVENT,
BLUETOOTH_EVENT_GATT_READ_DESC,
param);
}
- BT_INFO("Send DBUS rpely for GATT Read Descriptor");
+
/* Send DBUS return */
__bt_gatt_handle_pending_request_info(result,
BT_GATT_READ_DESCRIPTOR_VALUE,
event_data->char_id.inst_id);
/* Send Event */
- _bt_send_event(BT_GATT_CLIENT_EVENT,
+ char *sender = NULL;
+ __bt_gatt_get_pending_request_info(BT_GATT_WRITE_CHARACTERISTIC_VALUE_BY_TYPE, &sender);
+ _bt_send_event_to_dest(sender, BT_GATT_CLIENT_EVENT,
BLUETOOTH_EVENT_GATT_WRITE_CHAR,
param);
g_free(svc_uuid);
if (char_uuid)
g_free(char_uuid);
+
done:
/* Send DBUS return */
__bt_gatt_handle_pending_request_info(result,
return;
}
- BT_INFO("Descriptor Write callback from addr [%s] status [%d]",
+ BT_DBG("Descriptor Write callback from addr [%s] status [%d]",
conn_info->addr, event_data->conn_status.status);
/* Fill descriptor informations in buffer */
event_data->descr_id.inst_id);
/* Send Event */
- _bt_send_event(BT_GATT_CLIENT_EVENT,
+ char *sender = NULL;
+ __bt_gatt_get_pending_request_info(BT_GATT_WRITE_DESCRIPTOR_VALUE, &sender);
+ _bt_send_event_to_dest(sender, BT_GATT_CLIENT_EVENT,
BLUETOOTH_EVENT_GATT_WRITE_DESC,
param);