/* * @brief Setup local mtu that will be used to negotiate mtu during request from client peer * @param [in] mtu Value to set local mtu, should be larger than 23 and lower or equal to 517 */ esp_err_t BLEDevice::setMTU(uint16_t mtu) { ESP_LOGD(LOG_TAG, ">> setLocalMTU: %d", mtu); esp_err_t err = esp_ble_gatt_set_local_mtu(mtu); if(err == ESP_OK){ m_localMTU = mtu; } else { ESP_LOGE(LOG_TAG, "can't set local mtu value: %d", mtu); } ESP_LOGD(LOG_TAG, "<< setLocalMTU"); return err; }
esp_err_t setMtu(){ esp_err_t ret; ret = esp_ble_gatt_set_local_mtu(500);if(ret)jsWarn("set local MTU failed:%x\n",ret); return ret; }