openc2lib.core.transfer
Transfer protocol
Interface that defines the basic behavior of the Transfer Protocols.
1""" Transfer protocol 2 3 Interface that defines the basic behavior of the Transfer Protocols. 4""" 5 6class Transfer: 7 """ Transfer protocol 8 9 This is the base class for all implementation of Transfer protocols. 10 """ 11 12 def send(self, msg, encoder): 13 """ Sends a Message 14 15 Encodes, sends a message, and returns the response. 16 17 :arg msg: an openc2lib `Message` to send 18 :arg encoder: the `Encoder` to be used 19 :return: An openc2lib `Message` that contains the `Response` to the sent Message. 20 """ 21 pass 22 23 def receive(self, callback, encoder): 24 """ Receives a Message 25 26 Listen for incoming `Message`s and dispatches them to the `Actuator`. This method may 27 be blocking or non-blocking. 28 29 :arg callback: the `Consumer.dispatch` function that contains the logic to dispatch a `Message` 30 to one or more `Actuator` 31 :arg encode: the default `Encoder` instance to encode/decode Messages. Implementations might 32 use the information carried within OpenC2 Messages to derive the `Encoder` instance 33 (retrieved from the `Encoders` variable. 34 :return: None 35 """ 36 pass
7class Transfer: 8 """ Transfer protocol 9 10 This is the base class for all implementation of Transfer protocols. 11 """ 12 13 def send(self, msg, encoder): 14 """ Sends a Message 15 16 Encodes, sends a message, and returns the response. 17 18 :arg msg: an openc2lib `Message` to send 19 :arg encoder: the `Encoder` to be used 20 :return: An openc2lib `Message` that contains the `Response` to the sent Message. 21 """ 22 pass 23 24 def receive(self, callback, encoder): 25 """ Receives a Message 26 27 Listen for incoming `Message`s and dispatches them to the `Actuator`. This method may 28 be blocking or non-blocking. 29 30 :arg callback: the `Consumer.dispatch` function that contains the logic to dispatch a `Message` 31 to one or more `Actuator` 32 :arg encode: the default `Encoder` instance to encode/decode Messages. Implementations might 33 use the information carried within OpenC2 Messages to derive the `Encoder` instance 34 (retrieved from the `Encoders` variable. 35 :return: None 36 """ 37 pass
Transfer protocol
This is the base class for all implementation of Transfer protocols.
13 def send(self, msg, encoder): 14 """ Sends a Message 15 16 Encodes, sends a message, and returns the response. 17 18 :arg msg: an openc2lib `Message` to send 19 :arg encoder: the `Encoder` to be used 20 :return: An openc2lib `Message` that contains the `Response` to the sent Message. 21 """ 22 pass
Sends a Message
Encodes, sends a message, and returns the response.
:arg msg: an openc2lib Message to send
:arg encoder: the Encoder to be used
Returns
An openc2lib
Messagethat contains theResponseto the sent Message.
24 def receive(self, callback, encoder): 25 """ Receives a Message 26 27 Listen for incoming `Message`s and dispatches them to the `Actuator`. This method may 28 be blocking or non-blocking. 29 30 :arg callback: the `Consumer.dispatch` function that contains the logic to dispatch a `Message` 31 to one or more `Actuator` 32 :arg encode: the default `Encoder` instance to encode/decode Messages. Implementations might 33 use the information carried within OpenC2 Messages to derive the `Encoder` instance 34 (retrieved from the `Encoders` variable. 35 :return: None 36 """ 37 pass
Receives a Message
Listen for incoming Messages and dispatches them to the Actuator. This method may
be blocking or non-blocking.
:arg callback: the Consumer.dispatch function that contains the logic to dispatch a Message
to one or more Actuator
:arg encode: the default Encoder instance to encode/decode Messages. Implementations might
use the information carried within OpenC2 Messages to derive the Encoder instance
(retrieved from the Encoders variable.
Returns
None