Esempio n. 1
0
 def decode_control(self, encoded):
     sc = StringCodec(encoded)
     code = sc.read_uint16()
     cls = CONTROLS[code]
     ctl = cls()
     sc.read_fields(ctl)
     return ctl
Esempio n. 2
0
 def decode_control(self, encoded):
   sc = StringCodec(encoded)
   code = sc.read_uint16()
   cls = CONTROLS[code]
   ctl = cls()
   sc.read_fields(ctl)
   return ctl
Esempio n. 3
0
 def decode_command(self, encoded):
     sc = StringCodec(encoded)
     code = sc.read_uint16()
     cls = COMMANDS[code]
     hdr = sc.read_compound(Header)
     cmd = cls()
     sc.read_fields(cmd)
     cmd.sync = hdr.sync
     return cmd
Esempio n. 4
0
 def decode_command(self, encoded):
   sc = StringCodec(encoded)
   code = sc.read_uint16()
   cls = COMMANDS[code]
   hdr = sc.read_compound(Header)
   cmd = cls()
   sc.read_fields(cmd)
   cmd.sync = hdr.sync
   return cmd