nRF5 SDK for Mesh v5.0.0
instaburst_rx.h
1 /* Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 #ifndef INSTABURST_RX_H__
38 #define INSTABURST_RX_H__
39 
63 #include "instaburst.h"
64 #include "adv_ext_packet.h"
65 
66 #ifndef INSTABURST_RX_DEBUG
67 
68 #define INSTABURST_RX_DEBUG 0
69 #endif
70 
72 typedef struct
73 {
75  uint8_t payload_len;
76  const uint8_t * p_payload;
78 
80 typedef struct
81 {
82  uint32_t rx_ok;
83  uint32_t crc_fail;
84  uint32_t too_late;
85  uint32_t no_rx;
86  uint32_t invalid_offset;
87  uint32_t busy;
88  uint32_t switched_timeslot;
90 
96 void instaburst_rx_init(bearer_event_flag_callback_t packet_process_cb);
97 
101 void instaburst_rx_enable(void);
102 
106 void instaburst_rx_disable(void);
107 
114 
120 bool instaburst_rx_pending(void);
121 
128 
140 const instaburst_rx_stats_t * instaburst_rx_stats_get(uint8_t channel);
141 
144 #endif /* INSTABURST_RX_H__ */
const uint8_t * p_payload
A pointer to the packet payload.
Definition: instaburst_rx.h:76
Stats structure for Instaburst.
Definition: instaburst_rx.h:80
uint8_t payload_len
Length of the packet payload.
Definition: instaburst_rx.h:75
uint32_t rx_ok
Number of successfully received packets.
Definition: instaburst_rx.h:82
void instaburst_rx_packet_release(const instaburst_rx_packet_t *p_packet)
Releases a packet acquired through the instaburst_rx function.
uint32_t busy
Number of packets dropped because the scanner was busy.
Definition: instaburst_rx.h:87
uint32_t too_late
Number of times the module failed to start RX on time.
Definition: instaburst_rx.h:84
void instaburst_rx_enable(void)
Enables the Instaburst RX module by registering its RX callback with the scanner. ...
uint32_t no_rx
Number of times the module started RX on time, but failed detecting any incoming packets.
Definition: instaburst_rx.h:85
const instaburst_rx_packet_t * instaburst_rx(void)
Fetches a single packet from the Instaburst packet queue.
uint32_t switched_timeslot
Number of packets dropped because the timeslot ended before we could handle it.
Definition: instaburst_rx.h:88
void instaburst_rx_init(bearer_event_flag_callback_t packet_process_cb)
Initializes the Instaburst RX module.
Metadata structure for packets received with Instaburst.
Definition: nrf_mesh.h:135
uint32_t invalid_offset
Number of packets dropped due to unsupported offset times.
Definition: instaburst_rx.h:86
bool instaburst_rx_pending(void)
Checks whether Instaburst has any packets ready for being fetched by instaburst_rx.
void instaburst_rx_disable(void)
Disables the Instaburst RX module.
nrf_mesh_rx_metadata_instaburst_t metadata
Metadata associated with the given packet.
Definition: instaburst_rx.h:74
const instaburst_rx_stats_t * instaburst_rx_stats_get(uint8_t channel)
Gets a pointer to the Instaburst RX stats structure.
A single Instaburst RX packet.
Definition: instaburst_rx.h:72
uint32_t crc_fail
Number of CRC failures detected.
Definition: instaburst_rx.h:83

Documentation feedback | Developer Zone | Subscribe | Updated