BLE Gatt Server Socket notify implementation.
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / oal-gatt.c
index 9d195e2..fb7b4f0 100644 (file)
@@ -153,6 +153,7 @@ static void cb_gatts_request_write(int conn_id, int trans_id, bt_bdaddr_t *bda,
 static void cb_gatts_response_confirmation(int status, int handle);
 
 static void cb_gatts_acquire_write(int fd, int conn_id, int trans_id, int attr_handle, bt_bdaddr_t*);
+static void cb_gatts_acquire_notify(int fd, int conn_id, int trans_id, int attr_handle);
 
 static void cb_indication_confirmation(int conn_id, int trans_id, int attr_handle, bt_bdaddr_t *bda);
 static void cb_gatts_connection(int conn_id, int server_if, int connected, bt_bdaddr_t *bda);
@@ -190,7 +191,8 @@ static const btgatt_server_callbacks_t btgatt_server_callbacks = {
 #ifdef TIZEN_BT_HAL
        cb_notifcation_changed,
 #endif
-       cb_gatts_acquire_write
+       cb_gatts_acquire_write,
+       cb_gatts_acquire_notify
 };
 
 /* Forward declaration for GATT client callbacks */
@@ -1286,6 +1288,21 @@ static void cb_gatts_acquire_write(int mtu, int conn_id, int trans_id, int attr_
        send_event(OAL_EVENT_GATTS_REQUEST_ACQUIRE_WRITE, event, sizeof(event_gatts_srvc_acquire_attr_t));
 }
 
+static void cb_gatts_acquire_notify(int mtu, int conn_id, int trans_id, int attr_handle)
+{
+       BT_INFO("BTGATT SERVER REQUEST ACQUIRE NOTIFY conn_id:%d", conn_id);
+
+       event_gatts_srvc_acquire_attr_t* event = g_new0(event_gatts_srvc_acquire_attr_t, 1);
+
+       event->attr_trans.attr_handle = attr_handle;
+       event->attr_trans.conn_id = conn_id;
+       event->attr_trans.trans_id = trans_id;
+       event->mtu = mtu;
+
+       send_event(OAL_EVENT_GATTS_REQUEST_ACQUIRE_NOTIFY, event, sizeof(event_gatts_srvc_acquire_attr_t));
+
+}
+
 static void cb_gatts_response_confirmation(int status, int handle)
 {
        BT_INFO("BTGATT SERVER RESPONSE CONFIRMATION CB, status:%d, handle:%d", status, handle);