This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Access the led_state value in the blinky app example, for using it in the main function !

hi ,

new to Nordic developmen. struggling to access the characteristic data to be able to use it in the main function !

i have started with the blinky app example as it covers my needs for the ble setting (need one service + 2 characteristics ) . for my project i need to use the characteristic data (the  led_state  in the example ) in my main function .

but the led_state data seems to be not accessible at this function !  have tried the memcpy() , can't copy it .

please kindly guide .

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
static void led_write_handler(uint16_t conn_handle, ble_lbs_t * p_lbs, uint8_t led_state)
{
if(led_state){
bsp_board_led_on(BSP_BOARD_LED_0);
NRF_LOG_INFO("Received LED ON!");
}
else
{
bsp_board_led_off(BSP_BOARD_LED_0);
NRF_LOG_INFO("Received LED OFF!");
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX