{
char uuid_str1[2*BT_UUID_STRING_MAX];
char uuid_str2[2*BT_UUID_STRING_MAX];
- BT_INFO("BTGATT Client Read Charcateristic Callback, conn_id:%d, read_status:%d", conn_id, status);
+ BT_DBG("BTGATT Client Read Charcateristic Callback, conn_id:%d, read_status:%d", conn_id, status);
event_gattc_read_data *event = g_new0(event_gattc_read_data, 1);
event->uuid_status.conn_status.conn_id = conn_id;
if (status == 0) {
uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
- BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
+ BT_DBG("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
- BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+ BT_DBG("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
BT_DBG("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
if (p_data->value.len > 0 && event->value_type == GATTC_READ_VALUE_TYPE_VALUE) {
event->data_len = p_data->value.len;
char uuid_str1[2*BT_UUID_STRING_MAX];
char uuid_str2[2*BT_UUID_STRING_MAX];
char uuid_str3[2*BT_UUID_STRING_MAX];
- BT_INFO("BTGATT Client Write Descriptor Callback, conn_id:%d, write_status:%d", conn_id, status);
+ BT_DBG("BTGATT Client Write Descriptor Callback, conn_id:%d, write_status:%d", conn_id, status);
event_gattc_write_data *event = g_new0(event_gattc_write_data, 1);
event->conn_status.conn_id = conn_id;
bdstr_t bdstr;
OAL_CHECK_PARAMETER(device_address, return);
- API_TRACE("Client Connect: [%s]", bdt_bd2str(device_address, &bdstr));
+ API_TRACE("Client Connect: [%s]", bdt_bd2str(device_address, &bdstr) + 12);
CHECK_OAL_GATT_ENABLED();
CHECK_CLIENT_REGISTRATION(client_id);
bdstr_t bdstr;
OAL_CHECK_PARAMETER(device_address, return);
- API_TRACE("Client Disconnect: [%s]", bdt_bd2str(device_address, &bdstr));
+ API_TRACE("Client Disconnect: [%s]", bdt_bd2str(device_address, &bdstr) + 12);
CHECK_OAL_GATT_ENABLED();
CHECK_CLIENT_REGISTRATION(client_id);
CHECK_CLIENT_CONNECTION(conn_id);
bdstr_t bdstr;
OAL_CHECK_PARAMETER(address, return);
- API_TRACE("Conn Param Update: [%s]", bdt_bd2str(address, &bdstr));
CHECK_OAL_GATT_ENABLED();
- BT_INFO("[%s] min[%d] max[%d] latency[%d] timeout[%d]", bdt_bd2str(address, &bdstr), min, max, latency, timeout);
+ BT_DBG("[%s] min[%d] max[%d] latency[%d] timeout[%d]", bdt_bd2str(address, &bdstr), min, max, latency, timeout);
ret = gatt_api->client->conn_parameter_update((bt_bdaddr_t *)address, min, max, latency, timeout);
if (ret != BT_STATUS_SUCCESS) {
BT_ERR("error: %s", status2string(ret));
return OAL_STATUS_SUCCESS;
}
+oal_status_t gattc_get_att_mtu(int conn_id, int *mtu)
+{
+ int ret = OAL_STATUS_SUCCESS;
+ API_TRACE("Get ATT MTU, conn_id: %d", conn_id);
+ CHECK_OAL_GATT_ENABLED();
+ CHECK_CLIENT_CONNECTION(conn_id);
+ OAL_CHECK_PARAMETER(mtu, return);
+
+ /* To prevent crash in case other libraries not support this api */
+ if (gatt_api->client->get_att_mtu == NULL) {
+ BT_WARN("get_att_mtu is NULL");
+ return OAL_STATUS_NOT_SUPPORT;
+ }
+
+ ret = gatt_api->client->get_att_mtu(conn_id, mtu);
+ if (ret != BT_STATUS_SUCCESS) {
+ BT_ERR("GATT MTU Size failed, status: %s", status2string(ret));
+ return convert_to_oal_status(ret);
+ }
+
+ BT_INFO("Current ATT MTU Size: %d", *mtu);
+ return OAL_STATUS_SUCCESS;
+}
+
oal_status_t gattc_configure_mtu(int conn_id, int mtu)
{
int ret;
bdstr_t bdstr;
OAL_CHECK_PARAMETER(device_address, return);
- API_TRACE("Add connection info: [%s]", bdt_bd2str(device_address, &bdstr));
+ API_TRACE("Add connection info: [%s]", bdt_bd2str(device_address, &bdstr) + 12);
CHECK_OAL_GATT_ENABLED();
- CHECK_SERVER_INSTANCE(instance_id);
- if (__gatts_find_server_instance(instance_id) == NULL)
- return OAL_STATUS_INTERNAL_ERROR;
ret = gatt_api->client->add_connection_info((bt_bdaddr_t *)device_address, conn_id, instance_id);
if (ret != BT_STATUS_SUCCESS) {