3 years ago.

BLE: gattServer().write() overloaded function

Hi all,

I'm having an issue trying to update the value of a characteristic within a custom BLE service. I am attempting to update the value of this characteristic with the value from a sensor. Please see the function below:

void onDataReadCallback(const GattReadCallbackParams *eventDataP) {
    if (eventDataP->handle == dhtServicePtr->dataStream.getValueHandle()) {
        led = !led;
        const uint8_t data = sensorData;

        BLE::Instance().gattServer().write(eventDataP->handle, &data, sizeof(data), false);   

The exact error I receive is:

Error: No instance of overloaded function "GattServer::write" matches the argument list in "main.cpp", Line: 135, Col: 39

According to the gattServer docs I believe I'm doing everything correctly...

Any help would be very much appreciated.

Thanks, Adam

2 Answers

2 years, 6 months ago.

Did you solve this problem? If yes how???:)

3 years ago.

Hello Adam,

Did you get that error referencing the following line of code?:

        BLE::Instance().gattServer().write(eventDataP->handle, &data, sizeof(data), false);   

I tried compiling it and didn't receive the error. Could you try isolating that piece of code or were there other instances of GattServer::write? Thanks!

Karen, team Mbed