<root>
<document scada='0' projtype='1' schema='103' license='1,82702381,95CJQR' title='' description='' fcversion='720897' target='ESP.ESP32.Lolin32_Lite' >
	<config data='' clkspd='19660800' simspd='1' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='1' head='' body='#include &quot;D:\\OneDrive - MATRIX TECHNOLOGY SOLUTIONS\\FC11\\CAL\\ESP\\ESP_CAL_ZIGBEE.c&quot;' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='9' />
			<data name='CalculatedCommsDelay' value='9' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='1' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='62e79dd6-6f7f-45da-bdc6-b9ba6f2d2af4' vstate='40' vmin='0' vmaj='1' srcleaf='Zigbee_ESP32.fcfx' visiblename='Zigbee (ESP32-C6/H2)' description='Zigbee component project for ESP32-C6 and ESP32-H2 devices.
' category='Wireless' category2='' category3='' bIs2dOnly='1' bIs3dOnly='0' bIsWysiwyg='0' catenable='1' author='Matrix TSL' manuname='Espressif' manucode='ESP32-C6-H2' sysinfo='1052955' keywords='zigbee|esp32|esp32-c6|esp32-h2' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='..\..\Icons\Components\Zigbee_icon.png' />
		<component class_type='root' codename='Zigbee_ESP32' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='Zigbee Role' target='zig_mode' typeid='16' hidden='0' locked='0' info='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.' filter='000Coordinator
001Router
002End Device' />
				<property name='Endpoint' target='esp_endpoint' typeid='21' hidden='0' locked='0' info='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).' />
				<property name='Auto Start Commissioning' target='esp_autostart' typeid='7' hidden='0' locked='0' info='If enabled, InitNetwork will immediately start commissioning.
Enable for simple projects.
Disable if you want manual control via StartCommissioning macro.' />
				<property name='Default Routing' hidden='0' >
					<property name='TX Address Mode' target='tx_mode' typeid='16' hidden='0' locked='0' info='How outgoing data is addressed.
Unicast: send to one node.
Groupcast: send to nodes in a group.
Broadcast: send widely.
Suggested start: Unicast.' filter='000Unicast (single node)
001Groupcast (group)
002Broadcast (many nodes)' />
					<property name='TX Short Address' target='tx_short_addr' typeid='21' hidden='0' locked='0' info='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.' />
					<property name='TX Endpoint' target='tx_endpoint' typeid='21' hidden='0' locked='0' info='Destination endpoint on the remote node.
Must match the receiver app endpoint.
Suggested value: 10.' />
					<property name='TX Cluster' target='tx_cluster' typeid='21' hidden='0' locked='0' info='Destination cluster id in decimal.
Both sender and receiver should use the same cluster.
Suggested custom cluster: 64512 (0xFC00).' />
					<property name='RX Endpoint' target='rx_endpoint' typeid='21' hidden='0' locked='0' info='Only payloads for this endpoint are accepted into the RX buffer.
Suggested value: 10 (match your local endpoint).' />
					<property name='RX Cluster' target='rx_cluster' typeid='21' hidden='0' locked='0' info='Only payloads for this cluster are accepted into the RX buffer.
Suggested value: 64512 (0xFC00), matching TX cluster.' />
				</property>
				<property name='Channels' hidden='0' >
					<property name='Channel Mask (Auto)' target='esp_channel_mask' typeid='21' hidden='0' locked='1' info='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.' />
					<property name='Channel 11' target='ch11' typeid='7' hidden='0' locked='0' info='Enable channel 11.
Suggested: leave enabled unless avoiding local interference.' />
					<property name='Channel 12' target='ch12' typeid='7' hidden='0' locked='0' info='Enable channel 12.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 13' target='ch13' typeid='7' hidden='0' locked='0' info='Enable channel 13.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 14' target='ch14' typeid='7' hidden='0' locked='0' info='Enable channel 14.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 15' target='ch15' typeid='7' hidden='0' locked='0' info='Enable channel 15.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 16' target='ch16' typeid='7' hidden='0' locked='0' info='Enable channel 16.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 17' target='ch17' typeid='7' hidden='0' locked='0' info='Enable channel 17.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 18' target='ch18' typeid='7' hidden='0' locked='0' info='Enable channel 18.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 19' target='ch19' typeid='7' hidden='0' locked='0' info='Enable channel 19.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 20' target='ch20' typeid='7' hidden='0' locked='0' info='Enable channel 20.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 21' target='ch21' typeid='7' hidden='0' locked='0' info='Enable channel 21.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 22' target='ch22' typeid='7' hidden='0' locked='0' info='Enable channel 22.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 23' target='ch23' typeid='7' hidden='0' locked='0' info='Enable channel 23.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 24' target='ch24' typeid='7' hidden='0' locked='0' info='Enable channel 24.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 25' target='ch25' typeid='7' hidden='0' locked='0' info='Enable channel 25.
