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

Is it possible to see raw extended advertising packets?

Hi,

I'm a beginner trying to understand BLE extended advertising. I have modified the peripheral/ble_app_beacon example to broadcast extended advertising packets with PHY=Coded. I'm receiving the packets using the pc-ble-driver with a modified "heart_rate_collector" example. I'm using two nrf52840 dongles.

I'm currently able to read the entire data that I transmit on the advertising packet, and some other bytes like the source address using the following code:

static void on_adv_report(const ble_gap_evt_t *const p_ble_gap_evt)
{
    uint32_t err_code;
    uint8_t str[STRING_BUFFER_SIZE] = {0};

    // Log the Bluetooth device address of advertisement packet received.
    ble_address_to_string_convert(p_ble_gap_evt->params.adv_report.peer_addr, str);
    printf("Received advertisement report with device address: 0x%s\n", str);
    printf("Extended?: %d, channel: %d, data len:: %d\n",
           p_ble_gap_evt->params.adv_report.type.extended_pdu,
           p_ble_gap_evt->params.adv_report.ch_index, p_ble_gap_evt->params.adv_report.data.len);
    //Printar data:
    int i;
    for (i = 0; i < p_ble_gap_evt->params.adv_report.data.len; i++)
    {
        printf("%02X", p_ble_gap_evt->params.adv_report.data.p_data[i]);
    }
    printf("\n");
    fflush(stdout);
}

..but I would like to see all the raw packet that I'm receiving (both primary and secondary extended advertising packet). I think the raw packet should begin with a 0x3C (preamble) byte since I'm transmitting and receiving with coded phy. Is there any form to visualize all the bytes (including the preamble byte)?

Thanks in advance.

Parents Reply Children
Related