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

advertisement packet format with RAW data

Lookin at following solar beacon example,

there is strange code at m_beacon_pdu_init().

https://github.com/NordicPlayground/solar_sensor_beacon/blob/master/src/sensor_beacon.c

In BT spec, advertising PDU is 16bit header + N octets payload.

So header should be 2bytes, but source code idicates 3bytes.

static void m_beacon_pdu_init(uint8_t * p_beacon_pdu) {

 p_beacon_pdu[0] = 0x42; // ADV_NONCON_IND, TxAdd=1 
 p_beacon_pdu[1] = 0;      // length field , stored later
 p_beacon_pdu[2] = 0;    // <----- What???

}

I tested this source code, and I received successful beacon by Android and also nRF52.

Could you explain this?

Related