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

How can I receive all non-filtered, BLE-compliant advertisement packets in MESH V5, Light switch Client example.

Hi, I am begginer, I work with  SES, Mesh_v5.0.0,  nRF5_SDK_17.0.2, and  s132, SD v7.2.0. I started it two weaks ago. :)

I tryed the examples, Light switch, with server and Client too, with success. Now I need to receive all non-filtered, BLE-compliant advertisement packets from different BLE beacons.

Could anybody suggest to me how can I start?

Parents
  • SOLVED !

    I can catch all incoming advs in scanner.c and print it in main.c

    The main.c

    char msg_adv[128]; //global variable in main.c
    .....
    int main(void) {
     initialize();
     start();

    for (;;)
     {
      if( msg_adv[0] != 0) // ADV is ready?
      {

      SEGGER_RTT_printf(0, msg_adv) ; // print new adv
      SEGGER_RTT_printf(0, "\n") ;
      msg_adv[0] = 0; //reeady to new

      }

    (void)sd_app_evt_wait(); // ha ezt kiremelem nem indul el az RTT log!!??
     }
    }

    The scanner.c

    extern char msg_adv[];      //from main
    .
     inside the:         static void radio_handle_end_event(void)

      inside of             : if (successful_receive) {
    .......
    if( msg_adv[0] == 0)        // save new adv parameters  if buffer is empty,  in text format to print in app ,
     {

      sprintf(msg_adv, "ADV-RX [@%u]: RSSI: %3d ADV TYPE: %x ADDR: [%02x:%02x:%02x:%02x:%02x:%02x]",
      p_packet->metadata.timestamp,
      p_packet->metadata.rssi,
      p_packet->metadata.adv_type,
      p_packet->metadata.adv_addr.addr[0],
      p_packet->metadata.adv_addr.addr[1],
      p_packet->metadata.adv_addr.addr[2],
      p_packet->metadata.adv_addr.addr[3],
      p_packet->metadata.adv_addr.addr[4],
      p_packet->metadata.adv_addr.addr[5]);
     }

  • Thanks for sharing the solution for others to benefit from.

    Br,
    Joakim

Reply Children
No Data
Related