pub struct TcpCommunicationChannels {
pub rx_tcp_communication_from_relay_manager_opt: Option<AquaReceiver<InternalCommand>>,
pub rx_tcp_communication_from_sensor_manager_opt: Option<AquaReceiver<InternalCommand>>,
pub tx_tcp_communication_to_sensor_manager_opt: Option<AquaSender<Result<f32, TcpCommunicationError>>>,
pub rx_tcp_communication_from_tank_level_switch_opt: Option<AquaReceiver<InternalCommand>>,
pub tx_tcp_communication_to_tank_level_switch_opt: Option<AquaSender<Result<f32, TcpCommunicationError>>>,
pub tx_tcp_communication_to_signal_handler: AquaSender<bool>,
pub rx_tcp_communication_from_signal_handler: AquaReceiver<InternalCommand>,
}Expand description
Struct collects the channels for communication with other threads.
Fields§
§rx_tcp_communication_from_relay_manager_opt: Option<AquaReceiver<InternalCommand>>Receiver part of the channel for communication from the relay manager wrapped in Option type
rx_tcp_communication_from_sensor_manager_opt: Option<AquaReceiver<InternalCommand>>Receiver part of the channel for communication from the sensor manager wrapped in Option type
tx_tcp_communication_to_sensor_manager_opt: Option<AquaSender<Result<f32, TcpCommunicationError>>>Sender part of the channel for communication to sensor manager wrapped in Option type
rx_tcp_communication_from_tank_level_switch_opt: Option<AquaReceiver<InternalCommand>>Receiver part of the channel for communication from tank level switch wrapped in Option type
tx_tcp_communication_to_tank_level_switch_opt: Option<AquaSender<Result<f32, TcpCommunicationError>>>Sender part of the channel for communication to tank level switch wrapped in Option type
tx_tcp_communication_to_signal_handler: AquaSender<bool>Sender part of the channel for communication to the signal handler
rx_tcp_communication_from_signal_handler: AquaReceiver<InternalCommand>Receiver part of the channel for communication from the signal handler
Implementations§
Source§impl TcpCommunicationChannels
impl TcpCommunicationChannels
Sourcepub fn receive_from_relay_manager(
&mut self,
) -> Option<Result<InternalCommand, AquaChannelError>>
pub fn receive_from_relay_manager( &mut self, ) -> Option<Result<InternalCommand, AquaChannelError>>
Receives a command from the relay manager if the channel exists.
Sourcepub fn receive_from_sensor_manager(
&mut self,
) -> Option<Result<InternalCommand, AquaChannelError>>
pub fn receive_from_sensor_manager( &mut self, ) -> Option<Result<InternalCommand, AquaChannelError>>
Receives a command from the sensor manager if the channel exists.
Sourcepub fn send_to_sensor_manager(
&mut self,
data: Result<f32, TcpCommunicationError>,
) -> Option<Result<(), AquaChannelError>>
pub fn send_to_sensor_manager( &mut self, data: Result<f32, TcpCommunicationError>, ) -> Option<Result<(), AquaChannelError>>
Sends a result to the sensor manager if the channel exists.
Sourcepub fn receive_from_tank_level_switch(
&mut self,
) -> Option<Result<InternalCommand, AquaChannelError>>
pub fn receive_from_tank_level_switch( &mut self, ) -> Option<Result<InternalCommand, AquaChannelError>>
Receives a command from the tank level switch if the channel exists.
Sourcepub fn send_to_tank_level_switch(
&mut self,
data: Result<f32, TcpCommunicationError>,
) -> Option<Result<(), AquaChannelError>>
pub fn send_to_tank_level_switch( &mut self, data: Result<f32, TcpCommunicationError>, ) -> Option<Result<(), AquaChannelError>>
Sends a result to the tank level switch if the channel exists.
Sourcepub fn send_to_signal_handler(
&mut self,
ack: bool,
) -> Result<(), AquaChannelError>
pub fn send_to_signal_handler( &mut self, ack: bool, ) -> Result<(), AquaChannelError>
Sends an acknowledgment to the signal handler.
Sourcepub fn receive_from_signal_handler(
&mut self,
) -> Result<InternalCommand, AquaChannelError>
pub fn receive_from_signal_handler( &mut self, ) -> Result<InternalCommand, AquaChannelError>
Receives a command from the signal handler.
Trait Implementations§
Source§impl AcknowledgeSignalHandlerTrait for TcpCommunicationChannels
impl AcknowledgeSignalHandlerTrait for TcpCommunicationChannels
Source§fn send_true_to_signal_handler(&mut self) -> Result<(), AquaChannelError>
fn send_true_to_signal_handler(&mut self) -> Result<(), AquaChannelError>
Source§fn location(&self) -> String
fn location(&self) -> String
Source§fn acknowledge_signal_handler(&mut self)
fn acknowledge_signal_handler(&mut self)
SignalHandler by sending a confirmation message. Read more