Suggested: leave enabled for general discovery.' />
					<property name='Channel 26' target='ch26' typeid='7' hidden='0' locked='0' info='Enable channel 26.
Suggested: leave enabled for general discovery.' />
				</property>
			</properties>
			<values >
				<value target='zig_mode' data='000' />
				<value target='esp_endpoint' data='10' />
				<value target='esp_autostart' data='1' />
				<value target='tx_mode' data='000' />
				<value target='tx_short_addr' data='0' />
				<value target='tx_endpoint' data='10' />
				<value target='tx_cluster' data='64512' />
				<value target='rx_endpoint' data='10' />
				<value target='rx_cluster' data='64512' />
				<value target='esp_channel_mask' data='134215680' />
				<value target='ch11' data='1' />
				<value target='ch12' data='1' />
				<value target='ch13' data='1' />
				<value target='ch14' data='1' />
				<value target='ch15' data='1' />
				<value target='ch16' data='1' />
				<value target='ch17' data='1' />
				<value target='ch18' data='1' />
				<value target='ch19' data='1' />
				<value target='ch20' data='1' />
				<value target='ch21' data='1' />
				<value target='ch22' data='1' />
				<value target='ch23' data='1' />
				<value target='ch24' data='1' />
				<value target='ch25' data='1' />
				<value target='ch26' data='1' />
			</values>
			<events >
				<event class='Compile' event='Start' target='Ev_Property' />
				<event class='Components' event='Initialise' target='Ev_Initialise' />
				<event class='Compile' event='AddHeader' target='Ev_AddHeader' />
				<event class='Components' event='Renamed' target='Ev_Renamed' />
				<event class='Components' event='Property' target='Ev_Property' />
			</events>
			<apis >
				<api name='TaskPoll' alt='fc_esp32_zigbee_task_poll' type='5' proto='1' />
				<api name='ReceiveByte' alt='fc_esp32_zigbee_receive_byte' type='5' proto='0' />
				<api name='ReceiveArray' alt='ReceiveArray' type='1' proto='1' />
				<api name='SendArray' alt='SendArray' type='1' proto='1' />
				<api name='SetPermitJoin' alt='fc_esp32_zigbee_permit_join' type='5' proto='0' />
				<api name='SetRXRouting' alt='fc_esp32_zigbee_transfer_config_rx' type='5' proto='0' />
				<api name='InitNetwork' alt='InitNetwork' type='1' proto='1' />
				<api name='SendByte' alt='fc_esp32_zigbee_send_byte' type='5' proto='0' />
				<api name='zigbee_transfer_config_rx' alt='fc_esp32_zigbee_transfer_config_rx' type='4' proto='0' />
				<api name='GetChannel' alt='fc_esp32_zigbee_get_channel' type='5' proto='0' />
				<api name='SetTXRouting' alt='fc_esp32_zigbee_transfer_config_tx' type='5' proto='0' />
				<api name='BytesAvailable' alt='fc_esp32_zigbee_bytes_available' type='5' proto='0' />
				<api name='IsJoined' alt='fc_esp32_zigbee_is_joined' type='5' proto='0' />
				<api name='GetPANID' alt='fc_esp32_zigbee_get_pan_id' type='5' proto='0' />
				<api name='SetZigbeeRole' alt='SetZigbeeRole' type='1' proto='1' />
				<api name='zigbee_transfer_config_tx' alt='fc_esp32_zigbee_transfer_config_tx' type='4' proto='0' />
				<api name='zigbee_init' alt='fc_esp32_zigbee_init' type='4' proto='0' />
				<api name='StartCommissioning' alt='fc_esp32_zigbee_start_commissioning' type='5' proto='0' />
				<api name='zigbee_config' alt='fc_esp32_zigbee_config' type='4' proto='0' />
				<api name='IsNetworkReady' alt='fc_esp32_zigbee_is_ready' type='5' proto='0' />
				<api name='GetShortAddress' alt='fc_esp32_zigbee_get_short_address' type='5' proto='0' />
				<api name='ReceiveString' alt='ReceiveString' type='1' proto='1' />
			</apis>
			<variables />
			<macros >
				<macro >
					<flowline name='TaskPoll' description='Runs Zigbee stack polling.
