ev->connected, &bd_addr);
}
+static void __bt_hal_handle_gatt_server_notification_changed(void *buf, uint16_t len)
+{
+ struct hal_ev_gatt_server_notifcation_change *ev = buf;
+ bt_bdaddr_t bd_addr;
+
+ memcpy(bd_addr.address, ev->bdaddr, 6);
+
+ if (bt_gatt_callbacks->server->notif_enabled_cb)
+ bt_gatt_callbacks->server->notif_enabled_cb(ev->conn_id, ev->trans_id,
+ ev->att_handle, ev->notify, &bd_addr);
+}
+
static void __bt_hal_handle_gatt_server_read_requested(void *buf, uint16_t len)
{
struct hal_ev_gatt_server_read_req *ev = buf;
__bt_hal_handle_gatt_server_connected(buf, len);
break;
}
+ case HAL_EV_GATT_NOTIFICATION_CHANGE: {
+ __bt_hal_handle_gatt_server_notification_changed(buf, len);
+ break;
+ }
case HAL_EV_GATT_READ_REQUESTED: {
__bt_hal_handle_gatt_server_read_requested(buf, len);
break;
int result = BLUETOOTH_ERROR_NONE;
struct gatt_client_info_t *conn_info = NULL;
bluetooth_device_address_t dev_addr;
+ GVariant *param = NULL;
char *address = g_malloc0(BT_ADDRESS_STRING_SIZE);
if (!conn_info) {
BT_INFO("Conn Info absent: But no need to Send Local GATT Server Connected event to apps");
-#if 0
+
param = g_variant_new("(is)", result, address);
/* Send event to application */
_bt_send_event(BT_DEVICE_EVENT,
BLUETOOTH_EVENT_GATT_SERVER_CONNECTED, /* Local device is GATT server */
param);
-#endif
+
/* Save Connection info */
conn_info = g_new0(struct gatt_client_info_t, 1);
conn_info->addr = g_strdup(address);
int result = BLUETOOTH_ERROR_NONE;
struct gatt_client_info_t *conn_info = NULL;
bluetooth_device_address_t dev_addr;
-
+ GVariant *param = NULL;
char address[BT_ADDRESS_STRING_SIZE];
memcpy(dev_addr.addr, event->address.addr, 6);
conn_info = __bt_find_remote_gatt_client_info(address);
if (conn_info) {
BT_INFO("No need to Send Local GATT Server Disconnected event to apps, just remove remote client info");
-#if 0
+
param = g_variant_new("(is)", result, address);
/* Send event to application */
_bt_send_event(BT_DEVICE_EVENT,
BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /* Local device is GATT server */
param);
-#endif
+
/* Remove info from List */
gatt_client_info_list = g_slist_remove(gatt_client_info_list, conn_info);
BT_INFO("Total num of connected GATT clients [%d]", g_slist_length(gatt_client_info_list));