1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include "btc/btc_task.h" 16 #include "btc/btc_main.h" 17 #include "btc/btc_dm.h" 18 #include "osi/future.h" 19 #include "esp_err.h" 20 #include "btc/btc_config.h" 21 #include "osi/alarm.h" 22 #include "btc/btc_ble_storage.h" 23 #include "btc_gatt_common.h" 24 #include "bta/bta_gatt_common.h" 25 26 btc_set_local_mtu(uint16_t mtu)27static void btc_set_local_mtu(uint16_t mtu) 28 { 29 BTA_GATT_SetLocalMTU(mtu); 30 } 31 btc_gatt_com_call_handler(btc_msg_t * msg)32void btc_gatt_com_call_handler(btc_msg_t *msg) 33 { 34 BTC_TRACE_DEBUG("%s act %d\n", __func__, msg->act); 35 switch (msg->act) { 36 case BTC_GATT_ACT_SET_LOCAL_MTU: 37 { 38 btc_ble_gatt_com_args_t *arg = (btc_ble_gatt_com_args_t *)(msg->arg); 39 btc_set_local_mtu(arg->set_mtu.mtu); 40 break; 41 } 42 default: 43 BTC_TRACE_ERROR("%s UNKNOWN ACT %d\n", __func__, msg->act); 44 break; 45 } 46 } 47