This provides simplified way to send/receive data from Nordic wireless chip. ALL WIRELESS DATA should be sent/received through this API. More...


Go to the source code of this file.
Macros | |
#define | wireless_form_pkt(pkt, dst, protocol, max_hops, num_ptrs, args...) mesh_form_pkt(pkt, dst, protocol, max_hops, num_ptrs, args) |
Just a wrapper around mesh_form_pkt() to put all wireless related API at this file. More... | |
#define | wireless_deform_pkt(pkt, num_ptrs, args...) mesh_deform_pkt(pkt, num_ptrs, args) |
Just a wrapper around mesh_deform_pkt() to put all wireless related API at this file. More... | |
Functions | |
bool | wireless_init (void) |
void | wireless_service (void) |
char | wireless_get_rx_pkt (mesh_packet_t *pkt, const uint32_t timeout_ms) |
char | wireless_get_ack_pkt (mesh_packet_t *pkt, const uint32_t timeout_ms) |
Same as wireless_get_rx_pkt(), except this will retrieve an ACK response. More... | |
int | wireless_flush_rx (void) |
Detailed Description
This provides simplified way to send/receive data from Nordic wireless chip. ALL WIRELESS DATA should be sent/received through this API.
Macro Definition Documentation
#define wireless_deform_pkt | ( | pkt, | |
num_ptrs, | |||
args... | |||
) | mesh_deform_pkt(pkt, num_ptrs, args) |
Just a wrapper around mesh_deform_pkt() to put all wireless related API at this file.
#define wireless_form_pkt | ( | pkt, | |
dst, | |||
protocol, | |||
max_hops, | |||
num_ptrs, | |||
args... | |||
) | mesh_form_pkt(pkt, dst, protocol, max_hops, num_ptrs, args) |
Just a wrapper around mesh_form_pkt() to put all wireless related API at this file.
Function Documentation
int wireless_flush_rx | ( | void | ) |
Flush all received data of mesh (ACKs and RX packets)
- Returns
- the discarded packet count
char wireless_get_ack_pkt | ( | mesh_packet_t * | pkt, |
const uint32_t | timeout_ms | ||
) |
Same as wireless_get_rx_pkt(), except this will retrieve an ACK response.
char wireless_get_rx_pkt | ( | mesh_packet_t * | pkt, |
const uint32_t | timeout_ms | ||
) |
Call this function periodically to get a queued packet.
- Parameters
-
timeout_ms The number of milliseconds to wait for a packet. If FreeRTOS is running, then this becomes the queue wait time.
- Returns
- true if a packet was dequeued, or false if there is no packet.
Here is an example of how to send a packet and ensure the destined node received the data :
bool wireless_init | ( | void | ) |
Initializes nordic driver layer and the mesh network layer. This is already called before main() function is run.
- Returns
- true if everything is successful.
void wireless_service | ( | void | ) |
Calls mesh_service() routine. This is encapsulated because this function will only call mesh_service() when there is either a pending packet or a packet received as indicated by nordic interrupt. This function is called through RIT or through FreeRTOS tick hook, so you don't have to call it yourself.