}
dbus_data = g_array_new(TRUE, TRUE, sizeof(gchar));
+
+ if (dbus_data == NULL) {
+ BT_ERR("g_array_new failed");
+ g_variant_unref(param);
+ return;
+ }
__bt_fill_garray_from_variant(param, dbus_data);
g_variant_unref(param);
BT_INFO("App-wise data transaction details:");
for (GSList *l = data->atm_list; l != NULL; l = g_slist_next(l)) {
bt_battery_app_data *t = (bt_battery_app_data *)(l->data);
- BT_DBG("%ld %ld %d %d", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes);
+ BT_DBG("%ld %ld %d %d %u", (long int)(t->uid), (long int)(t->pid), t->rx_bytes, t->tx_bytes, t->time);
}
}
event_info->cb, event_info->user_data);
g_slist_free(data->atm_list);
g_free(data);
+ g_array_free(dbus_data, TRUE);
} else if (strcasecmp(signal_name, BT_DISCOVERABLE_MODE_CHANGED) == 0) {
int mode = 0;
BLUETOOTH_ERROR_NONE, NULL,
event_info->cb, event_info->user_data);
} else if (strcasecmp(signal_name, BT_LE_DISCOVERY_FINISHED) == 0) {
+ _bt_set_le_scan_status(FALSE);
g_variant_get(parameters, "(i)", &result);
_bt_common_event_cb(BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED,
result, NULL,
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_CONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
g_variant_get(parameters, "(i&s)", &result, &address);
_bt_convert_addr_string_to_type(dev_address.addr, address);
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_DISCONNECTED,
result, &dev_address,
event_info->cb, event_info->user_data);
conn_info.addr_type = addr_type;
conn_info.disc_reason = 0;
- BT_DBG("Sending Event to Framework");
_bt_common_event_cb(BLUETOOTH_EVENT_DEVICE_CONNECTED,
result, &conn_info,
event_info->cb, event_info->user_data);
unsigned char addr_type;
bt_connection_info_t conn_info;
bluetooth_device_address_t dev_address = { {0} };
- BT_DBG("BT_DEVICE_DISCONNECTED");
- g_variant_get(parameters, "(i&sy)", &result, &address, &addr_type);
+ int rssi;
+ g_variant_get(parameters, "(i&syi)", &result, &address, &addr_type, &rssi);
+ BT_DBG("BT_DEVICE_DISCONNECTED reason(%d)", result);
_bt_convert_addr_string_to_type(dev_address.addr,
address);
conn_info.addr_type = addr_type;
conn_info.disc_reason = result;
- BT_DBG("Sending Event to Framework, disconnect reason [0x%x]", result);
+ conn_info.rssi = rssi;
_bt_common_event_cb(BLUETOOTH_EVENT_DEVICE_DISCONNECTED,
result, &conn_info,
event_info->cb, event_info->user_data);
const char *address = NULL;
char *data;
int data_len = 0;
- int k;
GVariant *var = NULL;
bluetooth_tds_transport_data_info_t *info = NULL;
data = (char *)g_variant_get_data(var);
if (data) {
- BT_DBG("Address [%s]", address);
- BT_DBG("Data len [%d]", data_len);
-
- /* DEBUG */
- for (k = 0; k < data_len ; k++)
- BT_DBG("Data[%d] [0x%x]", k, data[k]);
-
if (data_len == 0) {
BT_ERR("No data");
g_variant_unref(var);
GVariant *parameters,
gpointer user_data)
{
- BT_DBG("GATT Client event handler Entry >>");
-
bt_event_info_t *event_info;
int result = BLUETOOTH_ERROR_NONE;
if (strcasecmp(signal_name, BT_GATT_CHAR_VAL_CHANGED) == 0) { /* Done */
/* Event: BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED */
- BT_INFO("GATT Client event[BT_GATT_CHAR_VAL_CHANGED]");
+ BT_DBG("GATT Client event[BT_GATT_CHAR_VAL_CHANGED]");
bt_gatt_char_property_t char_prop;
const char *address = NULL;
GVariant *data_var = NULL;
GVariant *char_uuid_var = NULL;
int svc_uuid_len = 0;
int char_uuid_len = 0;
- unsigned int i;
memset(&char_prop, 0x00, sizeof(bt_gatt_char_property_t));
memcpy(&char_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
char_prop.svc_prop.instance_id = svc_inst;
- /* DEBUG */
- for (i = 0; i < char_prop.val_len; i++)
- BT_INFO("Data[%d] = [0x%x]", i, char_prop.value[i]);
-
_bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
result, &char_prop,
event_info->cb, event_info->user_data);
+
+ g_variant_unref(svc_uuid_var);
+ g_variant_unref(char_uuid_var);
+ g_variant_unref(data_var);
+
} else if (strcasecmp(signal_name, BT_GATT_CLIENT_READ_CHAR) == 0) { /* Done */
/* Event: BLUETOOTH_EVENT_GATT_READ_CHAR */
- BT_INFO("GATT Client event[BT_GATT_CLIENT_READ_CHAR]");
+ BT_DBG("GATT Client event[BT_GATT_CLIENT_READ_CHAR]");
bt_gatt_char_property_t char_prop;
const char *address = NULL;
GVariant *data_var = NULL;
GVariant *char_uuid_var = NULL;
int svc_uuid_len = 0;
int char_uuid_len = 0;
- unsigned int i;
memset(&char_prop, 0x00, sizeof(bt_gatt_char_property_t));
&data_var);
g_strlcpy(char_prop.address, address, BT_ADDRESS_STRING_SIZE);
- BT_INFO("GATT Client Read Callback from [%s] svc inst [%d] char val len [%d] char inst [%d]",
+ BT_DBG("GATT Client Read Callback from [%s] svc inst [%d] char val len [%d] char inst [%d]",
address, svc_inst, char_prop.val_len, char_prop.prop.instance_id);
if (char_prop.val_len > 0) {
- BT_INFO("Get the read data");
/* Copy Data */
memcpy(&char_prop.value, g_variant_get_data(data_var), char_prop.val_len);
}
memcpy(&char_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
char_prop.svc_prop.instance_id = svc_inst;
- /* DEBUG */
- for (i = 0; i < char_prop.val_len; i++)
- BT_INFO("Data[%d] = [0x%x]", i, char_prop.value[i]);
-
_bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_READ_CHAR,
result, &char_prop,
event_info->cb, event_info->user_data);
+
+ g_variant_unref(svc_uuid_var);
+ g_variant_unref(char_uuid_var);
+ g_variant_unref(data_var);
+
} else if (strcasecmp(signal_name, BT_GATT_CLIENT_WRITE_CHAR) == 0) { /* Done */
/* Event: BLUETOOTH_EVENT_GATT_WRITE_CHAR */
- BT_INFO("GATT Client event[BT_GATT_CLIENT_WRITE_CHAR]");
+ BT_DBG("GATT Client event[BT_GATT_CLIENT_WRITE_CHAR]");
bt_gatt_char_property_t char_prop;
const char *address = NULL;
GVariant *svc_uuid_var = NULL;
_bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_WRITE_CHAR,
result, &char_prop,
event_info->cb, event_info->user_data);
+
+ g_variant_unref(svc_uuid_var);
+ g_variant_unref(char_uuid_var);
+
} else if (strcasecmp(signal_name, BT_GATT_CLIENT_READ_DESC) == 0) { /* Done */
/* Event: BLUETOOTH_EVENT_GATT_READ_DESC */
- BT_INFO("GATT Client event[BT_GATT_CLIENT_READ_DESC]");
+ BT_DBG("GATT Client event[BT_GATT_CLIENT_READ_DESC]");
bt_gatt_char_descriptor_property_t desc_prop;
const char *address = NULL;
GVariant *data_var = NULL;
int svc_uuid_len = 0;
int char_uuid_len = 0;
int desc_uuid_len = 0;
- unsigned int i;
memset(&desc_prop, 0x00, sizeof(bt_gatt_char_descriptor_property_t));
memcpy(&desc_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
desc_prop.svc_prop.instance_id = svc_inst;
- /* DEBUG */
- for (i = 0; i < desc_prop.val_len; i++)
- BT_INFO("Data[%d] = [0x%x]", i, desc_prop.value[i]);
-
_bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_READ_DESC,
result, &desc_prop,
event_info->cb, event_info->user_data);
+
+ g_variant_unref(svc_uuid_var);
+ g_variant_unref(char_uuid_var);
+ g_variant_unref(desc_uuid_var);
+ g_variant_unref(data_var);
+
} else if (strcasecmp(signal_name, BT_GATT_CLIENT_WRITE_DESC) == 0) { /* Done */
/* Event: BLUETOOTH_EVENT_GATT_WRITE_DESC */
- BT_INFO("GATT Client event[BT_GATT_CLIENT_WRITE_DESC]");
+ BT_DBG("GATT Client event[BT_GATT_CLIENT_WRITE_DESC]");
bt_gatt_char_descriptor_property_t desc_prop;
const char *address = NULL;
GVariant *svc_uuid_var = NULL;
_bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_WRITE_DESC,
result, &desc_prop,
event_info->cb, event_info->user_data);
- }
- BT_DBG("GATT Client event handler Exit <<");
+ g_variant_unref(svc_uuid_var);
+ g_variant_unref(char_uuid_var);
+ g_variant_unref(desc_uuid_var);
+
+ } else if (strcasecmp(signal_name, BT_GATT_CLIENT_SERVICE_CHANGED) == 0) {
+ BT_DBG("GATT Client event[BT_GATT_CLIENT_SERVICE_CHANGED]");
+ bt_gatt_service_change_t change = {0, };
+ char *address_str = NULL;
+ char *name = NULL;
+
+ g_variant_get(parameters, "(i&s&s)", &change.change_type, &address_str, &change.uuid);
+
+ _bt_convert_addr_string_to_type(change.device_addr.addr, address_str);
+ bluetooth_get_uuid_name(change.uuid, &name);
+ BT_INFO(" ### GATT Service %s [%s]", change.change_type ? "Added" : "Removed", name);
+ g_free(name);
+
+ if (_bluetooth_gatt_check_service_change_watcher_address(&change.device_addr) == FALSE) {
+ BT_INFO("No watcher for %s", address_str);
+ return;
+ }
+
+ _bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED,
+ BLUETOOTH_ERROR_NONE, &change,
+ event_info->cb, event_info->user_data);
+ }
}
#endif
BT_INFO("GATT Server event[BT_GATT_SERVER_WRITE_REQUESTED]");
const char *address = NULL;
GVariant *data_var = NULL;
- int i;
bluetooth_device_address_t dev_address = { {0} };
bluetooth_gatt_server_write_requested_info_t write_info;
dev_address.addr,
BLUETOOTH_ADDRESS_LENGTH);
- /* DEBUG */
- for (i = 0; i < write_info.length; i++)
- BT_DBG("Data[%d] = [0x%x]", i, write_info.data.data[i]);
-
_bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED,
BLUETOOTH_ERROR_NONE, &write_info,
event_info->cb, event_info->user_data);
+
+ g_variant_unref(data_var);
} else if (strcasecmp(signal_name, BT_GATT_SERVER_READ_REQ) == 0) {
const char *address = NULL;
bluetooth_device_address_t dev_address = { {0} };
path = BT_RFCOMM_SERVER_PATH;
break;
case BT_HF_AGENT_EVENT:
- BT_DBG("BT_HF_AGENT_EVENT\n");
event_func = __bt_hf_agent_event_filter;
path = BT_HF_AGENT_PATH;
interface = BT_HF_SERVICE_INTERFACE;
break;
case BT_A2DP_SOURCE_EVENT:
- BT_DBG("BT_A2DP_SOURCE_EVENT");
event_func = __bt_a2dp_source_event_filter;
path = BT_A2DP_SOURCE_PATH;
break;
case BT_HID_DEVICE_EVENT:
- BT_DBG("BT_HID_DEVICE_EVENT");
event_func = __bt_hid_device_event_filter;
path = BT_HID_DEVICE_PATH;
break;
#ifdef GATT_NO_RELAY
case BT_GATT_BLUEZ_EVENT:
- BT_DBG("BT_GATT_BLUEZ_EVENT");
event_func = __bt_device_event_filter;
interface = BT_GATT_CHARACTERISTIC_INTERFACE;
path = NULL;
break;
#endif
case BT_TDS_EVENT:
- BT_DBG("BT_TDS_EVENT");
event_func = __bt_tds_event_filter;
path = BT_TDS_PATH;
break;
case BT_OTP_EVENT:
- BT_DBG("BT_OTP_EVENT");
event_func = __bt_otp_event_filter;
path = BT_OTP_PATH;
break;
case BT_HDP_EVENT:
- BT_DBG("BT_HDP_EVENT");
event_func = __bt_hdp_event_filter;
path = BT_HDP_DEVICE_PATH;
break;