Hi there,
I've already implemented a custom firmware for nRF52832 with SDK 15.0.0 and S132 v6.0.0 which uses both advertising and scan operations, and now I'd like to use extended advertising.
I've been reading similar posts but did not find my answer. It would be great to have an hint on how to implement both advertising and scan.
1) My usual approach for creating an advertising packet is to fill the payload byte by byte like this:
//Manufacturer data m_advertising.enc_advdata[3]=0x1B; m_advertising.enc_advdata[4]=0xFF; m_advertising.enc_advdata[5]=0xC7; m_advertising.enc_advdata[6]=mydata[myindex]; //..and so on until the max length (31 B) is reached m_advertising.adv_data.adv_data.p_data = m_advertising.enc_advdata; m_advertising.adv_data.adv_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX; //31 Bytes
Besides setting the correct advertising parameters such as BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED etc., how can I fill the extended advertising packet byte by byte? How should this additional 255 bytes packet be composed (flags, fields..)?
2) On the scan side, I'm using something like this:
static void on_adv_report(ble_gap_evt_adv_report_t const * p_adv_report){
ret_code_t err_code;
int i=0;
while (i < (int)p_adv_report->data.len){
my_scanned_bytes_buffer[i]=p_adv_report->data.p_data[i];
// ..and so on. I process the data contained in my_scanned_bytes_buffer
Is there a similar way to parse the data coming from extended advertising packets ?
I hope my question is clear. Thanks for your support.