mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
Remove data length extension in IDF (not released yet)
This commit is contained in:
parent
5925782a65
commit
d793b1251e
2 changed files with 8 additions and 0 deletions
|
@ -445,12 +445,16 @@ void NimBLEClient::updateConnParams(uint16_t minInterval, uint16_t maxInterval,
|
||||||
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
|
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
|
||||||
*/
|
*/
|
||||||
void NimBLEClient::setDataLen(uint16_t tx_octets) {
|
void NimBLEClient::setDataLen(uint16_t tx_octets) {
|
||||||
|
#ifdef CONFIG_NIMBLE_CPP_IDF // not yet available in IDF, Sept 9 2021
|
||||||
|
return;
|
||||||
|
#else
|
||||||
uint16_t tx_time = (tx_octets + 14) * 8;
|
uint16_t tx_time = (tx_octets + 14) * 8;
|
||||||
|
|
||||||
int rc = ble_gap_set_data_len(m_conn_id, tx_octets, tx_time);
|
int rc = ble_gap_set_data_len(m_conn_id, tx_octets, tx_time);
|
||||||
if(rc != 0) {
|
if(rc != 0) {
|
||||||
NIMBLE_LOGE(LOG_TAG, "Set data length error: %d, %s", rc, NimBLEUtils::returnCodeToString(rc));
|
NIMBLE_LOGE(LOG_TAG, "Set data length error: %d, %s", rc, NimBLEUtils::returnCodeToString(rc));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} // setDataLen
|
} // setDataLen
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -786,12 +786,16 @@ void NimBLEServer::updateConnParams(uint16_t conn_handle,
|
||||||
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
|
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
|
||||||
*/
|
*/
|
||||||
void NimBLEServer::setDataLen(uint16_t conn_handle, uint16_t tx_octets) {
|
void NimBLEServer::setDataLen(uint16_t conn_handle, uint16_t tx_octets) {
|
||||||
|
#ifdef CONFIG_NIMBLE_CPP_IDF // not yet available in IDF, Sept 9 2021
|
||||||
|
return;
|
||||||
|
#else
|
||||||
uint16_t tx_time = (tx_octets + 14) * 8;
|
uint16_t tx_time = (tx_octets + 14) * 8;
|
||||||
|
|
||||||
int rc = ble_gap_set_data_len(conn_handle, tx_octets, tx_time);
|
int rc = ble_gap_set_data_len(conn_handle, tx_octets, tx_time);
|
||||||
if(rc != 0) {
|
if(rc != 0) {
|
||||||
NIMBLE_LOGE(LOG_TAG, "Set data length error: %d, %s", rc, NimBLEUtils::returnCodeToString(rc));
|
NIMBLE_LOGE(LOG_TAG, "Set data length error: %d, %s", rc, NimBLEUtils::returnCodeToString(rc));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} // setDataLen
|
} // setDataLen
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue