Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 10 months 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
6 years, 10 months 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