This module contains utility code that is useful in a wide variety of FoneAstra projects.
Unpacks a single packed integer from two chars. Each value is a 12-bit two’s complement number, with eight integer bits and 4 fraction bits.
Parameters: | chars (string) – The data string. Only the first two chars are used. |
---|
Separates the given string into two char segments, then converts each of those segments to an integer and returns the list.
Parameters: | readings (string) – The string to get readings out ot. |
---|
Yield successive n-sized chunks from iterable. If the length of iterable is not evenly divisible by n, the final chunk will be small.
Parameters: |
|
---|
Given a list of (regex, object) tuples and an input string, matches the input string against each regex in turn and returns a tuple containing the object and the regex match object if the string matches. Returns only the first match if there are 1+ matches, or (None, None) if there was no match.
Parameters: |
|
---|