De-multiplexing of the advertising data. More...
Data Structures | |
| struct | ad_listener_t |
Macros | |
| #define | ADL_WILDCARD_AD_TYPE 0u |
| #define | ADL_WILDCARD_ADV_TYPE (ble_packet_type_t)0xFFu |
| #define | AD_LISTENER(name) NRF_MESH_SECTION_ITEM_REGISTER_FLASH(ad_listeners, const ad_listener_t name) |
| Define an AD listener. More... | |
Typedefs | |
| typedef void(* | ad_handler_t) (const uint8_t *p_packet, uint32_t ad_packet_length, const nrf_mesh_rx_metadata_t *p_metadata) |
Functions | |
| void | ad_listener_init (void) |
| Initialize the AD listener module. | |
| void | ad_listener_process (ble_packet_type_t adv_type, const uint8_t *p_payload, uint32_t payload_length, const nrf_mesh_rx_metadata_t *p_metadata) |
| Process the incoming data from the scanner. More... | |
Detailed Description
De-multiplexing of the advertising data.
Provides a listener-based interface for the incoming advertisement packets.
Macro Definition Documentation
◆ AD_LISTENER
| #define AD_LISTENER | ( | name | ) | NRF_MESH_SECTION_ITEM_REGISTER_FLASH(ad_listeners, const ad_listener_t name) |
Define an AD listener.
Its value should be assigned as part of the declaration:
AD_LISTENER(my_listener) = { .ad_type = AD_TYPE_BEACON, .adv_packet_type = BLE_PACKET_TYPE_ADV_NONCONN_IND, .handler = my_handler_function,};
Definition at line 84 of file ad_listener.h.
Function Documentation
◆ ad_listener_process()
| void ad_listener_process | ( | ble_packet_type_t | adv_type, |
| const uint8_t * | p_payload, | ||
| uint32_t | payload_length, | ||
| const nrf_mesh_rx_metadata_t * | p_metadata | ||
| ) |
Process the incoming data from the scanner.
The function reads out the received frame from scanner, performs preliminary parsing of AD fields and sends out parsed AD frames to subscribers.
- Warning
- The listener shall be subscribed previously.
- Parameters
-
[in] adv_type Advertising type for the packet. [in] p_payload Pointer to the packet payload. [in] payload_length The length of the given payload. [in] p_metadata Metadata attached to the packet.