5.2.10. MAC

This section provides the MAC layer related APIs and defines of ESP Zigbee Core.

5.2.10.1. API Reference

5.2.10.1.1. Header File

5.2.10.1.2. Functions

ezb_err_t ezb_mac_set_transaction_persistence_time(uint32_t us)

Set the maximum MAC transaction persistence time.

Parameters:

us -- Maximum persistence time in microseconds, its value SHALL be within the range [0, 0x3BFFC400].

Returns:

  • EZB_ERR_NONE: Operation successful

  • error code: Operation failed

uint32_t ezb_mac_get_transaction_persistence_time(void)

Get the maximum MAC transaction persistence time.

Returns:

The maximum persistence time in microseconds.

ezb_err_t ezb_mac_set_csma_ca_params(const ezb_mac_csma_ca_params_t *params)

Set the CSMA-CA parameters for the MAC layer.

Parameters:

params -- [in] The CSMA-CA parameters.

Returns:

  • EZB_ERR_NONE: Success.

  • EZB_ERR_INV_ARG: The params are invalid or with invalid values.

ezb_err_t ezb_mac_get_csma_ca_params(ezb_mac_csma_ca_params_t *params)

Get the CSMA-CA parameters for the MAC layer.

Parameters:

params -- [out] The CSMA-CA parameters will be stored in this pointer.

Returns:

  • EZB_ERR_NONE: Success.

5.2.10.1.3. Structures

struct ezb_mac_csma_ca_params_s

CSMA-CA parameters.

Public Members

uint8_t min_be

The minimum value of the backoff exponent, BE, in the CSMA-CA algorithm.

uint8_t max_be

The maximum value of the backoff exponent, BE, in the CSMA-CA algorithm.

uint8_t max_backoffs

The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.

5.2.10.1.4. Macros

ESP_ZIGBEE_MAC_H

5.2.10.1.5. Type Definitions

typedef struct ezb_mac_csma_ca_params_s ezb_mac_csma_ca_params_t

CSMA-CA parameters.