The host needs to scan for items which need published (xCMDs). This itterator may later be expanded to include metrics, properties and so forth.
1. loop all Groups
2. loop all Edges
3. loop all Devices
//Will Cycle through the Groups.Edges.devices. 1st it will find the first edge of the first group. Then it will either go deeper (G1/E1/D1) or down if there are no devices (either G1/E2, or G2/E1)
// Bool: OnlyOnline := TRUE will skip offline things
// Bool: EndOfList := TRUE indicates the end of list has been reached
Continuously call FB_DeeperAndDown() until EOL or you find a DeviceOrEdge which wants to publish => then publish it.
FB_DeeperAndDown( Groups := _Groups , OnlyOnline := TRUE ,
itfXcmdSender => itfXcmdSender , EndOfList => EOL );
IF (NOT EOL) AND itfXcmdSender <> 0 THEN
IF itfXcmdSender.getXcmd(itfPayload => xcmdPayload ) THEN
Published := TRUE;