esp-sdr-zephyr
Raw I/Q receive and transmit on the ESP32-S3/C6 Wi-Fi radio, for Zephyr
Loading...
Searching...
No Matches
zb_radio.h
1
/*
2
* SPDX-License-Identifier: GPL-3.0-or-later
3
*
4
* What the Zigbee MAC needs from an 802.15.4 radio. Backends: apps/zstack (ESP32-C6 native
5
* radio), tests/unit/zigbee_mac (a mock). Frames never include the FCS. All calls come from the
6
* MAC thread, one at a time. Received frames go the other way through zb_mac_rx().
7
*/
8
#ifndef ZIGBEE_ZB_RADIO_H_
9
#define ZIGBEE_ZB_RADIO_H_
10
11
#include <stdbool.h>
12
#include <stddef.h>
13
#include <stdint.h>
14
15
struct
zb_radio_ops
{
16
/* Channel 11..26; takes effect at the next start() (or tx/ed). */
17
int (*set_channel)(
void
*ctx, uint8_t ch);
18
/*
19
* Receive filter: PAN ID, short address and extended address (little endian). The radio
20
* auto-ACKs frames that match them.
21
*/
22
int (*set_ids)(
void
*ctx, uint16_t pan, uint16_t short_addr,
const
uint8_t ext[8]);
23
/* PAN coordinator flag; promiscuous receives everything and stops auto-ACKs (scans only). */
24
int (*set_mode)(
void
*ctx,
bool
coordinator,
bool
promiscuous);
25
int (*set_txpower)(
void
*ctx, int8_t dbm);
26
/* Apply the settings and receive. */
27
int (*start)(
void
*ctx);
28
/*
29
* Send one frame, blocking. @p csma: one clear channel assessment first. Returns 0, -EBUSY
30
* (channel busy), -ENOMSG (an ACK was requested and did not come), -EIO (a frame is being
31
* received or sent: try again shortly).
32
*/
33
int (*tx)(
void
*ctx,
const
uint8_t *f,
size_t
n,
bool
csma);
34
/* Energy on the current channel averaged over @p ms; dBm. Blocking, interrupts receive. */
35
int (*ed)(
void
*ctx, uint16_t ms, int8_t *dbm);
36
};
37
38
#endif
/* ZIGBEE_ZB_RADIO_H_ */
zb_radio_ops
Definition
zb_radio.h:15
zigbee
zb_radio.h
Generated by
1.15.0