
Data Structures | |
| union | zb_gpdf_mac_addr_flds_u |
| MAC addressing fields of GPDF as they are transmitted over the air. More... | |
| struct | zb_mac_mhr_s |
| Parser MAC header. More... | |
Macros | |
| #define | ZB_ADDR_NO_ADDR 0x00U |
| 802.15: 0x00 = no address (addressing fields omitted, see 7.2.1.1.8). More... | |
| #define | ZB_ADDR_16BIT_MULTICAST 0x01U |
| 802.15: 0x01 = reserved. More... | |
| #define | ZB_ADDR_16BIT_GROUP ZB_ADDR_16BIT_MULTICAST |
| APS: 0x01 = 16-bit group address for DstAddress. More... | |
| #define | ZB_ADDR_16BIT_DEV_OR_BROADCAST 0x02U |
| 802.15: 0x02 = 16-bit short address. More... | |
| #define | ZB_ADDR_64BIT_DEV 0x03U |
| 802.15: 0x03 = 64-bit extended address. More... | |
| #define | ZB_BROADCAST_PAN_ID 0xFFFFU |
| Broadcast Pan ID value. More... | |
| #define | ZB_FCF_GET_DST_ADDRESSING_MODE(p_fcf) (((( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_FIRST_BYTE] ) & 0x0CU) ) >> 2U ) |
| Gets source addressing mode subfield in frame control field (FCF). More... | |
| #define | ZB_FCF_GET_SRC_ADDRESSING_MODE(p_fcf) ( (( ( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_FIRST_BYTE] ) & 0xC0U )) >> 6U ) |
| Gets source addressing mode subfield in frame control field (FCF). More... | |
| #define | ZB_FCF_GET_PANID_COMPRESSION_BIT(p_fcf) (( ( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_ZERO_BYTE] ) & 0x40U )) |
| Gets Pan ID compression bit subfield in frame control field (FCF). More... | |
Typedefs | |
| typedef struct zb_mac_mhr_s | zb_mac_mhr_t |
| Parser MAC header. More... | |
Functions | |
| void | zb_mac_init () |
| Inits ZGPD MAC HW. More... | |
| void | zb_mac_set_ieee_addr (const zb_ieee_addr_t ieee_addr) |
| Inits ZGPD MAC IEEE address. More... | |
| zb_uint8_t | zb_mac_frame_prepare (zb_uint8_t *buffer, const gboss_device_config_t *device_config, zb_uint8_t sequence_number, zb_uint16_t dst_pan_id) |
| Prepares a packet to be sent. More... | |
| void | zb_mac_send (zb_uint8_t *buf, zb_uint8_t repetitions) |
| Sends ZGPD frame through one channel. More... | |
| void | zb_mac_sync_wait_tx_complete (void) |
| Blocks waiting for TX complete. More... | |
| void | zb_mac_set_tx_power (zb_int8_t power) |
| Sets the TX power on the transmitter (in dBm). More... | |
| void | zb_mac_set_tx_channel (zb_int8_t channel) |
| Sets RF channel to be used. More... | |
| zb_uint8_t | zb_parse_mhr (zb_mac_mhr_t *mhr, zb_uint8_t *buf) |
| Parses packed mhr header, fills mhr structure. More... | |
| #define ZB_ADDR_NO_ADDR 0x00U |
802.15: 0x00 = no address (addressing fields omitted, see 7.2.1.1.8).
| #define ZB_ADDR_16BIT_MULTICAST 0x01U |
802.15: 0x01 = reserved.
NWK: 0x01 = 16-bit multicast group address.
| #define ZB_ADDR_16BIT_GROUP ZB_ADDR_16BIT_MULTICAST |
APS: 0x01 = 16-bit group address for DstAddress.
| #define ZB_ADDR_16BIT_DEV_OR_BROADCAST 0x02U |
802.15: 0x02 = 16-bit short address.
NWK: 0x02 = 16-bit network address of a device or a 16-bit broadcast address.
Referenced by zb_parse_mhr().
| #define ZB_ADDR_64BIT_DEV 0x03U |
802.15: 0x03 = 64-bit extended address.
| #define ZB_BROADCAST_PAN_ID 0xFFFFU |
Broadcast Pan ID value.
| #define ZB_FCF_GET_DST_ADDRESSING_MODE | ( | p_fcf | ) | (((( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_FIRST_BYTE] ) & 0x0CU) ) >> 2U ) |
Gets source addressing mode subfield in frame control field (FCF).
Retrieves value from address_modes.
| p_fcf | Pointer to 16bit FCF field |
Referenced by zb_parse_mhr().
| #define ZB_FCF_GET_SRC_ADDRESSING_MODE | ( | p_fcf | ) | ( (( ( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_FIRST_BYTE] ) & 0xC0U )) >> 6U ) |
Gets source addressing mode subfield in frame control field (FCF).
Retrieves value from address_modes.
| p_fcf | Pointer to 16bit FCF field. |
| #define ZB_FCF_GET_PANID_COMPRESSION_BIT | ( | p_fcf | ) | (( ( ( ( const zb_uint8_t* ) ( p_fcf ) )[ZB_PKT_16B_ZERO_BYTE] ) & 0x40U )) |
Gets Pan ID compression bit subfield in frame control field (FCF).
Retrieved value can be 0 or 1.
| p_fcf | Pointer to 16bit FCF field. |
| typedef struct zb_mac_mhr_s zb_mac_mhr_t |
Parser MAC header.
Mac spec 7.2.1 General MAC frame format.
| void zb_mac_init | ( | ) |
Inits ZGPD MAC HW.
References TRACE_MSG.
Referenced by gboss_app_init().
| void zb_mac_set_ieee_addr | ( | const zb_ieee_addr_t | ieee_addr | ) |
Inits ZGPD MAC IEEE address.
| ieee_addr | IEEE address of GP device |
| zb_uint8_t zb_mac_frame_prepare | ( | zb_uint8_t * | buffer, |
| const gboss_device_config_t * | device_config, | ||
| zb_uint8_t | sequence_number, | ||
| zb_uint16_t | dst_pan_id | ||
| ) |
Prepares a packet to be sent.
The function sets some fields in the MAC header of the packet. Should be called before zb_mac_send() calling.
| buffer | Pointer to the start of MAC header area |
| device_config | GPD configuration block |
| sequence_number | Packet sequential number |
| dst_pan_id | Destination PAN ID |
Referenced by zgpd_pkt_send_bidir(), and zgpd_pkt_send_unidir().
| void zb_mac_send | ( | zb_uint8_t * | buf, |
| zb_uint8_t | repetitions | ||
| ) |
Sends ZGPD frame through one channel.
Sends one frame. It is supposed that MAC sequence number was added earlier.
| buf | Buffer to be sent. The first byte in the buffer is a packet length |
| repetitions | Number of packets in GPDFS |
References TRACE_MSG.
Referenced by zgpd_pkt_send_bidir().
| void zb_mac_sync_wait_tx_complete | ( | void | ) |
Blocks waiting for TX complete.
References TRACE_MSG.
| void zb_mac_set_tx_power | ( | zb_int8_t | power | ) |
Sets the TX power on the transmitter (in dBm).
| power | Expected power in dBm |
Referenced by gboss_app_init().
| void zb_mac_set_tx_channel | ( | zb_int8_t | channel | ) |
Sets RF channel to be used.
| channel | Channel number in range 11..26 according to 802.15.4 specification |
References TRACE_MSG.
Referenced by zgpd_pkt_send_bidir().
| zb_uint8_t zb_parse_mhr | ( | zb_mac_mhr_t * | mhr, |
| zb_uint8_t * | buf | ||
| ) |
Parses packed mhr header, fills mhr structure.
| mhr | Out pointer to mhr structure |
| ptr | Pointer to packed mhr header buffer |
References ZB_ADDR_16BIT_DEV_OR_BROADCAST, ZB_FCF_GET_DST_ADDRESSING_MODE, and ZB_LETOH16.