Common ASTM decoding function that tries to guess which kind of data it handles.
If data starts with STX character (0x02) than probably it is full ASTM message with checksum and other system characters.
If data starts with digit character (0-9) than probably it is frame of records leading by his sequence number. No checksum is expected in this case.
Otherwise it counts data as regular record structure.
Note, that data should be bytes, not unicode string even if you know his encoding.
Parameters: |
|
---|---|
Returns: | List of ASTM records with unicode data. |
Return type: | list |
Decodes ASTM frame: list of records followed by sequence number.
Decodes complete ASTM message that is sent or received due communication routines. It should contains checksum that would be additionally verified.
Parameters: |
|
---|---|
Returns: | Tuple of three elements:
|
Raises : |
|
Decodes ASTM field repeated component.
Encodes list of records into single ASTM message, also called as “packed” message.
If you need to get each record as standalone message use iter_encode() instead.
If the result message is too large (greater than MAX_MESSAGE_SIZE), than it will be splitted by chunks.
Parameters: | |
---|---|
Returns: | List of ASTM message chunks. |
Return type: | list |
Encodes ASTM message.
Parameters: | |
---|---|
Returns: | ASTM complete message with checksum and other control characters. |
Return type: | str |
Encodes single ASTM record.
Parameters: | |
---|---|
Returns: | Encoded ASTM record. |
Return type: | str |