From a6ec73358ff0d6a48c38148e7b315fda3f961aba Mon Sep 17 00:00:00 2001 From: poozy101 Date: Thu, 6 May 2021 02:26:37 -0400 Subject: [PATCH] Update BLE_client.ino 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). --- libraries/BLE/examples/BLE_client/BLE_client.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/BLE/examples/BLE_client/BLE_client.ino b/libraries/BLE/examples/BLE_client/BLE_client.ino index 55d9fa0de6a..5d39c109709 100644 --- a/libraries/BLE/examples/BLE_client/BLE_client.ino +++ b/libraries/BLE/examples/BLE_client/BLE_client.ino @@ -54,7 +54,8 @@ bool connectToServer() { // Connect to the remove BLE Server. pClient->connect(myDevice); // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private) Serial.println(" - Connected to server"); - + pClient->setMTU(517); //set client to request maximum MTU from server (default is 23 otherwise) + // Obtain a reference to the service we are after in the remote BLE server. BLERemoteService* pRemoteService = pClient->getService(serviceUUID); if (pRemoteService == nullptr) {