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

Logging node metadata over RTT

Hi, I am using Heartbeat messages with the light switch example, and want to log the nrf_mesh_rx_metadata_t in heartbeat_opcode_handle() to RTT viewer so I can write it to a file. I think I have to do this by attaching it to NRF_MESH_EVT_HB_MESSAGE_RECEIVED eventbut I have tried and failed with many different methods. Does someone know a solution to this problem?

Parents Reply Children
  • I see. 

    If you use the example in my previous post, adding this to your example should work for retrieving the RSSI. 

    In heartbeat.c under the heartbeat_opcode_handle (), add:

    evt.params.message.p_metadata = p_rx_metadata;

    In main.c under the mesh_evt_cb() and the NRF_MESH_EVT_HB_MESSAGE_RECEIVED add: 

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "RSSI = %d\n", p_evt->params.message.p_metadata->params.scanner.rssi); 

    This should print the RSSI for the heartbeat message you receive. 

    Best regards, 
    Joakim.

Related