Applicable to: Coordinator, Router, End Device.
Call regularly in your main loop (or timer) so Zigbee events are processed.' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='TimerID' type='u32' description='System timer identifier' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReceiveByte' description='Reads one byte from RX buffer.
Applicable to: Coordinator, Router, End Device.
Returns 0-255 for data, or 256 when no data is available.' statediag='0' >
						<return name='Return' type='u16' description='0-255 valid byte, 256 no data available.' isconst='0' isHidden='0' isinit='0' usrinit='256' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SendString' description='Sends an array/string payload using current TX routing settings.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u16' description='Number of bytes accepted for send.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='T8*' description='Array containing bytes to send.' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='32' />
						</param>
						<param name='Length' type='u16' description='Number of bytes to send from Data.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
						<command class_type='native' title='C Code' ccode='  FCR_RETVAL = fc_esp32_zigbee_send_array(FCL_DATA, FCL_LENGTH);' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Initialise' description='Internal component initialise event.
Applicable to: all roles.
Normally called automatically by Flowcode.' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to prevent initialisation' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' macro='Ev_Property' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReceiveArray' description='Reads available data into an array buffer.
Applicable to: Coordinator, Router, End Device.
Returns number of bytes copied.' statediag='0' >
						<return name='Return' type='u16' description='Number of bytes copied to Buffer.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Buffer' type='T8*' description='Output byte array.' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='64' />
						</param>
						<param name='MaxLen' type='u16' description='Maximum bytes to copy into Buffer.' isconst='0' isHidden='0' isinit='0' usrinit='64' setinit='' />
						<command class_type='native' title='C Code' ccode='  FCR_RETVAL = fc_esp32_zigbee_receive_array(FCL_BUFFER, FCL_MAXLEN);' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SendArray' description='Sends an array of bytes through Zigbee transport.
Applicable to: Coordinator, Router, End Device.
Uses current TX mode/address/endpoint/cluster settings.' statediag='0' >
						<return name='Return' type='u16' description='Number of bytes accepted for send.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='T8*' description='Array containing bytes to send.' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='32' />
						</param>
						<param name='Length' type='u16' description='Number of bytes to send from Data.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='C Code' ccode='  FCR_RETVAL = fc_esp32_zigbee_send_array(FCL_DATA, FCL_LENGTH);' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetPermitJoin' description='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.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Seconds' type='u8' description='Permit join timeout in seconds. 0 closes joining.' isconst='0' isHidden='0' isinit='0' usrinit='60' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetRXRouting' description='Dynamically updates RX endpoint/cluster filters at runtime.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Endpoint' type='u8' description='Accepted receive endpoint.' isconst='0' isHidden='0' isinit='0' usrinit='10' setinit='' />
						<param name='Cluster' type='u16' description='Accepted receive cluster.' isconst='0' isHidden='0' isinit='0' usrinit='64512' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='InitNetwork' description='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.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='User Macro' macro='zigbee_config' >
							<argument exp='zig_mode' />
							<argument exp='esp_endpoint' />
							<argument exp='esp_channel_mask' />
						</command>
						<command class_type='call' title='User Macro' macro='zigbee_transfer_config_tx' >
							<argument exp='tx_mode' />
							<argument exp='tx_short_addr' />
							<argument exp='tx_endpoint' />
							<argument exp='tx_cluster' />
						</command>
						<command class_type='call' title='User Macro' macro='zigbee_transfer_config_rx' >
							<argument exp='rx_endpoint' />
							<argument exp='rx_cluster' />
						</command>
						<command class_type='call' title='User Macro' macro='zigbee_init' />
						<command class_type='decision' title='Decision' exp='esp_autostart' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' macro='StartCommissioning' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SendByte' description='Sends one byte using current TX routing settings.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u8' description='1 on accepted, 0 on fail/not ready.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u8' description='Byte to send.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='zigbee_transfer_config_rx' description='Low-level internal config for TX destination and RX filters.
