Hello,
I've been using the SDK 15's "ble_app_uart" example and I've been curious on how the function nus_data_handler() gets called after data is sent over BLE. More specifically who sends * p_evt to the function.
Regards,
Thomas
Hello,
I've been using the SDK 15's "ble_app_uart" example and I've been curious on how the function nus_data_handler() gets called after data is sent over BLE. More specifically who sends * p_evt to the function.
Regards,
Thomas
Hi Thomas,
The user event handler (nus_data_handler()
in the ble_app_uart
example) is registered with the call to ble_nus_init()
. You can see from the implementation in ble_nus.c that the pointer is copied to p_nus->data_handler
, and it is called whenever there is an event that the application should know about (connection, write, read etc.). You can see that the pointer to the event structure is always passed when it is called.
For example, line 114 in ble_nus.c
in SDK 15 informs the application about the connected event and passes a pointer to the event structure that was populated immediately before that call.
Hi Thomas,
The user event handler (nus_data_handler()
in the ble_app_uart
example) is registered with the call to ble_nus_init()
. You can see from the implementation in ble_nus.c that the pointer is copied to p_nus->data_handler
, and it is called whenever there is an event that the application should know about (connection, write, read etc.). You can see that the pointer to the event structure is always passed when it is called.
For example, line 114 in ble_nus.c
in SDK 15 informs the application about the connected event and passes a pointer to the event structure that was populated immediately before that call.
hi........einar
what function to be used to transfer the data from nrf5 to uart app via ble
could you please help me