Component: Zigbee (ESP32-C6/H2) (ESP32-C6-H2) (Wireless)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Wireless


Zigbee (ESP32-C6/H2) component

Zigbee component project for ESP32-C6 and ESP32-H2 devices.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

BytesAvailable

Fc9-comp-macro.png BytesAvailable
Returns number of bytes waiting in RX buffer. Applicable to: Coordinator, Router, End Device. 
Fc9-u16-icon.png - UINT Return


GetChannel

Fc9-comp-macro.png GetChannel
Returns currently active Zigbee channel. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Return


GetPANID

Fc9-comp-macro.png GetPANID
Returns current PAN ID. Applicable to: Coordinator, Router, End Device. 
Fc9-u16-icon.png - UINT Return


GetShortAddress

Fc9-comp-macro.png GetShortAddress
Returns this node short network address. Applicable to: Coordinator, Router, End Device. 
Fc9-u16-icon.png - UINT Return


InitNetwork

Fc9-comp-macro.png InitNetwork
Initialises Zigbee stack, applies default routing from properties, and optionally starts commissioning. Applicable to: Coordinator, Router, End Device. Call once at startup before send/receive macros. 
Fc9-void-icon.png - VOID Return


IsJoined

Fc9-comp-macro.png IsJoined
Returns 1 when node is joined/formed onto a Zigbee network, else 0. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Return


IsNetworkReady

Fc9-comp-macro.png IsNetworkReady
Returns 1 when Zigbee stack/network is ready for data transfer, else 0. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Return


ReceiveArray

Fc9-comp-macro.png ReceiveArray
Reads available data into an array buffer. Applicable to: Coordinator, Router, End Device. Returns number of bytes copied. 
Fc9-string-icon.png - STRING Buffer
Output byte array. 
Fc9-u16-icon.png - UINT MaxLen
Maximum bytes to copy into Buffer. 
Fc9-u16-icon.png - UINT Return


ReceiveByte

Fc9-comp-macro.png ReceiveByte
Reads one byte from RX buffer. Applicable to: Coordinator, Router, End Device. Returns 0-255 for data, or 256 when no data is available. 
Fc9-u16-icon.png - UINT Return


ReceiveString

Fc9-comp-macro.png ReceiveString
Reads available data and returns a null-terminated string. Applicable to: Coordinator, Router, End Device. Returns number of data bytes copied (excluding terminator). 
Fc9-string-icon.png - STRING Buffer
Output string buffer. 
Fc9-u16-icon.png - UINT MaxLen
Buffer length including null terminator. 
Fc9-u16-icon.png - UINT Return


SendArray

Fc9-comp-macro.png SendArray
Sends an array of bytes through Zigbee transport. Applicable to: Coordinator, Router, End Device. Uses current TX mode/address/endpoint/cluster settings. 
Fc9-string-icon.png - STRING Data
Array containing bytes to send. 
Fc9-u16-icon.png - UINT Length
Number of bytes to send from Data. 
Fc9-u16-icon.png - UINT Return


SendByte

Fc9-comp-macro.png SendByte
Sends one byte using current TX routing settings. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Data
Byte to send. 
Fc9-u8-icon.png - BYTE Return


SetPermitJoin

Fc9-comp-macro.png SetPermitJoin
Opens join window for a number of seconds. Primary use: Coordinator (and Router if your network design allows it). Not usually meaningful for End Device. 
Fc9-u8-icon.png - BYTE Seconds
Permit join timeout in seconds. 0 closes joining. 
Fc9-void-icon.png - VOID Return


SetRXRouting

Fc9-comp-macro.png SetRXRouting
Dynamically updates RX endpoint/cluster filters at runtime. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Endpoint
Accepted receive endpoint. 
Fc9-u16-icon.png - UINT Cluster
Accepted receive cluster. 
Fc9-void-icon.png - VOID Return


SetTXRouting

Fc9-comp-macro.png SetTXRouting
Dynamically updates TX mode/address/endpoint/cluster at runtime. Applicable to: Coordinator, Router, End Device. 
Fc9-u8-icon.png - BYTE Mode
0 unicast, 1 groupcast, 2 broadcast. 
Fc9-u16-icon.png - UINT ShortAddress
Destination short/group address. 
Fc9-u8-icon.png - BYTE Endpoint
Destination endpoint. 
Fc9-u16-icon.png - UINT Cluster
Destination cluster. 
Fc9-void-icon.png - VOID Return


SetZigbeeRole

Fc9-comp-macro.png SetZigbeeRole
Dynamically changes runtime Zigbee role. Use for fallback logic (for example Router then Coordinator). If ApplyNow=1, role config is applied immediately and commissioning is started. 
Fc9-u8-icon.png - BYTE Role
0 coordinator, 1 router, 2 end device. 
Fc9-bool-icon.png - BOOL ApplyNow
If true, immediately applies config and starts commissioning. 
Fc9-void-icon.png - VOID Return


StartCommissioning

