public interface PropertyTransformer
It is possible to return the modified transmission properties with different record types from the previous transmit property, i.e. some record fields may be removed or added. The channel should merge the returned transmission properties with its defaultProperties to make sure that the transmission properties contains at least all the fields of the defaultProperties.
Anything that needs to know the locations of the sender and receiver to alter the transmit properties should implement this interface. For example, for a sender with a specific antenna pattern to send data to receivers, it needs to know each receiver's position and its own position to calculator the antenna gain. To do so, the sender can implement this interface and register itself with the wireless channel it uses. The channel will call the transformProperties method later and provide the required information for the sender to calculate, for example, the antenna gain to a specific receiver.
WirelessChannel
Yellow (cxh) |
Green (cxh) |
Modifier and Type | Method and Description |
---|---|
RecordToken |
transformProperties(RecordToken properties,
WirelessIOPort source,
WirelessIOPort destination)
Modify the transmission properties and return a new token with the
modifications.
|
RecordToken transformProperties(RecordToken properties, WirelessIOPort source, WirelessIOPort destination) throws IllegalActionException
properties
- The transmission properties to modify.source
- The sending port.destination
- The receiving port.IllegalActionException
- If the properties cannot be
transformed for some reason.