}
case OAL_EVENT_BLE_SERVER_INSTANCE_INITIALISED: {
BT_INFO("OAL Event: Server Instance Registered");
- event_gatts_register_t* event = g_memdup(event_data, sizeof(event_gatts_register_t));
- /* GATT Server Registered event is handled in MAIN thread context */
- __bt_le_handle_server_instance_registered(event);
+ __bt_le_handle_server_instance_registered((event_gatts_register_t *)event_data);
break;
}
case OAL_EVENT_BLE_ADVERTISING_STARTED: {
}
case OAL_EVENT_BLE_MULTI_ADVERTISING_ENABLE: {
BT_INFO("OAL Event: Advertising Enabled");
- event_ble_multiadv_status* event = (event_ble_multiadv_status*)g_memdup(event_data,
- sizeof(event_ble_multiadv_status));
- __bt_le_multi_advertising_enabled(event);
+ __bt_le_multi_advertising_enabled((event_ble_multiadv_status *)event_data);
break;
}
case OAL_EVENT_BLE_MULTI_ADVERTISING_DISABLE: {
BT_INFO("OAL Event: Advertising Disabled");
- event_ble_multiadv_status* event = (event_ble_multiadv_status*)g_memdup(event_data,
- sizeof(event_ble_multiadv_status));
- __bt_le_multi_advertising_disabled(event);
+ __bt_le_multi_advertising_disabled((event_ble_multiadv_status *)event_data);
break;
}
case OAL_EVENT_BLE_MULTI_ADVERTISING_SET_INST_DATA: {
BT_INFO("OAL Event: Advertising Data set successfully");
- event_ble_multiadv_status* event = (event_ble_multiadv_status*)g_memdup(event_data,
- sizeof(event_ble_multiadv_status));
- __bt_le_multi_advertising_set_data(event);
+ __bt_le_multi_advertising_set_data((event_ble_multiadv_status *)event_data);
break;
}
case OAL_EVENT_BLE_MULTI_ADVERTISING_UPDATE: {
BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED,
param);
}
+
+ g_free(old_mdata);
}
/* Time to update new ADV data completely in Table */
}
}
g_free(uuid_string);
- g_free(data);
}
static void __bt_handle_gatt_server_service_added(event_gatts_srvc_prm_t *event)
}
}
- g_free(event);
g_free(uuid_str);
}
_bt_uuid_to_string(&(event->charctr_uuid), uuid_str);
BT_INFO("GATT Added Characteristic: UUID: [%s]", uuid_str);
- g_free(event);
g_free(uuid_str);
}
_bt_uuid_to_string(&(event->descrptr_uuid), uuid_str);
BT_INFO("GATT Added Descriptor: UUID: [%s]", uuid_str);
- g_free(event);
g_free(uuid_str);
}
break;
}
}
-
- g_free(event);
}
static void __bt_handle_gatt_server_service_stopped(event_gatts_srvc_t *event)
break;
}
}
-
- g_free(event);
}
static void __bt_handle_gatt_server_service_deleted(event_gatts_srvc_t *event)
break;
}
}
-
- g_free(event);
}
static struct gatt_client_info_t *__bt_find_remote_gatt_client_info(char *address)
struct gatt_client_info_t *conn_info = NULL;
bluetooth_device_address_t dev_addr;
- char *address = g_malloc0(BT_ADDRESS_STRING_SIZE);
+ char address[BT_ADDRESS_STRING_SIZE];
memcpy(dev_addr.addr, event->address.addr, 6);
g_free(conn_info->addr);
g_free(conn_info);
}
-
- g_free(address);
}
#else
if (event->length <= 0) {
BT_INFO("GATT Server write requested, but length of attr value is 0");
- g_free(event);
return;
}
BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED,
param);
- g_free(event);
g_free(write_val);
}
_bt_send_event(BT_GATT_SERVER_EVENT,
BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED,
param);
-
- g_free(event);
}
static void __bt_handle_gatt_server_indicate_confirmed(event_gatts_ind_cnfrm_t *event)
param);
BT_INFO("Received Indication confirm for client number [%d]", recvd);
- g_free(event);
g_free(address);
}
BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
param);
- g_free(event);
g_free(address);
}
conn_info = __bt_find_remote_gatt_client_info_from_conn_id(event->conn_id);
if (conn_info == NULL) {
BT_ERR("Cant find connection Information");
- g_free(event);
return;
}
BT_INFO("Got connection Info GATT client [%s] MTU Size [%d]",
_bt_send_event(BT_GATT_SERVER_EVENT,
BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED,
param);
- g_free(event);
}
static void __bt_gatt_event_handler(int event_type, gpointer event_data)
switch (event_type) {
case OAL_EVENT_BLE_SERVER_INSTANCE_INITIALISED: {
BT_INFO("OAL Event: Server Instance Registered");
- event_gatts_register_t* event = g_memdup(event_data, sizeof(event_gatts_register_t));
/* GATT Server Registered event is handled in MAIN thread context */
- __bt_handle_server_instance_registered(event);
+ __bt_handle_server_instance_registered((event_gatts_register_t *)event_data);
break;
}
case OAL_EVENT_GATTS_SERVICE_ADDED: {
BT_INFO("OAL Event: GATT Service added");
- event_gatts_srvc_prm_t *service_parm = g_memdup(event_data, sizeof(event_gatts_srvc_prm_t));
- __bt_handle_gatt_server_service_added(service_parm);
+ __bt_handle_gatt_server_service_added((event_gatts_srvc_prm_t *)event_data);
break;
}
case OAL_EVENT_GATTS_CHARACTERISTIC_ADDED: {
BT_INFO("OAL Event: GATT characteristic added");
- event_gatts_srvc_charctr_t *char_parm = g_memdup(event_data, sizeof(event_gatts_srvc_charctr_t));
- __bt_handle_gatt_server_characteristic_added(char_parm);
+ __bt_handle_gatt_server_characteristic_added((event_gatts_srvc_charctr_t *)event_data);
break;
}
case OAL_EVENT_GATTS_DESCRIPTOR_ADDED: {
BT_INFO("OAL Event: GATT descriptor added");
- event_gatts_srvc_descr_t *desc_parm = g_memdup(event_data, sizeof(event_gatts_srvc_descr_t));
- __bt_handle_gatt_server_descriptor_added(desc_parm);
+ __bt_handle_gatt_server_descriptor_added((event_gatts_srvc_descr_t *)event_data);
break;
}
case OAL_EVENT_GATTS_SERVICE_STARTED: {
BT_INFO("OAL Event: GATT Service started");
- event_gatts_srvc_t *svc_started = g_memdup(event_data, sizeof(event_gatts_srvc_t));
- __bt_handle_gatt_server_service_started(svc_started);
+ __bt_handle_gatt_server_service_started((event_gatts_srvc_t *)event_data);
break;
}
case OAL_EVENT_GATTS_SERVICE_STOPED: {
BT_INFO("OAL Event: GATT Service stopped");
- event_gatts_srvc_t *svc_stopped = g_memdup(event_data, sizeof(event_gatts_srvc_t));
- __bt_handle_gatt_server_service_stopped(svc_stopped);
+ __bt_handle_gatt_server_service_stopped((event_gatts_srvc_t *)event_data);
break;
}
case OAL_EVENT_GATTS_SERVICE_DELETED: {
BT_INFO("OAL Event: GATT Service deleted");
- event_gatts_srvc_t *svc_deleted = g_memdup(event_data, sizeof(event_gatts_srvc_t));
- __bt_handle_gatt_server_service_deleted(svc_deleted);
+ __bt_handle_gatt_server_service_deleted((event_gatts_srvc_t *) event_data);
break;
}
case OAL_EVENT_GATTS_CONNECTION_COMPLETED: {
BT_INFO("OAL Event: GATT Server Connected");
- event_gatts_conn_t* event = g_memdup(event_data, sizeof(event_gatts_conn_t));
- __bt_handle_gatt_server_connection_state(event);
+ __bt_handle_gatt_server_connection_state((event_gatts_conn_t *)event_data);
break;
}
case OAL_EVENT_GATTS_DISCONNECTION_COMPLETED: {
BT_INFO("OAL Event: GATT Server Disconnected");
- event_gatts_conn_t* event = g_memdup(event_data, sizeof(event_gatts_conn_t));
- __bt_handle_gatt_server_disconnection_state(event);
+ __bt_handle_gatt_server_disconnection_state((event_gatts_conn_t *)event_data);
break;
}
case OAL_EVENT_GATTS_REQUEST_READ: {
BT_INFO("OAL Event: GATT Server Read Request");
- event_gatts_srvc_read_attr_t *read_req = g_memdup(event_data, sizeof(event_gatts_srvc_read_attr_t));
- __bt_handle_gatt_server_read_requested(read_req);
+ __bt_handle_gatt_server_read_requested((event_gatts_srvc_read_attr_t *)event_data);
break;
}
case OAL_EVENT_GATTS_REQUEST_WRITE: {
BT_INFO("OAL Event: GATT Server Write Request");
- event_gatts_srvc_write_attr_t *write_req = g_memdup(event_data, sizeof(event_gatts_srvc_write_attr_t));
- __bt_handle_gatt_server_write_requested(write_req);
+ __bt_handle_gatt_server_write_requested((event_gatts_srvc_write_attr_t *)event_data);
break;
}
case OAL_EVENT_GATTS_IND_CONFIRM: {
BT_INFO("OAL Event: GATT Server Indication confirmed");
- event_gatts_ind_cnfrm_t *parm = g_memdup(event_data, sizeof(event_gatts_ind_cnfrm_t));
- __bt_handle_gatt_server_indicate_confirmed(parm);
+ __bt_handle_gatt_server_indicate_confirmed((event_gatts_ind_cnfrm_t *)event_data);
break;
}
case OAL_EVENT_GATTS_NOTIFICATION: { /* Tizen Platform Specific */
BT_INFO("OAL Event: GATT Server DisConnected");
- event_gatts_notif_t* notif = g_memdup(event_data, sizeof(event_gatts_notif_t));
- __bt_handle_gatt_server_notification_changed(notif);
+ __bt_handle_gatt_server_notification_changed((event_gatts_notif_t *)event_data);
break;
}
case OAL_EVENT_GATTS_MTU_CHANGED: {
BT_INFO("OAL Event: GATT Server MTU changed event callback");
- event_gatts_mtu_changed_t *mtu_changed = g_memdup(event_data, sizeof(event_gatts_mtu_changed_t));
- __bt_handle_gatt_mtu_changed_event(mtu_changed);
+ __bt_handle_gatt_mtu_changed_event((event_gatts_mtu_changed_t *)event_data);
break;
}
#ifdef TIZEN_GATT_CLIENT