A typical agent written using UnetStack can add new behaviors to itself.
In order to transmit at regular intervals as required by a node in TDMA like protocol, your agent can instruct the PHY agent to transmit regularly. This can be implemented using ticker behaviour.
A TickerBehavior runs repeatedly with a specified delay between invocations. A TickerBehavior can be added to your agent with this code:
add new TickerBehavior(1000*slotlength, {
phy << new TxFrameReq(to: nodeAddress, type: Physical.DATA)
})
where slotlength
is in seconds and nodeAddress
is the address of the node you are trying to transmit the information to. For more information on TxFrameReq you can check out the documentation.