Strona zostanie usunięta „get_text_from_frame_flags”
. Bądź ostrożny.
def get_text_from_frame_flags(self, bytearray_of_frame):
The "get_text_from_frame_flags" method is used to return the frame-flags as a list with explanation (string) for each bit, starting with lsb. If CRC-Check is active, it will check the byte-frame and raises a Value_Error, if a CRC-Error was detected.
The "self" argument is pointing to the object, which calls the method.
The "bytearray_of_frame" argument is the frame what you get, when you receive data from the serial port.
Type -> list
list[0:5]: Type -> string
>>> # create an object of the Xcom-API-Class
>>> Object = Xcom_API()
>>>
>>> # create a variable with a received frame
>>> Frame = bytearray(b'\\xAA\\x37\\x65\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0E\\x00\\xAA\\x66\\x02\\x01\\x01\\x00\\xB8\\x0B\\x00\\x00\\x01\\x00\\x00\\x40\\x42\\x42\\x8B\\x46')
>>>
>>> # call the Method 'get_text_from_frame_flags'
>>> Answer = Object.get_text_from_frame_flags(Frame)
>>>
>>> # print Answer
>>> print(Answer)
('Messages are pending.','A reset or restart was carried out.','The SD-Card is present.','The SD-Card is not full.','New datalog file on the SD-Card.','Datalogger is supported.')
Hochschule Anhalt | Anhalt University of Applied Sciences | Department 6 EMW
Xcom-API
Tobias Müller, M. Eng.
📧 Tobias.Mueller@HS-Anhalt.de
© es-lab.de, 31.10.2017
Strona zostanie usunięta „get_text_from_frame_flags”
. Bądź ostrożny.