Add more validation to serial read state machine

This commit is contained in:
XANTRONIX Development 2016-06-02 22:54:59 -05:00
parent e8cfe8e77a
commit 445c52cdf4

View file

@ -198,12 +198,28 @@ int main() {
} }
case 2: { case 2: {
switch (c) {
case 0x01:
case 0x02:
case 0x04:
case 0x08:
case 0x0f: {
header.type = c; header.type = c;
i++; i++;
break; break;
} }
default: {
i = 0;
break;
}
}
break;
}
case 3: { case 3: {
header.compression = c; header.compression = c;
i++; i++;