BT_EXPORT_API int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty)
{
- BT_DBG("+");
-
BT_CHECK_PARAMETER(svc_pty, return);
#ifdef TIZEN_GATT_CLIENT
memset(svc_pty, 0, sizeof(bt_gatt_service_property_t));
- BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
}
BT_EXPORT_API int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty)
{
- BT_DBG("+");
-
BT_CHECK_PARAMETER(char_pty, return);
g_free(char_pty->uuid);
memset(char_pty, 0, sizeof(bt_gatt_char_property_t));
- BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
}
BT_EXPORT_API int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty)
{
- BT_DBG("+");
-
BT_CHECK_PARAMETER(desc_pty, return);
g_free(desc_pty->uuid);
memset(desc_pty, 0, sizeof(bt_gatt_char_descriptor_property_t));
- BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
}
g_strstr_len(service->uuid, -1,
service_uuid)) {
ret = BLUETOOTH_ERROR_NONE;
+
+ /* release resources */
+ g_free(object_path);
+ g_variant_iter_free(interface_iter);
+ g_free(interface_str);
+ g_variant_iter_free(svc_iter);
+
goto done;
}
}
g_variant_iter_free(char_iter);
g_variant_unref(value);
g_object_unref(proxy);
+ g_variant_unref(char_value);
}
BT_EXPORT_API int bluetooth_gatt_discover_service_characteristics(
g_variant_iter_free(char_iter);
g_variant_unref(value);
+ g_variant_unref(char_value);
BT_DBG("-");
}
-BT_EXPORT_API int bluetooth_gatt_discover_characteristic_descriptor(
+BT_EXPORT_API int bltooth_gatt_discover_characteristic_descriptor(
const char *characteristic_handle)
{
GDBusProxy *properties_proxy = NULL;
bt_gatt_handle_info_t *svcs)
{
int count;
- BT_INFO("Total services found [%d]", props->count);
if (props->count == 0)
return;
svcs->count = props->count;
for (count = 0; count < props->count; count++) {
- BT_INFO("UUID[%d] = [%s] instance_id [%d] Is Primary [%d]",
+ BT_DBG("[%d] %s instance_id [%d] Is Primary [%d]",
count, props->uuids[count], props->inst_id[count], props->primary[count]);
g_strlcpy(svcs->uuids[count], props->uuids[count],
BLUETOOTH_UUID_STRING_MAX);
{
int count;
char uuid_string[BLUETOOTH_UUID_STRING_MAX];
- BT_INFO("Total number of characteristics found [%d]",
- props->count);
service->char_handle.count = props->count;
/* Now fill all the char handles [UUID and Instance ID's]*/
for (count = 0; count < props->count; count++) {
- BT_INFO("UUID[%d] = [%s] instance_id [%d] properties [%d]",
+ BT_INFO("[%d] %s instance_id [%d] properties [%d]",
count, props->uuids[count], props->inst_id[count], props->props[count]);
g_strlcpy(service->char_handle.uuids[count],
{
int count;
char uuid_string[BLUETOOTH_UUID_STRING_MAX];
- BT_INFO("Total descriptor count found [%d]", props->count);
charc->char_desc_handle.count = props->count;
/* Now fill all the descriptor handles [UUID and Instance ID's]*/
for (count = 0; count < props->count; count++) {
- BT_INFO("UUID[%d] = [%s] instance_id [%d]",
+ BT_INFO("[%d] %s instance_id [%d]",
count, props->uuids[count], props->inst_id[count]);
g_strlcpy(charc->char_desc_handle.uuids[count],
charc->char_desc_handle.inst_id[count] = props->inst_id[count];
}
charc->permission = props->char_props_map;
- BT_INFO("Characteritic property map val [%d]", charc->permission);
+ __convert_permission_flag_to_str(charc->permission);
}
BT_CHECK_PARAMETER(callback_ptr, return);
BT_CHECK_ENABLED(return);
- BT_INFO("+");
-
BT_INIT_PARAMS();
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
int result = BLUETOOTH_ERROR_NONE;
bt_services_browse_info_t service_props;
- BT_DBG("+");
-
BT_CHECK_PARAMETER(address, return);
BT_CHECK_PARAMETER(prim_svc, return);
BT_CHECK_ENABLED(return);
done:
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- BT_DBG("result = %d", result);
return result;
}
int result = BLUETOOTH_ERROR_NONE;
bluetooth_gatt_client_svc_prop_info_t svc_prop;
bt_char_browse_info_t char_handles_info;
- BT_INFO("Remote Address [%s]", address);
BT_CHECK_PARAMETER(address, return);
BT_CHECK_PARAMETER(service_handle, return);
done:
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- BT_INFO("result = %d", result);
return result;
}
int result = BLUETOOTH_ERROR_NONE;
bt_descriptor_browse_info_t desc_handles_info;
bluetooth_gatt_client_char_prop_info_t char_prop;
- BT_INFO("Get Properties of characteristics from remote device [%s]", address);
BT_CHECK_PARAMETER(address, return);
BT_CHECK_PARAMETER(service_handle, return);
BT_GATT_GET_CHARACTERISTIC_PROPERTIES,
in_param1, in_param2, in_param3, in_param4, &out_param);
- BT_INFO("result = [%d]", result);
if (BLUETOOTH_ERROR_NONE != result)
goto done;
done:
BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- BT_INFO("result = %d", result);
return result;
/* Call to bt-service (sync) and send address, service_handle & char_handle infos */
bt_gatt_char_descriptor_property_t *desc_prop)
{
char uuid_string[BLUETOOTH_UUID_STRING_MAX];
- BT_DBG("Remote Address [%s]", address);
BT_CHECK_PARAMETER(address, return);
BT_CHECK_PARAMETER(service_handle, return);
BT_INIT_PARAMS();
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- BT_INFO("Address [%s]", address);
memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
memcpy(¶m.svc.uuid, service_handle->uuid, 16);
int fd = -1;
fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
- BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
+ BT_DBG("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
fd = fd_list_array[0];
mtu = g_array_index(out_param, int, 0);
mtu = g_array_index(out_param, int, 0);
if (result != BLUETOOTH_ERROR_NONE) {
- BT_ERR("Fail to get Write FD. result %d", result);
- BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- return result;
+ BT_ERR("Fail to get Write FD. result %d", result);
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+ return result;
} else if (NULL == out_fd_list) {
BT_ERR("out_fd_list is NULL");
+ BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
return BLUETOOTH_ERROR_INTERNAL;
} else {
int *fd_list_array;
int len = 0;
- if (!out_fd_list) {
- BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- return BLUETOOTH_ERROR_INTERNAL;
- }
-
fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
- BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
fd = fd_list_array[0];
g_free(fd_list_array);
BT_INFO("Acquired characteristic Write FD %d, mtu %d", fd, mtu);
if (fd > -1) {
-
bluetooth_gatt_client_create_write_io_channel(fd, char_handle->uuid, service_handle->instance_id, mtu);
result = bluetooth_gatt_client_write_characteristics_value_to_fd(fd, data->data, data->length, mtu, NULL);
{
GSList *l;
bluetooth_device_address_t *addr = NULL;
+ char device_address[BT_ADDRESS_STRING_SIZE] = { 0 };
char secure_address[BT_ADDRESS_STRING_SIZE] = { 0 };
int result = BLUETOOTH_ERROR_NONE;
- BT_INFO("+");
-
BT_INIT_PARAMS();
BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
g_array_append_vals(in_param1, address, sizeof(bluetooth_device_address_t));
g_array_append_vals(in_param2, &enable, sizeof(gboolean));
-
- _bt_convert_addr_string_to_secure_string(secure_address, (const char *)address->addr);
- BT_INFO("Set watcher for %s with %d", secure_address, enable);
+ _bt_convert_addr_type_to_string(device_address, (unsigned char *)address->addr);
+ _bt_convert_addr_string_to_secure_string(secure_address, device_address);
+ BT_INFO("%s watcher for [%s]", enable ? "Set":"Unset", secure_address);
if (enable == TRUE) {
if (_bluetooth_gatt_check_service_change_watcher_address(address)
BT_INFO("Total num of GATT client instances [%d]", *count);
if (*count == 1) {
- BT_INFO("Currently only one GATT client instance, so remove it and unregister GATT client events");
+ BT_DBG("Currently only one GATT client instance, so remove it and unregister GATT client events");
_bt_unregister_event(BT_GATT_CLIENT_EVENT);
_bt_set_user_data(BT_GATT_CLIENT, NULL, NULL);
} else