} else if (strcasecmp(signal_name, BT_GATT_SERVER_ACQUIRE_NOTIFICATION) == 0) {
- bluetooth_gatt_server_send_acquire_notify_response(parameters);
+ bluetooth_gatt_server_send_acquire_notify_response(parameters, event_info);
} else if (strcasecmp(signal_name, BT_GATT_SERVER_NOTIFICATION_COMPLETED) == 0) {
const char *address = NULL;
static gboolean bluetooth_gatt_write_channel_watch_cb(GIOChannel *gio,
GIOCondition cond, gpointer data)
{
+ BT_INFO("+");
+
bluetooth_gatt_acquire_notify_info_t *chr_info = (bluetooth_gatt_acquire_notify_info_t *)data;
- if (!chr_info)
+ if (!chr_info) {
+ BT_INFO("chr_info is NULL");
return FALSE;
+ }
if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR)) {
BT_ERR("Error : GIOCondition %d, []", cond);;
-void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameters)
+void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameters, bt_event_info_t *event_info)
{
int con_id = -1;
int tran_id = -1;
int result = -1;
int fd = -1;
bluetooth_gatt_acquire_notify_info_t *chr_info;
+ const char *address = NULL;
- g_variant_get(parameters, "(iiiiii)",
+ g_variant_get(parameters, "(iiiiiis)",
&result,
&con_id,
&tran_id,
&att_han,
&mtu,
- &offset);
+ &offset,
+ &address);
BT_DBG("GATT ServerAcquire Conn ID: [%d]", con_id);
BT_DBG("GATT Server Acquire notify att handle:[%d]", att_han);
BT_DBG("GATT Server Acquire Notify Offset: [%d]", offset);
+ BT_DBG("GATT Server Acquire Notify address: [%s]", address);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipefd) < 0) {
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+ //send
+ if (result == BLUETOOTH_ERROR_NONE) {
+
+ BT_INFO("sending gatt server notification state changed event");
+ bluetooth_gatt_server_notification_changed_t info;
+ bluetooth_device_address_t dev_address = { {0} };
+ memset(&info, 0x00, sizeof(bluetooth_gatt_server_notification_changed_t));
+
+ _bt_convert_addr_string_to_type(dev_address.addr, address);
+ memcpy(info.device_address.addr,
+ dev_address.addr,
+ BLUETOOTH_ADDRESS_LENGTH);
+ info.handle = att_han;
+
+ _bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
+ result, &info,
+ event_info->cb, event_info->user_data);
+
+ }
}
void bluetooth_gatt_server_send_acquire_write_response(GVariant * parameter);
-void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameter);
+void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameter, bt_event_info_t *event_info);
#ifdef __cplusplus
}
GVariant *param = NULL;
int result = BLUETOOTH_ERROR_NONE;
struct gatt_server_req_info *req_info = NULL;
+ bluetooth_device_address_t dev_addr;
+ char address[BT_ADDRESS_STRING_SIZE] = { 0 };
BT_INFO("GATT Server ACQUIRE Notify Req Connection ID: [%d]", event->attr_trans.conn_id);
BT_INFO("GATT Server ACQUIRE Notify Req Transaction ID:[%d]", event->attr_trans.trans_id);
BT_INFO("GATT Server ACQUIRE Notify Req Attribute Handle: [%d]", event->attr_trans.attr_handle);
+ BT_INFO("GATT Server ACQUIRE notify Req address : [%s]", address);
+
+ memcpy(dev_addr.addr, event->address.addr, 6);
+ _bt_convert_addr_type_to_string(address,
+ (unsigned char *)dev_addr.addr);
+ BT_INFO("GATT Server ACQUIRE notify Req remote address : [%s]", address);
req_info = g_new0(struct gatt_server_req_info, 1);
req_info->request_id = event->attr_trans.trans_id;
req_info->request_type = BLUETOOTH_GATT_REQUEST_TYPE_ACQUIRE_NOTIFY;
gatt_server_requests = g_slist_append(gatt_server_requests, req_info);
- param = g_variant_new("(iiiiii)", result,
+ param = g_variant_new("(iiiiiis)", result,
event->attr_trans.conn_id,
event->attr_trans.trans_id,
event->attr_trans.attr_handle,
- event->mtu, event->attr_trans.offset);
+ event->mtu, event->attr_trans.offset,
+ address);
BT_INFO("GATT Server ACQUIRE Notify Req Attribute : ");