__bt_string_to_uuid_hex(uuid, service.uuid);
service.instance_id = instance_id;
- BT_INFO("GATT client add service: get all properties of this service");
ret = bluetooth_gatt_client_get_service_property(client_s->remote_address,
&service, &property);
ret = _bt_get_error_code(ret);
if (ret != BT_ERROR_NONE) {
- BT_ERR("bluetooth_gatt_get_service_property is failed");
+ BT_ERR("bluetooth_gatt_client_get_service_property is failed");
return NULL;
}
- BT_INFO("Service properties are retrieved successfully, now create and add service object");
svc = __bt_gatt_service_create(property.uuid,
BT_GATT_SERVICE_TYPE_PRIMARY);
if (svc == NULL) {
/* Copy included service handles and charc handles in just created service object */
memcpy(&svc->svc_include_handles, &property.include_handles, sizeof(bt_gatt_handle_info_t));
- BT_INFO("Total number of Included service handles [%d]", svc->svc_include_handles.count);
memcpy(&svc->charc_handles, &property.char_handle, sizeof(bt_gatt_handle_info_t));
- BT_INFO("Total number of Characteristic handles [%d]", svc->charc_handles.count);
bluetooth_gatt_free_service_property(&property);
client_s->services = g_slist_append(client_s->services, svc);
- BT_INFO("GATT service added , current count of Client services [%d]",
- g_slist_length(client_s->services));
return svc;
}
return BT_ERROR_NONE;
}
- BT_INFO("Services discovered");
client_s->services_discovered = true;
for (i = 0; i < prim_svc.count; i++) {
- BT_INFO("Service UUID[%d][%s] Instance ID[%d]",
+ BT_INFO("[%d] [%s] Instance ID[%d]",
i, prim_svc.uuids[i], prim_svc.inst_id[i]);
if (!_bt_gatt_client_add_service(client, prim_svc.uuids[i], prim_svc.inst_id[i])) {
BT_ERR("_bt_gatt_client_add_service is failed [%s]",
GSList *chr_list = NULL;
int i;
- BT_INFO("+");
if (svc == NULL)
return BT_ERROR_INVALID_PARAMETER;
__bt_string_to_uuid_hex(svc->uuid, svc_handle.uuid);
svc_handle.instance_id = svc->instance_id;
- BT_INFO("Total number of charcs [%d]", svc->charc_handles.count);
-
for (i = 0; i < svc->charc_handles.count; i++) {
bt_gatt_characteristic_s *chr = NULL;
bt_gatt_char_property_t char_property;
__bt_string_to_uuid_hex(svc->charc_handles.uuids[i], char_handle.uuid);
char_handle.instance_id = svc->charc_handles.inst_id[i];
- BT_INFO("Retrieve Characteristics properties");
ret = bluetooth_gatt_client_get_characteristics_property(
client_s->remote_address,
&svc_handle,
continue;
}
- BT_INFO("Characteristics properties are retreived, not create charc object");
ret = bt_gatt_characteristic_create(char_property.uuid, 0,
char_property.permission,
(char *)char_property.val,
if (char_property.permission & BT_GATT_PROPERTY_WRITE_WITHOUT_RESPONSE) {
chr->write_type = BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE;
- BT_INFO("Characterics has Write No Response property");
}
if (char_property.permission & BT_GATT_PROPERTY_WRITE) {
- BT_INFO("Characterics has Write property");
chr->write_type = BT_GATT_WRITE_TYPE_WRITE;
}
- if (char_property.permission & BT_GATT_PROPERTY_READ)
- BT_INFO("Characterics has Read property");
-
- if (char_property.permission & BT_GATT_PROPERTY_BROADCAST)
- BT_INFO("Characterics has Broadcast property");
-
- if (char_property.permission & BT_GATT_PROPERTY_INDICATE)
- BT_INFO("Characterics has Indicate property");
-
- if (char_property.permission & BT_GATT_PROPERTY_NOTIFY)
- BT_INFO("Characterics has Notify property");
/* Copy descriptor handles in just created charc object */
memcpy(&chr->descriptor_handles, &char_property.char_desc_handle,
__bt_gatt_client_handle_destroy);
svc->characteristics = chr_list;
- BT_INFO("Total number of characteristics whose properties are retrieved is [%d]",
- g_slist_length(svc->characteristics));
return BT_ERROR_NONE;
}
bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s*)gatt_handle;
- BT_INFO("+");
-
/* Remove characteristic from List of GATT handles */
if (gatt_handle_list)
gatt_handle_list = g_slist_remove(gatt_handle_list, gatt_handle);
bluetooth_gatt_server_update_value_t param;
#endif
- BT_INFO("+");
BT_CHECK_GATT_SUPPORT();
BT_CHECK_INIT_STATUS();
BT_VALIDATE_GATT_HANDLE(gatt_handle);
if (handle->type == BT_GATT_TYPE_CHARACTERISTIC) {
- BT_INFO("Request is for Char write value");
val = &chr->value;
val_len = &chr->value_length;
} else if (handle->type == BT_GATT_TYPE_DESCRIPTOR) {
- BT_INFO("Request is for Descriptor write value");
val = &desc->value;
val_len = &desc->value_length;
} else {
*val = g_memdup(value, value_length);
*val_len = value_length;
- BT_INFO("Value is set");
return BT_ERROR_NONE; /* LCOV_EXCL_STOP */
}
chr->type = BT_GATT_TYPE_CHARACTERISTIC;
chr->role = BT_GATT_ROLE_SERVER;
- BT_INFO("Characteristic UUID : [%s] len [%zd] permissions [%d] properties [%d]",
- uuid, strlen(uuid), permissions, properties);
+ BT_INFO("Create char [%s] permissions [%d] properties [%d]",
+ uuid, permissions, properties);
#ifdef TIZEN_FEATURE_GATT_RELAY
chr->uuid = _bt_convert_uuid_to_uuid128(uuid);
int ret = BT_ERROR_NONE;
bt_gatt_common_s *c = (bt_gatt_common_s *)gatt_handle;
- BT_INFO("+");
bt_gatt_handle_property_t svc_handle;
bt_gatt_handle_property_t chr_handle;
bt_gatt_handle_property_t desc_handle;
service_s = (bt_gatt_service_s*)chr->parent;
client_s = (bt_gatt_client_s*)service_s->parent;
- BT_INFO("Read Characteristic from remote address [%s] service UUID [%s] char UUID [%s]",
- client_s->remote_address,
- service_s->uuid,
- chr->uuid);
/* Create Service and Charc handles */
__bt_string_to_uuid_hex(service_s->uuid, svc_handle.uuid);
&chr_handle));
if (ret == BT_ERROR_NONE) {
- BT_INFO("Characteristic read scheduled successfully, set callback");
chr->read_cb = callback;
chr->read_user_data = user_data;
} else {
service_s = (bt_gatt_service_s*)charc_s->parent;
client_s = (bt_gatt_client_s*)service_s->parent;
- BT_INFO("Read Descriptor from remote address [%s] service UUID [%s] char UUID [%s] desc UUID [%s]",
- client_s->remote_address,
- service_s->uuid,
- charc_s->uuid,
- desc->uuid);
/* Create Service and Charc & desc handles */
__bt_string_to_uuid_hex(service_s->uuid, svc_handle.uuid);
svc_handle.instance_id = service_s->instance_id;
&desc_handle));
if (ret == BT_ERROR_NONE) {
- BT_INFO("Descriptor read scheduled successfully, set callback");
desc->read_cb = callback;
desc->read_user_data = user_data;
} else {
BT_ERR("Invalid handle type for read ");
}
- BT_INFO("Result [%d]", ret);
return ret; /* LCOV_EXCL_STOP */
}
#else
bt_gatt_client_s *client_s;
bluetooth_gatt_att_data_t write_data;
- BT_INFO("+");
BT_CHECK_GATT_CLIENT_SUPPORT();
BT_CHECK_INIT_STATUS();
BT_CHECK_INPUT_PARAMETER(gatt_handle);
if (c->type == BT_GATT_TYPE_CHARACTERISTIC) {
bt_gatt_characteristic_s *chr = (bt_gatt_characteristic_s *)gatt_handle;
- int k;
memset(&write_data, 0x00, sizeof(bluetooth_gatt_att_data_t));
write_data.length = chr->value_length;
- BT_INFO("Char write value length [%d]", write_data.length);
- for (k = 0; k < chr->value_length; k++)
- BT_INFO("Character val [%d] [0x%x]", k, chr->value[k]);
memcpy(&write_data.data[0], chr->value, chr->value_length);
- for (k = 0; k < write_data.length; k++)
- BT_INFO("Write val [%d] [0x%x]", k, write_data.data[k]);
service_s = (bt_gatt_service_s*)chr->parent;
client_s = (bt_gatt_client_s*)service_s->parent;
chr_handle.instance_id = chr->instance_id;
if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE) {
- BT_INFO("Write characteristic: write type [%d]", chr->write_type);
ret = _bt_get_error_code(
bluetooth_gatt_client_write_characteristic_value_by_type(
client_s->remote_address,
&write_data,
BLUETOOTH_GATT_TYPE_WRITE));
} else if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE) {
- BT_INFO("Write characteristic: write type [%d]", chr->write_type);
ret = _bt_get_error_code(
bluetooth_gatt_client_write_characteristic_value_by_type(
client_s->remote_address,
BT_ERR("Unknow write type : %d", chr->write_type);
ret = BT_ERROR_OPERATION_FAILED;
}
+
if (ret != BT_ERROR_NONE) {
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
} else {
- BT_INFO("GATT char write value scheuled successfully, set callback");
chr->write_cb = callback;
chr->write_user_data = user_data;
}
} else if (c->type == BT_GATT_TYPE_DESCRIPTOR) {
bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
- BT_INFO("Write Descriptor");
- int k;
charc_s = (bt_gatt_characteristic_s*)desc->parent;
service_s = (bt_gatt_service_s*)charc_s->parent;
client_s = (bt_gatt_client_s*)service_s->parent;
memset(&write_data, 0x00, sizeof(bluetooth_gatt_att_data_t));
write_data.length = desc->value_length;
- BT_INFO("Desc write value length [%d]", write_data.length);
memcpy(&write_data.data[0], desc->value, desc->value_length);
- for (k = 0; k < write_data.length; k++)
- BT_INFO("Write val [%d] [0x%x]", k, write_data.data[k]);
/* Create Service and Charc & desc handles */
__bt_string_to_uuid_hex(service_s->uuid, svc_handle.uuid);
if (ret != BT_ERROR_NONE) {
BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
} else {
- BT_INFO("GATT Descriptor write value scheuled successfully, set callback");
desc->write_cb = callback;
desc->write_user_data = user_data;
}
bt_gatt_client_s *client_s;
bt_gatt_service_s *svc;
bt_gatt_characteristic_s *chr;
- BT_INFO("+");
char uuid_string[BLUETOOTH_UUID_STRING_MAX];
- __uuid_hex_to_string(uuid, uuid_string) ;
- BT_INFO("Address [%s] Char UUID [%s]", remote_address, uuid_string);
+ __uuid_hex_to_string(uuid, uuid_string) ;
client = __find_gatt_client(remote_address);
if (client == NULL) {