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.
8 years, 3 months ago.
about central
hi,
I have button service program in peripheral side, it is updating the button state value in server and I want read the value from peripheral to central and actuate the led in central device, i am following mbed os-led _blinker an example,
I just modified little in given code
void triggerToggledWrite(const GattReadCallbackParams *response) {
if (response->handle == ledCharacteristic.getValueHandle()) {
printf("triggerToggledWrite: handle %u, offset %u, len %u\r\n", response->handle, response->offset, response->len);
for (unsigned index = 0; index < response->len; index++) {
printf("%c[%02x]", response->data[index], response->data[index]);
}
printf("\r\n");
/*uint8_t toggledValue = response->data[0] ^ 0x1;
ledCharacteristic.write(1, &toggledValue);*/
actuatedLED = response->data[0];
}
}
but its not working any other modification is required please suggest me.
Can you define "its not working" ? Do you see the function being invoked? What is printed?
posted by Jan Jongboom 06 Sep 2017