def encode_compound(self, op): sc = StringCodec() sc.write_compound(op) return sc.encoded
def encode_command(self, cmd): sc = StringCodec() sc.write_uint16(cmd.CODE) sc.write_compound(Header(sync=cmd.sync)) sc.write_fields(cmd) return sc.encoded