h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
667 stars 138 forks source link

Notification 8 byte data size #653

Closed harunsengul closed 3 weeks ago

harunsengul commented 3 months ago

Hi,

void notifyCB(NimBLERemoteCharacteristic* pRemoteCharacteristic, uint8_t* pData, size_t length, bool isNotify) { std::string str = (isNotify == true) ? "" : ""; //str += " from "; ///** NimBLEAddress and NimBLEUUID have std::string operators */ //str += std::string(pRemoteCharacteristic->getRemoteService()->getClient()->getPeerAddress()); //str += ": Service = " + std::string(pRemoteCharacteristic->getRemoteService()->getUUID()); //str += ", Characteristic = " + std::string(pRemoteCharacteristic->getUUID()); str += std::string((char*)pData, length); Serial.print(str.c_str()); }

This code only returns 8 bytes of the data package but my data package is lenght is 25 bytes.

So how can I read all data package instead of 8 bytes. Could you please help me?

I've used nrfConnect to see notification data and it showed me whole data package.

h2zero commented 3 weeks ago

I am going to assume you've got this sorted already and close the issue. Please re-open if not.