hmland: fix interpretation of '+'
authorMichael Gernoth <michael@gernoth.net>
Wed, 1 Jul 2015 17:44:17 +0000 (19:44 +0200)
committerMichael Gernoth <michael@gernoth.net>
Wed, 1 Jul 2015 17:44:17 +0000 (19:44 +0200)
The usb device expects a length byte before the AES channel-mask
is sent, so add it in. This fixes non-working aesCommReq.

hmland.c

index 73a08d4..f1f0e3d 100644 (file)
--- a/hmland.c
+++ b/hmland.c
@@ -440,6 +440,11 @@ static int hmlan_parse_one(uint8_t *cmd, int last, void *data)
                        parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), 0);
                        parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), FLAG_LENGTH_BYTE);
                        break;
+               case '+':
+                       parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), 0);
+                       parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), 0);
+                       parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), 0);
+                       parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), FLAG_LENGTH_BYTE);
                default:
                        parse_part_in(&inpos, (last-(inpos-cmd)), &outpos, (sizeof(out)-(outpos-out)), FLAG_IGNORE_COMMAS);
                        break;
Impressum, Datenschutz