Wireless Port
Note
Wireless port is used when we need to make communication between modules which is not connected wired port and because of structure of model this is not possible. For example JobHandlerV2Sync.
Create Wireless port
Wireless port and wired port are same, difference is only in configuration. It's possible to use existing port or create new one especially for our purpose. We need to be sure that both module used same port.
Add port in model
Now when we have created port we need to add this port to Structure diagram in Implementation. One of the modules need to be configured as creator of communication and second one will connect to wireless port.
Creator of communication
In this module we need to add port and set it as conjugated. Option wired need to be disabled. Next step is register port for wireless communication. Best place to add registration is StateDiagram in Implementation.
You can find it here:
State Diagram > Offline > IsOperable
Here we can add registration.
Tip
PortName.registerSPP("CommunicationKey");
if (!PortName.registerSPP( "CommunicationKey" )) { *m_poLog<<ELOG("IsOperable")<< "CommunicationKey could not be registered." << ENDLOG; return (false); }
po_DLOG("IsOperable")<<"CommunicationKey registered successfully"<<CLOSELOG;
return (true); ```
CommunicationKey
"CommunicationKey" is key for other port which want to connect. This can be random text but keep it simple and explicit.
Connecting to port
On one module we just create communication, on other one we will create port which is NOT conjugated.Option wired need to be disabled. Next step is connecting to previously created communication. Best place to add registration is StateDiagram in Implementation.
You can find it here:
State Diagram > Starting Up > Exit Action
Now we will use "CommunicationKey" to setup communication between ports.
Tip
PortName.registerSAP("CommunicationKey");
title="Example"
if (!PortName.registerSAP( "CommunicationKey" ))
{
*m_poLog<<ELOG("IsOperable")<< "CommunicationKey could not be registered." << ENDLOG;
}
else
{
po_DLOG("IsOperable")<<"CommunicationKey registered successfully"<<CLOSELOG;
}
Now we have both way wireless comunication between two modules.