Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0d6b142

Browse files
authoredMay 18, 2021
Update BLE_client.ino (#5156)
Pull request #4999 added setMTU function to BLEClient.cpp/.h, this line provides implementation of this added functionality to the BLE client example to resolve cases in which data from notifyCallback exceeds 20 characters (3 bytes for command type and attribute ID, 20 bytes for attribute data (char*)pData).
1 parent 7c3a82a commit 0d6b142

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎libraries/BLE/examples/BLE_client/BLE_client.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ bool connectToServer() {
5454
// Connect to the remove BLE Server.
5555
pClient->connect(myDevice); // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private)
5656
Serial.println(" - Connected to server");
57-
57+
pClient->setMTU(517); //set client to request maximum MTU from server (default is 23 otherwise)
58+
5859
// Obtain a reference to the service we are after in the remote BLE server.
5960
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
6061
if (pRemoteService == nullptr) {

0 commit comments

Comments
 (0)
Please sign in to comment.