Developing with ZBOSS for Zigbee
|
Most of the mentioned defines can be used only as an additional source of information about ZBOSS Stack.
Value of some defines can be changed in the application, see detailed instruction in Configurable ZBOSS memory sizes
#define APS_IN_FRAG_MAX_BUF_SIZE 1500U |
Maximum buffer size for APS fragmentation. Bigger buffer will not be created for APS fragmentation
#define MAC_FRAME_VERSION MAC_FRAME_IEEE_802_15_4_2003 |
Default value for mac frame version subfield
#define STACK_2007 0x01U |
2007 Stack Profile ID
#define STACK_NETWORK_SELECT 0x00U |
Network Selection Stack Profile ID
#define STACK_PRO 0x02U |
Pro Stack Profile ID
#define ZB_APS_DST_BINDING_TABLE_SIZE 32U |
APS: DST binding table size
#define ZB_APS_ENDPOINTS_IN_GROUP_TABLE 8U |
APS: max number of endpoints per group table entry
#define ZB_APS_GROUP_TABLE_SIZE 16U |
APS: max number of groups in the system
#define ZB_APS_GROUP_UP_Q_SIZE 8U |
APS: size of queue to be used to pass incoming group addresses packets up
#define ZB_APS_MAX_IN_FRAGMENT_TRANSMISSIONS 3U |
Number of fragmented packets which ZBOSS can receive in parallel
#define ZB_APS_MAX_PAYLOAD_SIZE ZB_APS_GUARANTEED_PAYLOAD_SIZE_WO_SECURITY |
Maximum unicast APS payload size, if no APS encryption is provided
#define ZB_APS_SECURITY_TIME_OUT_PERIOD_DEFAULT 10000U |
If the joining device does not receive any of the keys within apsSecurityTimeOutPeriod, of receiving the NLME-JOIN. confirm primitive, it shall reset
apsSecurityTimeOutPeriod value for revision 23 equal to 10 seconds (See Zigbee specification subclause 4.4.12)
#define ZB_APS_SRC_BINDING_TABLE_SIZE 32U |
APS: SRC binding table size
#define ZB_BUF_ALLOC_ALIGN (4U) |
Buffer tail portion alignment - 4.
Note: not sizeof(zb_size_t) because at 64-bit build it is 8 which we don't want.
#define ZB_BUF_Q_SIZE 8U |
Size of queue for wait for free packet buffer
#define ZB_CCM_KEY_CRC_SIZE 2U |
SECUR: CCM key CRC size
#define ZB_CCM_KEY_SIZE 16U |
SECUR: CCM key size. Hard-coded
#define ZB_CHANNEL_PAGES_MAX_NUM 11u |
Maximum channel pages number according to the Zigbee revision 23 specification
#define ZB_CHANNEL_PAGES_NUM 1u |
Size of channel list structure
#define ZB_DEFAULT_APS_CHANNEL_MASK (ZB_TRANSCEIVER_ALL_CHANNELS_MASK) |
Zigbee channel selection. Default value of ZB_AIB().aps_channel_mask Channels to be used for discovery and join. If a single channel is selected, there is no need to perform energy scan.
#define ZB_DISTRIBUTED_GLOBAL_KEY {0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf}; |
In ZLL specification this is ZLL Certification pre-installed link key - see 8.7.2 Transfer ring the network key during classical Zigbee commissioning.
The distributed security global link key is used to join a distributed security network. This link key is provided to a company as a result of a successful certification of a product. For testing, this key SHALL have this default value.
See Base Device Behaviour Specification subclause 6.3.2 Distributed security global link key
#define ZB_GPD_MIN_RX_WINDOW_MS 50U |
gpdMinRxWindow The gpdMinRxWindow is minimal duration of the reception window of an Rx-capable GPD. It has the value of 0.576 ms that corresponds to the Channel Configuration GPDF of 18B. GPD vendors shall implement reception window duration that corresponds to the actual GPD frame size to be received by this GPD, which may never be shorter than gpdMinRxWindow.
A.1.6.3.2 gpdMinRxWindow
#define ZB_IEEE_ADDR_TABLE_SIZE 101U |
NWK: size of the long-short address translation table
#define ZB_IO_BUF_SIZE 152U |
Size, in bytes, of the packet buffer
#define ZB_IOBUF_POOL_SIZE 26U |
Number of packet buffers. More buffers - more memory. Less buffers - risk to be blocked due to buffer absence.
#define ZB_MAC_INDIRECT_POLL_EXPIRE_TMO ZB_MILLISECONDS_TO_BEACON_INTERVAL(7680U) |
Maximum MAC packet waiting time to expire
#define ZB_MAX_EP_NUMBER 5U |
Maximum number of supported endpoints per device
#define ZB_N_APS_ACK_WAIT_DURATION | ( | _rx_on_when_idle | ) |
APS: Get APS ACK wait time for the device depending on its receiver on when idle
#define ZB_N_APS_ACK_WAIT_DURATION_FROM_NON_SLEEPY (ZB_MILLISECONDS_TO_BEACON_INTERVAL(1600)) |
APS: APS ACK wait time from Non Sleepy devices. After this timeout resend APS packet
See Zigbee specification revision 22 section 2.2.7.1 APS Constants
#define ZB_N_APS_ACK_WAIT_DURATION_FROM_SLEEPY ZB_N_APS_ACK_WAIT_DURATION_FROM_NON_SLEEPY |
APS: APS ACK wait time from Sleepy devices. After this timeout resend APS packet see Zigbee specification revision 23 section 2.2.7.1 APS Constants
#define ZB_N_APS_BINDTRANS_ARR_MAX_SIZE 5U |
APS: maximum number of tables with information from a binding table to be sent to the devices
#define ZB_N_APS_BINDTRANS_DST_INDEX_ARR_MAX_SIZE ZB_APS_DST_BINDING_TABLE_SIZE |
APS: maximum number of elements in array with index from dst array in bind table
#define ZB_N_APS_KEY_PAIR_ARR_MAX_SIZE 5U |
APS: maximum number of tables with key-pair information
#define ZB_N_APS_MAX_FRAME_RETRIES 3U |
APS retransmissions APS maximum of apscMaxFrameRetries times
See Zigbee specification revision 22 section 2.2.7.1 APS Constants
#define ZB_N_BUF_IDS (ZB_IOBUF_POOL_SIZE + 1U) |
Maximum buffer index. Buffer indexing starts from one.
#define ZB_NEIGHBOR_TABLE_SIZE 32U |
NWK: size of the neighbor table
#define ZB_NWK_LINK_STATUS_PERIOD 0xfU |
The time in seconds between link status command frames.
Correspond to nwkLinkStatusPeriod in Zigbee Specification revision 22 subclause 3.5.1 NWK Constants The value defined by specification.
#define ZB_NWK_REJOIN_FIRST_POLL_DELAY (ZB_TIME_ONE_SECOND / 2U) |
The rejoining sleeping end-device shall not poll before the response timeout (500ms), such that the parent has enough time to process the rejoin request and put a response frame in its indirect queue (same as for association response). Depending on the implementation, once a rejoining device has performed an active scan and selected a new parent router, it sends a rejoin request (and at that time considers this router to be its new parent, otherwise it cannot accept the rejoin response), and polls for a response 500ms later.
#define ZB_NWK_REJOIN_POLL_ATTEMPTS 3U |
Number of poll attempts during rejoin
#define ZB_NWK_REJOIN_TIMEOUT (ZB_TIME_ONE_SECOND * 5U) |
Rejoin timeout length
#define ZB_NWK_ROUTER_AGE_LIMIT 3U |
The number of missed link status command frames before resetting the link costs to zero.
Correspond to nwkRouterAgeLimit in Zigbee Specification revision 22 subclause 3.5.1 NWK Constants The value defined by specification.
#define ZB_NWK_ROUTING_FAILURE_ATTEMPTS_NUM 1U |
Should expire in this number of attempts if failure
#define ZB_NWK_ROUTING_FAILURE_EXPIRY_STEP (ZB_NWK_ROUTING_TABLE_EXPIRY / ZB_NWK_ROUTING_FAILURE_ATTEMPTS_NUM) |
Calculate routing expiry step interval based on timer initiation value and number of attempts
#define ZB_PANID_TABLE_SIZE 16U |
NWK: size of the long-short Pan ID translation table
Must be <= (packet buffer size - sizeof(*discovery_confirm)) / sizeof(*network_descriptor)
That value limits number of Pan IDs visible for device during active scan.
#define ZB_PIM_DEFAULT_FAST_POLL_INTERVAL ZB_QUARTERECONDS_TO_BEACON_INTERVAL(2U) |
Default fast poll interval
#define ZB_PIM_DEFAULT_FAST_POLL_TIMEOUT (ZB_TIME_ONE_SECOND * 10U) |
Default fast poll timeout
#define ZB_PIM_DEFAULT_LONG_POLL_INTERVAL (ZB_TIME_ONE_SECOND * 5U) |
Default long poll interval
#define ZB_PIM_DEFAULT_LONG_POLL_INTERVAL_IN_QS 0x0014U |
Default long poll interval in quarterseconds
#define ZB_PIM_DEFAULT_MAX_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(3000U) |
Maximal possible turbo poll interval
#define ZB_PIM_DEFAULT_MIN_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(100U) |
Minimal possible turbo poll interval
#define ZB_PIM_DEFAULT_SHORT_POLL_INTERVAL_IN_QS 0x02U |
Default short poll interval in quarterseconds
#define ZB_PIM_DEFAULT_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(100U) |
Default turbo poll interval
#define ZB_PIM_MAXIMUM_LONG_POLL_INTERVAL_IN_QS 0x6e0000U |
Maximum long poll interval in quarterseconds
#define ZB_PIM_MAXIMUM_SHORT_POLL_INTERVAL_IN_QS 0xffffU |
Maximum short poll interval in quarterseconds
#define ZB_PIM_MINIMUM_LONG_POLL_INTERVAL_IN_QS 0x04U |
Minimum long poll interval in quarterseconds
#define ZB_PIM_MINIMUM_SHORT_POLL_INTERVAL_IN_QS 0x01U |
Minimum short poll interval in quarterseconds
#define ZB_PIM_TURBO_POLL_LEAVE_TIMEOUT (ZB_TIME_ONE_SECOND / 3U) |
Timeout for turbo poll
#define ZB_PIM_TURBO_POLL_MAX_RETRIES (3U) |
Maximal number of turbo poll retries when data receiving failed
#define ZB_PIM_TURBO_POLL_PACKETS_TIMEOUT (ZB_TIME_ONE_SECOND * 15U) |
Timeout for turbo poll
#define ZB_PRO_STACK |
This define switches PRO version on or off.
#define ZB_SCHEDULER_Q_SIZE 16U |
Scheduler callbacks queue size. Usually not need to change it.
#define ZB_SECUR_N_SECUR_MATERIAL 3U |
Define number of network keys with the frame counter
#define ZB_SECURITY_LEVEL 5U |
SECUR: security level. Now fixed to be 5
#define ZB_STACK_SPEC_VERSION 23U |
Specification version of the specification
#define ZB_STANDARD_ECDHE_KEY {0x5A, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6C, 0x6C, 0x69, 0x61, 0x6E, 0x63, 0x65, 0x31, 0x38 }; |
ZigbeeAlliance18 key
#define ZB_STANDARD_TC_KEY {0x5A, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6C, 0x6C, 0x69, 0x61, 0x6E, 0x63, 0x65, 0x30, 0x39 }; |
Define a default global trust center link key
#define ZB_WATCHDOG_SCHED_QUANT (20U * ZB_TIME_ONE_SECOND) |
Check watchdogs once per 20 sec. The hardware watchdog timer is set to 30 seconds, it should be initiated even if there is no job for it
#define ZB_ZDO_KEY_NEGOTIATIONS_NUM 1U |
ZDO: Maximum number of parallel Key Negotiation procedures on the TC side
#define ZB_ZDO_NWK_SCAN_ATTEMPTS 5U |
Integer value representing the number of scan attempts to make before the NWK layer decides which Zigbee coordinator or router to associate with.
See Zigbee Specification revision 22 section 2.5.51 Configuration Attribute Definitions
Table 2-154 of Zigbee Specification revision 22 : Config_NWK_Scan_Attempts default value is 5.
#define ZB_ZDO_NWK_TIME_BTWN_SCANS 30U |
Integer value representing the time duration (in milliseconds)
#define ZB_ZDO_PARENT_LINK_FAILURE_CNT 12U |
Number of times device fails to send packet to the parent before rejoin
#define ZB_ZDO_PENDING_LEAVE_SIZE 4U |
Number of pending Mgmt_Leave requests allowed
#define ZB_ZGP_APP_DESCR_REPORT_DATA_SIZE 32U |
The maximum report descriptor length that GPD can send in the Application Description.
#define ZB_ZGP_APP_DESCR_REPORTS_NUM 3U |
The maximum number of reports that GPD can send in the Application Description.
#define ZB_ZGP_CHANNEL_REQ_ON_TX_CH_TIMEOUT (5U * ZB_TIME_ONE_SECOND) |
Timeout of Zigbee Green Power Device channel transition request
#define ZB_ZGP_DEFAULT_COMMISSIONING_EXIT_MODE ZGP_COMMISSIONING_EXIT_MODE_ON_PAIRING_SUCCESS |
Default commissioning exit mode. According to spec should be "On pairing success" (0x01)
#define ZB_ZGP_DUPLICATE_TIMEOUT (1U * ZB_TIME_ONE_SECOND) |
zgpDuplicateTimeout value
The time the EPP of the ZGPS and ZGPP keeps the information on the received GPDF with random sequence number, in order to filter out duplicates.
The default value of 2 seconds can be modified by the application profile
#define ZB_ZGP_MAX_LW_UNICAST_ADDR_PER_GPD 2U |
Maximum number of lightweight unicast address per Green Power device.
#define ZB_ZGP_MAX_PAIRED_CONF_CLUSTERS 2U |
Maximum number of paired configuration clusters
#define ZB_ZGP_MAX_PAIRED_CONF_GPD_COMMANDS 6U |
Maximum number of paired Green Power devices commands
#define ZB_ZGP_MAX_PAIRED_ENDPOINTS 2U |
Maximum number of paired endpoints
#define ZB_ZGP_MAX_SINK_GROUP_PER_GPD 2U |
Maximum number of SINK groups per Green Power device
#define ZB_ZGP_TIMEOUT_BEFORE_FORCE_CANCEL 0U |
If commissioning on the last stage, then it determines time to wait until commissioning is complete. If commissioning is not completed during this time, then commissioning cancel procedure is started.
Timeout before completing commissioning if the last stage is successful or, otherwise, start the cancel procedure.
#define ZB_ZGPD_DEF_MANUFACTURER_ID 0x10d0U |
Default Zigbee Green Power device manufacturer ID
#define ZB_ZGPD_FIRST_CH 11U |
First Zigbee green power device channel value
#define ZB_ZGPD_LAST_CH 26U |
Last Zigbee green power device channel value
#define ZB_ZGPD_MANUF_ID_UNSPEC 0xFFFFU |
Unspecified Zigbee Green Power device manufacturer ID