About the callback function "onConnection"
Posted: 02:49, 05 Jun 2015
Hello everybody,
When I walk through this tutorial "How to turn a Nordic Semiconductor nRF51-DK into a discoverable beacon using mbed (http://evothings.com/how-to-turn-a-nordic-semiconductor-nrf51-dk-into-a-discoverable-beacon-using-mbed/)"
There is a callback function "onConnection" in main code as below:
Then the compiler generate an error 167:
Please tell me how to remove it?
Thank you for your help!!
When I walk through this tutorial "How to turn a Nordic Semiconductor nRF51-DK into a discoverable beacon using mbed (http://evothings.com/how-to-turn-a-nordic-semiconductor-nrf51-dk-into-a-discoverable-beacon-using-mbed/)"
There is a callback function "onConnection" in main code as below:
Code: Select all
void onConnection(Gap::Handle_t handle,
Gap::addr_type_t peerAddrType,
const Gap::address_t peerAddr,
const Gap::ConnectionParams_t * connectionParams)
{
set the initial values of the characteristics (for every session) led_value = 0;
onLedDataWritten(&led_value, 1);
force LED's to be in off state
}
...
...
ble.onConnection(onConnection);
...
Then the compiler generate an error 167:
Code: Select all
Error: Argument of type "void (*)(Gap::Handle_t, Gap::addr_type_t, const std::uint8_t *, const Gap::ConnectionParams_t *)" is incompatible with parameter of type "Gap::ConnectionEventCallback_t" in "main.cpp", Line: 198, Col: 24
Please tell me how to remove it?
Thank you for your help!!