Radio
gradysim.protocol.plugin.radio
This module declares a plugin for the protocol that allows a protocol to instantiate multiple radios, each with their own communication characteristics. This plugin is only available in a Python simulation environment and will raise an error if used in other environments. Alternative implementations should be provided for other simulation environments,
Radio
A plugin that allows a protocol to instantiate multiple radios, each with their own communication characteristics.
Multiple radios can be instantiated in a single protocol. Messages sent through the radio will use the radio's communication characteristics, such as transmission range. Messages sent through other radios or directly through the protocol will not be affected by the radio's characteristics.
This plugin is only available in a Python simulation environment and will raise an error if used in other environments. Alternative implementations should be provided for other simulation environments, ones that interface with real hardware radios or other communication systems.
Warning
This plugin can only be used in a Python simulation environment.
Source code in gradysim/protocol/plugin/radio.py
__init__(protocol, radio_configuration)
Initializes the Radio plugin.
Source code in gradysim/protocol/plugin/radio.py
send_communication_command(command)
Sends a message via the radio.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command |
CommunicationCommand
|
The communication command to send. Same CommunicationCommand used in IProvider |
required |
Source code in gradysim/protocol/plugin/radio.py
set_configuration(radio_configuration)
Sets a new configuration for the radio.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
radio_configuration |
RadioConfiguration
|
The new configuration for the radio. |
required |