This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf51422_xxac_s130

Hello, how can i modify the hrs_s_evt_handler() to initiate bonding only if it my configured belt address?

My Solution:

static void hrs_c_evt_handler(ble_hrs_c_t * p_hrs_c, ble_hrs_c_evt_t * p_hrs_c_evt)
{
    uint32_t err_code;
    ble_gap_addr_t peer_addr;
    ret_code_t peer_id_read;
    
    peer_id_read = dm_peer_addr_get(&m_dm_device_handle, &peer_addr);
    if((peer_id_read == NRF_SUCCESS) 
        && (peer_addr.addr[0] == (uint8_t)(BELT_CONFIG >> 16))
        && (peer_addr.addr[1] == (uint8_t)(BELT_CONFIG >> 8))
        && (peer_addr.addr[2] == (uint8_t)BELT_CONFIG))
    {
        switch (p_hrs_c_evt->evt_type)
Parents Reply Children
No Data
Related