File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,13 +20,13 @@ class GPIOInit(ConstructClass):
2020class InitBlock (ConstructClass ):
2121 subcon = Struct (
2222 "type" / Int16ul ,
23- "subtype" / Int16ul ,
2423 "length" / Int16ul ,
2524 "payload" / FixedSized (this .length ,
2625 Switch (this .type , {
2726 0 : HIDDescriptor ,
2827 1 : GPIOInit ,
29- 2 : Bytes (0 ),
28+ 2 : GreedyBytes , # Unknown 6 bytes
29+ 7 : GreedyBytes , # Device name
3030 }, default = GreedyBytes ))
3131 )
3232
@@ -37,6 +37,7 @@ class InitMsg(ConstructClass):
3737 "unk" / Const (0x00 , Int8ul ),
3838 "device_id" / Int8ul ,
3939 "device_name" / PaddedString (16 , "ascii" ),
40+ "more_packets" / Int16ul ,
4041 "msg" / RepeatUntil (lambda obj , lst , ctx : lst [- 1 ].type == 2 , InitBlock )
4142 )
4243
@@ -275,6 +276,9 @@ def report(self, msg):
275276 ackmsg .unk = 0
276277 ackmsg .msg = msg
277278 self .device_control (ackmsg )
279+ else :
280+ self .log ("Unknown message!" )
281+ print (msg )
278282
279283 def ack (self , retcode , msg ):
280284 msg = DeviceControlAck .parse (msg )
You can’t perform that action at this time.
0 commit comments