Applicable to: Coordinator, Router, End Device.
Usually called by InitNetwork / SetTXRouting / SetRXRouting.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='rx_endpoint' type='u8' description='Accepted incoming endpoint.' isconst='0' isHidden='0' isinit='0' usrinit='10' setinit='' />
						<param name='rx_cluster' type='u16' description='Accepted incoming cluster id.' isconst='0' isHidden='0' isinit='0' usrinit='64512' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='GetChannel' description='Returns currently active Zigbee channel.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u8' description='Current channel number (11-26 typical).' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetTXRouting' description='Dynamically updates TX mode/address/endpoint/cluster at runtime.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Mode' type='u8' description='0 unicast, 1 groupcast, 2 broadcast.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='ShortAddress' type='u16' description='Destination short/group address.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Endpoint' type='u8' description='Destination endpoint.' isconst='0' isHidden='0' isinit='0' usrinit='10' setinit='' />
						<param name='Cluster' type='u16' description='Destination cluster.' isconst='0' isHidden='0' isinit='0' usrinit='64512' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Internal property-update handler.
Calculates channel mask from channel checkboxes and enforces at least one channel.
Applicable to: all roles.' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='mask' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='.mask = (ch11 * 2048) + (ch12 * 4096) + (ch13 * 8192) + (ch14 * 16384) + (ch15 * 32768) + (ch16 * 65536) + (ch17 * 131072) + (ch18 * 262144) + (ch19 * 524288) + (ch20 * 1048576) + (ch21 * 2097152) + (ch22 * 4194304) + (ch23 * 8388608) + (ch24 * 16777216) + (ch25 * 33554432) + (ch26 * 67108864)' />
							<exp exp='.Return = 0' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Component.Property.SetValue' >
							<argument exp='this' />
							<argument exp='&quot;esp_channel_mask&quot;' />
							<argument exp='.mask' />
						</command>
						<command class_type='decision' title='Decision' exp='.mask = 0' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.SetValue' >
									<argument exp='this' />
									<argument exp='&quot;ch11&quot;' />
									<argument exp='1' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='.mask = 2048' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Renamed' description='' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp_str' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='20' />
						</local>
						<command class_type='sim' title='Built-in Function' macro='Tree.GetName' >
							<return exp='.temp_str' />
							<argument exp='this' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Component.Property.SetValue' >
							<argument exp='LibraryComponent1' />
							<argument exp='&quot;Name&quot;' />
							<argument exp='.temp_str' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='BytesAvailable' description='Returns number of bytes waiting in RX buffer.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u16' description='Number of bytes waiting in RX buffer.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='IsJoined' description='Returns 1 when node is joined/formed onto a Zigbee network, else 0.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u8' description='1 = joined/formed, 0 = not joined.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='GetPANID' description='Returns current PAN ID.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u16' description='16-bit PAN ID.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SetZigbeeRole' description='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.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Role' type='u8' description='0 coordinator, 1 router, 2 end device.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='ApplyNow' type='b1' description='If true, immediately applies config and starts commissioning.' isconst='0' isHidden='0' isinit='0' usrinit='1' setinit='' />
						<command class_type='call' title='User Macro' macro='zigbee_config' >
							<argument exp='.Role' />
							<argument exp='esp_endpoint' />
							<argument exp='esp_channel_mask' />
						</command>
						<command class_type='decision' title='Decision' exp='.ApplyNow' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' macro='StartCommissioning' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='zigbee_transfer_config_tx' description='Low-level internal config for TX destination.

Applicable to: Coordinator, Router, End Device.

