-
Notifications
You must be signed in to change notification settings - Fork 900
Description
Looking for input on what the best approach to implement this. (or at least pro/cons)
Currently auto_analyse_raw_data.py only has support for space encoded messages, and it is great at it.
Now (mostly for fun) I was thinking off if there is any way to extend it with support for fixed length messages as well. (Such as the Amcor fixed length bit encoding)
Is there any smarter way to do this, than to first determine header, footers and gaps (can that be made to a separate function maybe) and than after that go over the remaining mark+space pairs again?
Another part is, can we make it better at displaying repeated messages. (maybe just say that it is repeated, instead of printing the same data sections multiple times, but the question then is, how to determine that it is repeated.)
Some faked 8 bit messages
// space encoded, no trailing gap
uint16_t rawData[] = {2300, 3400, 400, 1300, 400, 400, 400, 400, 400, 1300, 400, 464, 400, 400, 400, 1300, 400, 1300, 400};
// space encoded, with trailing gap
uint16_t rawData[] = {2300, 3400, 400, 1300, 400, 400, 400, 400, 400, 1300, 400, 464, 400, 400, 400, 1300, 400, 1300, 400, 6800};
// space encoded, repeated
uint16_t rawData[] = {2300, 3400, 400, 1300, 400, 400, 400, 400, 400, 1300, 400, 464, 400, 400, 400, 1300, 400, 1300, 400, 6800, 2300, 3400, 400, 1300, 400, 400, 400, 400, 400, 1300, 400, 464, 400, 400, 400, 1300, 400, 1300, 400, 6800, 2300, 3400, 400, 1300, 400, 400, 400, 400, 400, 1300, 400, 464, 400, 400, 400, 1300, 400, 1300, 400};
// fixed length encoded, no trailing gap
uint16_t rawData[] = {2300, 3400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 400, 1300, 400};
// fixed length encoded, with trailing gap
uint16_t rawData[] = {2300, 3400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 400, 1300, 400, 6800};
// fixed length encoded, repeated
uint16_t rawData[] = {2300, 3400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 400, 1300, 400, 6800, 2300, 3400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 400, 1300, 400, 6800, 2300, 3400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 1300, 400, 1300, 400, 400, 1300, 400, 1300, 400};