static int __bt_get_bt_gatt_client_att_mtu_info_s(bt_gatt_client_att_mtu_info_s **dest, bluetooth_le_att_mtu_info_t *source)
{
+ BT_CHECK_INPUT_PARAMETER(source);
+
*dest = (bt_gatt_client_att_mtu_info_s *)g_malloc0(sizeof(bt_gatt_client_att_mtu_info_s));
if (_bt_convert_address_to_string(&((*dest)->remote_address), &(source->device_address)) != BT_ERROR_NONE) {
static int __bt_get_bt_gatt_server_att_mtu_info_s(bt_gatt_server_att_mtu_info_s **dest, bluetooth_le_att_mtu_info_t *source)
{
+ BT_CHECK_INPUT_PARAMETER(source);
+
*dest = (bt_gatt_server_att_mtu_info_s *)g_malloc0(sizeof(bt_gatt_server_att_mtu_info_s));
if (_bt_convert_address_to_string(&((*dest)->remote_address), &(source->device_address)) != BT_ERROR_NONE) {
bt_gatt_client_s *client = NULL;
BT_INFO("BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED");
- __bt_get_bt_gatt_client_att_mtu_info_s(&mtu_info, (bluetooth_le_att_mtu_info_t *)(param->param_data));
+
+ if (__bt_get_bt_gatt_client_att_mtu_info_s(&mtu_info,
+ (bluetooth_le_att_mtu_info_t *)(param->param_data)) != BT_ERROR_NONE) {
+ BT_ERR("Fail to get MTU info");
+ break;
+ }
+
+ if (mtu_info == NULL)
+ break;
client = _bt_gatt_get_client(mtu_info->remote_address);
server = (bt_gatt_server_s *)server_list->data;
- __bt_get_bt_gatt_server_att_mtu_info_s(&mtu_info, (bluetooth_le_att_mtu_info_t *)(param->param_data));
+ if (__bt_get_bt_gatt_server_att_mtu_info_s(&mtu_info,
+ (bluetooth_le_att_mtu_info_t *)(param->param_data)) != BT_ERROR_NONE) {
+ BT_ERR("Fail to get MTU info");
+ break;
+ }
+
+ if (mtu_info == NULL)
+ break;
if (server && server->att_mtu_changed_cb)
server->att_mtu_changed_cb(server,