pyP2Monitor
1.0.0
Monitor a P2 furnace activity reading data on serial port
|
The class managing the communication with the furnace on serial port. More...
Public Member Functions | |
def | __init__ |
Instanciate a new P2Com object and open the serial port with the good parameters. | |
def | getCom |
Return the serial port object. | |
def | checksum |
Obsolete function (the checksum is not processed here now) | |
def | write |
Write raw datas on to the furnace after adding checksum to it (obsolete) | |
def | sendMsg |
Write data to serial port. | |
def | read |
Read datas on the serial port. | |
def | close |
Close the serial port. |
Data Fields | |
timeout | |
A small timeout. | |
failTimeout | |
Read fail timeout. | |
ser | |
The serial port object self.ser = serial.Serial(portFile,9600,serial.EIGHTBITS,serial.PARITY_NONE,serial.STOPBITS_ONE,self.timeout,) | |
FRAME_END | |
The last char of a sended frame "\r". | |
RECV_END | |
The last char sended by the furnace in a frame (obsolete and false) |
The class managing the communication with the furnace on serial port.
def __init__ | ( | self, | |
portFile | |||
) |
def checksum | ( | msg | ) |
def read | ( | self | ) |
Read datas on the serial port.
Reads datas from the serial port and returns a P2Msg
P2ComError | On receive error |
Definition at line 199 of file p2com.py.
References P2Com.failTimeout, and P2Com.timeout.
def sendMsg | ( | self, | |
msg | |||
) |
def write | ( | self, | |
msg | |||
) |
Write raw datas on to the furnace after adding checksum to it (obsolete)
Take as argument a string representing hexadecimal numbers and send the associated bytes array to the serial port. Exemple : a call to write("10050F") sends [16,5,15] to the serial port
msg | a string representing an hexadecimal number |
Definition at line 154 of file p2com.py.
References P2Com.FRAME_END.
timeout |
A small timeout.
This small tiemout is used as time between each read retry
Definition at line 107 of file p2com.py.
Referenced by P2Com.read().