return BLUETOOTH_ERROR_NOT_CONNECTED;
}
- ret = gatts_get_att_mtu(conn_info->connection_id, &stack_mtu);
- if (ret != OAL_STATUS_SUCCESS) {
- BT_ERR("ret: %d", ret);
- return _bt_convert_oal_status_to_bt_error(ret);
+ if (conn_info->instance_id == -1) {
+ ret = gattc_get_att_mtu(conn_info->connection_id, &stack_mtu);
+ if (ret != OAL_STATUS_SUCCESS) {
+ BT_ERR("ret: %d", ret);
+ return _bt_convert_oal_status_to_bt_error(ret);
+ }
+ } else {
+ ret = gatts_get_att_mtu(conn_info->connection_id, &stack_mtu);
+ if (ret != OAL_STATUS_SUCCESS) {
+ BT_ERR("ret: %d", ret);
+ return _bt_convert_oal_status_to_bt_error(ret);
+ }
}
BT_INFO("ATT MTU received from OAL [%d]", stack_mtu);