Usually called by InitNetwork / SetTXRouting / SetRXRouting.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='tx_mode' type='u8' description='0 unicast, 1 groupcast, 2 broadcast.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='tx_short_addr' type='u16' description='Destination short address (or group id for groupcast).' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='tx_endpoint' type='u8' description='Destination endpoint.' isconst='0' isHidden='0' isinit='0' usrinit='10' setinit='' />
						<param name='tx_cluster' type='u16' description='Destination cluster id.' isconst='0' isHidden='0' isinit='0' usrinit='64512' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='zigbee_init' description='Low-level Zigbee stack initialise call.
Applicable to: all roles.
Usually called by InitNetwork.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='StartCommissioning' description='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.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_AddHeader' description='Sent to a component to allow dynamic amendment of header code' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to block header code insertion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='HeadCode' type='T8*' description='Text to amend for header' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.Return = 0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeadCode = .HeadCode + &quot;\n//Include ESP Zigbee CAL\n#define MX_CAL_ESP32_ZIGBEE\n\n&quot;' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='zigbee_config' description='Low-level runtime Zigbee role/endpoint/channel config.
Applicable to: all roles.
Usually called by InitNetwork and SetZigbeeRole.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='role' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='endpoint' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='channel_mask' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='IsNetworkReady' description='Returns 1 when Zigbee stack/network is ready for data transfer, else 0.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='GetShortAddress' description='Returns this node short network address.
Applicable to: Coordinator, Router, End Device.' statediag='0' >
						<return name='Return' type='u16' description='16-bit short address.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Embedded macro - no simulation for Zigbee without dedicated hardware' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReceiveString' description='Reads available data and returns a null-terminated string.
Applicable to: Coordinator, Router, End Device.
Returns number of data bytes copied (excluding terminator).' statediag='0' >
						<return name='Return' type='u16' description='Number of data bytes copied.' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Buffer' type='T8*' description='Output string buffer.' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='64' />
						</param>
						<param name='MaxLen' type='u16' description='Buffer length including null terminator.' isconst='0' isHidden='0' isinit='0' usrinit='64' setinit='' />
						<command class_type='native' title='C Code' ccode='  FCR_RETVAL = fc_esp32_zigbee_receive_string(FCL_BUFFER, FCL_MAXLEN);' language='C' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='58be670e-18fb-477e-ab09-61fde14b23ec' vmin='0' vmaj='1' codename='LibraryComponent1' panelId='-1' x='0' y='0' z='0' xsz='100' ysz='100' zsz='100' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Text::sText' data='Zigbee
(ESP32 H2)
(ESP32 C6)' />
					<value target='Name' data='' />
					<value target='Peripheral::sText' data='(UART CH1)' />
					<value target='Text::nVerticalAlignment' data='002' />
					<value target='ShowComms' data='1' />
					<value target='InputIcon::CommsType' data='255' />
					<value target='InputIcon::LinkTo' data='0' />
					<value target='IconsOnRight' data='0' />
					<value target='OutputIcon::CommsType' data='006' />
					<value target='OutputIcon::LinkTo' data='0' />
					<value target='InputIcon1::CommsType' data='255' />
					<value target='ConsoleHandle' data='0' />
					<value target='Upgraded' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='0' brightness='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='9.85859' ye='-15.4649' ze='595.871' xt='9.85859' yt='-15.4649' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='484' dy='782' zoom='98.2831' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='2112,200,2762,776' RectRecentDocked='966,141,1470,1013' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
	</panel2d>
	<panel3d shadows='0' lighting='0' brightness='0' perspective='1' >
		<background rgb='8421376' img='..\icons\solar\space.gif' style='0' />
		<table rgb='49280' img='' style='0' size='0' />
		<camera xe='6.29656' ye='0.807713' ze='165.985' xt='6.29656' yt='0.807713' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='0,425,654,1002' RectRecentDocked='0,0,246,872' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='0' />
	<layout >
		<view type='0' name='InitNetwork' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='TaskPoll' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='zigbee_config' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='zigbee_init' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='StartCommissioning' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Renamed' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetPermitJoin' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='IsNetworkReady' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SendArray' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SendString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetRXRouting' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetTXRouting' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='BytesAvailable' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetChannel' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetPANID' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetShortAddress' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='IsJoined' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReceiveArray' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReceiveByte' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReceiveString' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SendByte' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SetZigbeeRole' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='zigbee_transfer_config_rx' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='zigbee_transfer_config_tx' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_AddHeader' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA7gEAAGMDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
