This commit is contained in:
hathach committed 2019-01-17 19:17:51 +07:00
1 parent 56ca1fdc48
commit 45129ea425
2 files changed
+3 -8

No files matched your search

+2 -6
View File
@@ -110,11 +110,6 @@ uint16_t BLEGap::getMaxMtuByConnCfg(uint8_t conn_cfg)
return (conn_cfg == CONN_CFG_PERIPHERAL) ? _prph.mtu_max : _central.mtu_max;
}
uint16_t BLEGap::getMaxMtu (uint8_t conn_hdl)
{
return (getRole(conn_hdl) == BLE_GAP_ROLE_PERIPH) ? _prph.mtu_max : _central.mtu_max;
}
/**
* Get current Mac address and its type
* @param mac address
@@ -564,7 +559,8 @@ void BLEGap::_eventHandler(ble_evt_t* evt)
case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
{
conn->att_mtu = minof(evt->evt.gatts_evt.params.exchange_mtu_request.client_rx_mtu, getMaxMtu(conn_hdl));
uint16_t const mtu_max = (conn->role == BLE_GAP_ROLE_PERIPH) ? _prph.mtu_max : _central.mtu_max;
conn->att_mtu = minof(evt->evt.gatts_evt.params.exchange_mtu_request.client_rx_mtu, mtu_max);
VERIFY_STATUS( sd_ble_gatts_exchange_mtu_reply(conn_hdl, conn->att_mtu), );
LOG_LV1("GAP", "ATT MTU is changed to %d", conn->att_mtu);
+1 -2
View File
@@ -104,7 +104,6 @@ class BLEGap
uint16_t getPeerName (uint16_t conn_hdl, char* buf, uint16_t bufsize);
uint16_t getMTU (uint16_t conn_hdl);
uint16_t getMaxMtu (uint8_t conn_hdl);
uint16_t getMaxMtuByConnCfg (uint8_t conn_cfg);
bool getHvnPacket (uint16_t conn_hdl);
@@ -122,7 +121,7 @@ class BLEGap
* Although declare as public, it is meant to be invoked by internal
* code. User should not call these directly
*------------------------------------------------------------------*/
void _eventHandler(ble_evt_t* evt);
void _eventHandler(ble_evt_t* evt);
void _prph_setConnectCallback ( connect_callback_t fp);
void _prph_setDisconnectCallback( disconnect_callback_t fp);