目录
实现如何扫描和解析广告。
1.GAP LE 用于接收广播的设置
GAP LE 广告作为 GAP EVENT ADVERTISING REPORT的自定义 HCI 事件被接收。要接收它们,您需要注册 HCI 数据包处理器,如这里的列表所示。
/* @section GAP LE setup for receiving advertisements
*
* @text GAP LE advertisements are received as custom HCI events of the
* GAP_EVENT_ADVERTISING_REPORT type. To receive them, you'll need to register
* the HCI packet handler, as shown in Listing GAPLEAdvSetup.
*/
/* LISTING_START(GAPLEAdvSetup): Setting up GAP LE client for receiving advertisements */
static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
static v