(buf: bytes)
| 89 | |
| 90 | |
| 91 | def read_fields(buf: bytes) -> tuple: |
| 92 | if isinstance(buf, str): |
| 93 | buf = buf.encode() |
| 94 | |
| 95 | """ msg payload is made of fields terminated/separated by NULL chars """ |
| 96 | fields = buf.split(b"\0") |
| 97 | |
| 98 | return tuple( |
| 99 | fields[0:-1] |
| 100 | ) # last one is empty; this may slow dow things though, TODO |