Main class of a protocol plugin.
Proxy method used to instantiate a new device. It raises a ValueError if the device_id given is out of range. It may raise a TypeError if the args given to set the new device don’t match the settings format.
Processes a radio sequence received by the radio modem into a message understable by the protocol. The implementation of the sequence processing is , for the moment, a hard-coded finite-state machine.
Returns the list of devices that are currently handled by this protocol.
Returns a list of the devices instantiable by the user of the driver. The list of user-instantiable devices is included in the list of the driver-handled devices but not necessarily equal.
Returns the arguments needed to set the driver.
Method called when a device intends to send a message. It builds up the Nexa message according to the command to be sent and the identity of the sending device.
Sets the driver. It raises a TypeError if the given modem doesn’t match the awaited modem type.
Keyword arguments: settings – the dictionary of settings used to set the driver. Its format is determined by the function get_set_arguments.
Main class of a protocol plugin.
Proxy method used to instantiate a new device. It raises a ValueError if the device_id given is out of range. It may raise a TypeError if the args given to set the new device don’t match the settings format.
Processes a radio sequence received by the radio modem into a message understable by the protocol. The implementation of the sequence processing is , for the moment, a hard-coded finite-state machine.
Returns the list of devices that are currently handled by this protocol.
Returns a list of the devices instantiable by the user of the driver. The list of user-instantiable devices is included in the list of the driver-handled devices but not necessarily equal.
Returns the arguments needed to set the driver.
Method called when a device intends to send a message. It builds up the Nexa message according to the command to be sent and the identity of the sending device.
Sets the driver. It raises a TypeError if the given modem doesn’t match the awaited modem type.
Keyword arguments: settings – the dictionary of settings used to set the driver. Its format is determined by the function get_set_arguments.
Class implementing the interface between the computer running the domotic box and the Arduino, which is used as a 433MHz radio modem.
Adds the protocol object given as argument to the list of protocols that receive their messages through this modem. When the modem receives a radio sequence, it will send it to the whole list of its observers.
Formats a binary sequence so that it fits the format of the parameters of a command sent to the Arduino. This method is called by the send_sequence method.
Returns the name of the modem.
Returns the type of the modem.
Returns the dictionary of arguments that have to be used in order to set this module.
Notifies all the protocols that are observing this modem that an incoming radio message has arrived. The received sequence is given as argument so that each protocol can handle the decoding.
Sends the radio sequence given as an argument.
The sequence dictionary must have the following format :
Key | Type |
---|---|
number_of_repetitions | int |
base_radio_pulse_length_in_microseconds | int |
symbol_1 | binary_string |
symbol_2 | binary_string |
... | binary_string |
symbol_n | binary_string |
symbol_coded_message | symbols_list |
Sets the serial communication used by the domotic box to communicate with the Arduino. If the given COM port number is not valid (i.e. it raises a SerialException when we try to open the connection) the method raises the same serial.SerialException.