Fc9-comp-macro.png StartCommissioning
Starts commissioning based on current runtime role. Coordinator: starts network formation. Router/End Device: starts network steering (join). Call after InitNetwork if Auto Start is disabled. 
Fc9-void-icon.png - VOID Return


TaskPoll

Fc9-comp-macro.png TaskPoll
Runs Zigbee stack polling. Applicable to: Coordinator, Router, End Device. Call regularly in your main loop (or timer) so Zigbee events are processed. 
Fc9-u32-icon.png - ULONG TimerID
System timer identifier 
Fc9-u32-icon.png - ULONG Return


zigbee_config

Fc9-comp-macro.png zigbee_config
Low-level runtime Zigbee role/endpoint/channel config. Applicable to: all roles. Usually called by InitNetwork and SetZigbeeRole. 
Fc9-u8-icon.png - BYTE role
 
Fc9-u8-icon.png - BYTE endpoint
 
Fc9-u32-icon.png - ULONG channel_mask
 
Fc9-void-icon.png - VOID Return


zigbee_init

Fc9-comp-macro.png zigbee_init
Low-level Zigbee stack initialise call. Applicable to: all roles. Usually called by InitNetwork. 
Fc9-void-icon.png - VOID Return


zigbee_transfer_config_rx

Fc9-comp-macro.png zigbee_transfer_config_rx
Low-level internal config for TX destination and RX filters. Applicable to: Coordinator, Router, End Device. Usually called by InitNetwork / SetTXRouting / SetRXRouting. 
Fc9-u8-icon.png - BYTE rx_endpoint
Accepted incoming endpoint. 
Fc9-u16-icon.png - UINT rx_cluster
Accepted incoming cluster id. 
Fc9-void-icon.png - VOID Return


zigbee_transfer_config_tx

Fc9-comp-macro.png zigbee_transfer_config_tx
Low-level internal config for TX destination. Applicable to: Coordinator, Router, End Device. Usually called by InitNetwork / SetTXRouting / SetRXRouting. 
Fc9-u8-icon.png - BYTE tx_mode
0 unicast, 1 groupcast, 2 broadcast. 
Fc9-u16-icon.png - UINT tx_short_addr
Destination short address (or group id for groupcast). 
Fc9-u8-icon.png - BYTE tx_endpoint
Destination endpoint. 
Fc9-u16-icon.png - UINT tx_cluster
Destination cluster id. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Zigbee Role
Select how this node behaves on the network. Coordinator: creates and manages the network. Router: joins a network and can forward traffic. End Device: joins a network as a leaf node. Suggested start: Router for joining existing networks, Coordinator if creating a new network. 
Fc9-type-21-icon.png Endpoint
Local application endpoint for this component. Think of this as the local app port number. Suggested value: 10 (keep all nodes consistent unless you need multiple logical apps). 
Fc9-type-7-icon.png Auto Start Commissioning
If enabled, InitNetwork will immediately start commissioning. Enable for simple projects. Disable if you want manual control via StartCommissioning macro. 
Fc9-conn-icon.png Default Routing
Fc9-type-16-icon.png TX Address Mode
How outgoing data is addressed. Unicast: send to one node. Groupcast: send to nodes in a group. Broadcast: send widely. Suggested start: Unicast. 
Fc9-type-21-icon.png TX Short Address
Destination short address (or group id if using Groupcast), in decimal. For Coordinator, this is often 0. Suggested start for unicast testing: 0 (coordinator) or the target node short address. 
Fc9-type-21-icon.png TX Endpoint
Destination endpoint on the remote node. Must match the receiver app endpoint. Suggested value: 10. 
Fc9-type-21-icon.png TX Cluster
Destination cluster id in decimal. Both sender and receiver should use the same cluster. Suggested custom cluster: 64512 (0xFC00). 
Fc9-type-21-icon.png RX Endpoint
Only payloads for this endpoint are accepted into the RX buffer. Suggested value: 10 (match your local endpoint). 
Fc9-type-21-icon.png RX Cluster
Only payloads for this cluster are accepted into the RX buffer. Suggested value: 64512 (0xFC00), matching TX cluster. 
Fc9-conn-icon.png Channels
Fc9-type-21-icon.png Channel Mask (Auto)
Read-only channel mask calculated from the channel checkboxes. You do not need to edit this directly. Common full-range value (11-26 enabled): 134215680. 
Fc9-type-7-icon.png Channel 11
Enable channel 11. Suggested: leave enabled unless avoiding local interference. 
Fc9-type-7-icon.png Channel 12
Enable channel 12. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 13
Enable channel 13. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 14
Enable channel 14. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 15
Enable channel 15. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 16
Enable channel 16. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 17
Enable channel 17. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 18
Enable channel 18. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 19
Enable channel 19. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 20
Enable channel 20. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 21
Enable channel 21. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 22
Enable channel 22. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 23
Enable channel 23. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 24
Enable channel 24. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 25
Enable channel 25. Suggested: leave enabled for general discovery. 
Fc9-type-7-icon.png Channel 26
Enable channel 26. Suggested: leave enabled for general discovery. 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Zigbee_ESP32.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Zigbee_ESP32.fcfx