Developing with ZBOSS
|
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 1500 |
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 N_SECUR_MATERIAL 3 |
Number of secure materials to store
#define STACK_2007 0x01 |
2007 Stack Profile Id
#define STACK_NETWORK_SELECT 0x00 |
Network Selection Stack Profile Id
#define STACK_PRO 0x02 |
Pro Stack Profile Id
#define ZB_APS_DST_BINDING_TABLE_SIZE 32 |
APS: DST binding table size
#define ZB_APS_ENDPOINTS_IN_GROUP_TABLE 8 |
APS: max number of endpoints per group table entry
#define ZB_APS_GROUP_TABLE_SIZE 16 |
APS: man number of groups in the system
#define ZB_APS_GROUP_UP_Q_SIZE 8 |
APS: size of queue to be used to pass incoming group addresses packets up
#define ZB_APS_MAX_IN_FRAGMENT_TRANSMISSIONS 3 |
Number of fragmented packets which ZBOSS can receive in parallel
#define ZB_APS_MAX_PAYLOAD_SIZE (ZB_APS_MAX_BROADCAST_PAYLOAD_SIZE - 8) |
Maximum unicast APS payload size, if no APS encryption is provided
#define ZB_APS_SECURITY_TIME_OUT_PERIOD ZB_MILLISECONDS_TO_BEACON_INTERVAL(1700) |
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 is not defined by specification and should be defined in stack profile. For ZB_PRO_STACK this value equal to 1.7 seconds on 2.4 GHz.
See Zigbee specification revision 22 subclause 4.4.11
#define ZB_APS_SRC_BINDING_TABLE_SIZE 32 |
APS: SRC binding table size
#define ZB_BUF_ALLOC_ALIGN 4 |
Buffer tail portion alignment - 4.
Note: not sizeof(zb_size_t) because at 64-bit buld it is 8 which we don't want.
#define ZB_BUF_Q_SIZE 8 |
Size of queue for wait for free packet buffer
#define ZB_CCM_KEY_SIZE 16 |
SECUR: CCM key size. Hard-coded
#define ZB_CHANNEL_PAGES_NUM 1 |
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_DEFAULT_MAX_CHILDREN 32 |
Default value of nib.max_children - max number of children which can join to this device
See Zigbee Specification revision 22 section 3.5.2 NWK Information Base
#define ZB_DEFAULT_SCAN_DURATION 3 |
NWK: default energy/active scan duration
#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 dur ing 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_ED_FUNC |
ZB enddevice functionality
#define ZB_ED_FUNC |
ZB enddevice functionality
#define ZB_FORMATION |
Formation is supported by ZC or ZR in Distributed mode
#define ZB_IEEE_ADDR_TABLE_SIZE 101 |
NWK: size of the long-short address translation table
#define ZB_IO_BUF_SIZE 148 |
Size, in bytes, of the packet buffer
#define ZB_IOBUF_POOL_SIZE 26 |
Number of packet buffers. More buffers - more memory. Less buffers - risk to be blocked due to buffer absence.
#define ZB_JOIN_CLIENT |
Define joiner client functionality
#define ZB_LAZY_COUNTER_INTERVAL 0x400 |
Interval in which counter is stored
#define ZB_LITE_NO_JOIN_ZR_AS_ZED |
Do not allow ZR to join as ZED by default.
#define ZB_MAC_INDIRECT_POLL_EXPIRE_TMO ZB_MILLISECONDS_TO_BEACON_INTERVAL(7680) |
Maximum MAC packet waiting time to expire
#define ZB_MAX_EP_NUMBER 5 |
Maximum number of supported enpoints 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 (3*ZB_TIME_ONE_SECOND) |
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 (10*ZB_TIME_ONE_SECOND) |
APS: APS ACK wait time from Sleepy devices. After this timeout resend APS packet see Zigbee specification revision 22 section 2.2.7.1 APS Constants
#define ZB_N_APS_BINDTRANS_ARR_MAX_SIZE 5 |
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 5 |
APS: maximum number of tables with key-pair information
#define ZB_N_APS_MAX_FRAME_RETRIES 3 |
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 + 1) |
Maximum buffer index. Buffer indexing starts from one.
#define ZB_NEIGHBOR_TABLE_SIZE 32 |
NWK: size of the neighbor table
#define ZB_NO_NWK_MULTICAST |
Disable NWK multicast. Deprecated in R21. Use APS grops and NWK broadcast instead.
#define ZB_NVRAM_DATASET_MIGRATION |
Migration datasets when page overflow in NVRAM
#define ZB_NWK_LINK_STATUS_PERIOD 0xf |
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_MAX_PATH_LENGTH 5 |
Source routing path lenght, also called nwkMaxSourceRoute
#define ZB_NWK_MAX_SRC_ROUTES ZB_NEIGHBOR_TABLE_SIZE |
Source route table capacity
#define ZB_NWK_MESH_ROUTING |
NWK: if defined, implement mesh routing
#define ZB_NWK_REJOIN_FIRST_POLL_DELAY (ZB_TIME_ONE_SECOND / 2) |
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 3 |
Number of poll attempts during rejoin
#define ZB_NWK_REJOIN_TIMEOUT (ZB_TIME_ONE_SECOND * 5) |
Rejoin timeout length
#define ZB_NWK_ROUTER_AGE_LIMIT 3 |
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 |
NWK: If defined, enable routing functionality
#define ZB_NWK_ROUTING_FAILURE_ATTEMTS_NUM 1 |
Should expire in this number of attemptes if failure
#define ZB_NWK_ROUTING_FAILURE_EXPIRY_STEP (ZB_NWK_ROUTING_TABLE_EXPIRY / ZB_NWK_ROUTING_FAILURE_ATTEMTS_NUM) |
Calculate routing expiry step interval based on timer initiation value and number of attempts
#define ZB_NWK_SRC_ROUTE_TABLE_EXPIRY 60 |
Expiration time of the source route table (300 sec)
#define ZB_NWK_STOCHASTIC_ADDRESS_ASSIGN |
NWK: If defined, use stochastic address assignment (Zigbee PRO).
#define ZB_PANID_TABLE_SIZE 16 |
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(2) |
Default fast poll interval
#define ZB_PIM_DEFAULT_FAST_POLL_TIMEOUT (ZB_TIME_ONE_SECOND * 10) |
Default fast poll timeout
#define ZB_PIM_DEFAULT_LONG_POLL_INTERVAL (ZB_TIME_ONE_SECOND * 5) |
Default long poll interval
#define ZB_PIM_DEFAULT_MAX_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(3000) |
Maximal possible turbo poll interval
#define ZB_PIM_DEFAULT_MIN_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(100) |
Minimal possible turbo poll interval
#define ZB_PIM_DEFAULT_TURBO_POLL_INTERVAL ZB_MILLISECONDS_TO_BEACON_INTERVAL(100) |
Default turbo poll interval
#define ZB_PIM_TURBO_POLL_LEAVE_TIMEOUT (ZB_TIME_ONE_SECOND / 3) |
Timeout for turbo poll
#define ZB_PIM_TURBO_POLL_PACKETS_TIMEOUT (ZB_TIME_ONE_SECOND * 15) |
Timeout for turbo poll
#define ZB_PRO_STACK |
This define switches PRO version on or off.
#define ZB_ROUTER_SECURITY |
Defines router security
#define ZB_SCHEDULER_Q_SIZE 16 |
Scheduler callbacks queue size. Usually not need to change it.
#define ZB_SECUR_N_SECUR_MATERIAL 3 |
Define number of network keys with the frame counter
#define ZB_SECURITY_LEVEL 5 |
SECUR: security level. Now fixed to be 5
#define ZB_STACK_SPEC_VERSION 22 |
Specification version of the specification
#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_STORE_ADDR_MAP |
Save address map in the NVRAM
#define ZB_STORE_COUNTERS |
Storing NWK security counter in NVRAM
#define ZB_STORE_NEIGHBOR_TBL |
Save neighbor table in the NVRAM
#define ZB_TIME_ED_IDLE ZB_MILLISECONDS_TO_BEACON_INTERVAL(7500) |
End device idle time-out
#define ZB_TIMER_32 |
Use 32-bit timer
#define ZB_USE_NVRAM |
If defined, 2007 stack profile is implemented If defined, NVRAM is used Create *.nvram file
To be used near always to prevent flash damage (flash can do ~1000 rewrites only)
For certification test need comment. Else change Assignment to Rejoin for second and last runs
#define ZB_WATCHDOG_SCHED_QUANT (20 * ZB_TIME_ONE_SECOND) |
Check watchdods 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_NWK_SCAN_ATTEMPTS 5 |
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 reviaion 22 : Config_NWK_Scan_Attempts default value is 5.
#define ZB_ZDO_NWK_TIME_BTWN_SCANS 30 |
Integer value representing the time duration (in milliseconds)
#define ZB_ZDO_PARENT_LINK_FAILURE_CNT 12 |
Number of times device failes to send packet to the parent before rejoin
#define ZB_ZDO_PENDING_LEAVE_SIZE 4 |
Number of pending Mgmt_Leave requests allowed