De-multiplexing of the advertising data.
More...
|
#define | ADL_WILDCARD_AD_TYPE 0u |
|
#define | ADL_WILDCARD_ADV_TYPE (ble_packet_type_t)0xFFu |
|
|
typedef void(* | ad_handler_t) (const uint8_t *p_packet, uint32_t ad_packet_length, const nrf_mesh_rx_metadata_t *p_metadata) |
|
De-multiplexing of the advertising data.
Provides a listener-based interface for the incoming advertisement packets.
◆ ad_listener_subscribe()
Subscribe component to the certain AD.
The component shall provide pointer to a listener structure with AD value, priority for the listener and handler.
- Warning
- It is prohibited subscribing one listener twice.
- Parameters
-
[in] | p_adl | Pointer to the listener structure |
- Return values
-
NRF_SUCCESS | The listener was subscribed successfully. |
NRF_ERROR_INVALID_PARAM | adv_packet_type is incorrect |
NRF_ERROR_NULL | handler is NULL |
◆ ad_listener_unsubscribe()
Unsubscribe component from the certain AD.
The component shall provide pointer to a listener structure with AD value, priority for the listener and handler.
- Warning
- The listener shall be subscribed previously.
- Parameters
-
[in] | p_adl | Pointer to the listener structure |
- Return values
-
NRF_SUCCESS | The listener was unsubscribed successfully. |
NRF_ERROR_INVALID_PARAM | adv_packet_type is incorrect |
NRF_ERROR_NULL | handler is NULL |
◆ 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. |