SWRA475A January 2015 – October 2016 CC2540 , CC2540T , CC2541 , CC2541-Q1
This project was created by modifying the SimplePeripheral project. It currently only supports non-connectable advertisements, but the SimplePeripheral project was used instead of the SimpleBroadcaster project to be consistent with the SimpleEddystoneBeacon project (described in a separate application note).
The main modification to the SimplePeripheral project is to the advertisement data. According to the iBeacon specifications, the data is as follows:
static beaconAdvData_t beaconAdv =
{
// Flags; this sets the device to use general discoverable mode
0x02, // length of this data
GAP_ADTYPE_FLAGS,
0x06,
0x1A, // length of this data including the data type byte
0xFF, // type
0x4C, // company ID[0]
0x00, // company ID[1]
0x02, // beacon type[0]
0x15, // beacon type[1]
0xA3, // UUID LSB
0x22,
0x37,
0xE7,
0x3E,
0xC0,
0xC5,
0x84,
0x86,
0x4B,
0xB9,
0x99,
0xF9,
0x82,
0x03,
0xF7, // UUID MSB
0x00, //major[0] (major and minor fields can be set as desired)
0x00, //major[1]
0x00, //minor[0]
0x00, //minor[1]
0x00 //measured power (can be set later)
};
The company ID identifies the beacon as an Apple product, and the beacon type identifies the device as a proximity beacon. Any other valid UUID could be used to replace the one that is currently there, as long as it is inserted in the order indicated. The major and minor fields are currently unset, but they can be set as desired to further identify the device. Lastly, the specifications describe a procedure for measuring the power.
Additionally, the advertisement interval is set by specifying minimum and maximum intervals for limited and general discoverable modes. Typically, all four parameters are set to the same value to get the desired interval as follows:
GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt);
GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt);
GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt);
GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);
The specifications state that the beacon must broadcast the entire advertising packet in all three advertising frequencies, and they must use a 100-ms advertising interval.