Beispiel #1
0
 def packet(self):
     pkt = DownStream.packet()
     buf = ByteBuf()
     size = 4 + len(self.content)
     buf.write_uint8(size)
     buf.write_uint32(self.sequence)
     buf.write_bytes(self.content)
     buf.write_uint16(self.lang)
     pkt.set_payload(buf.bytes)
Beispiel #2
0
 def marshall(self):
     buf = ByteBuf()
     self.size = 39 + len(self.address)
     buf.write_uint8(self.size)
     buf.write_uint32(self.sequence)
     buf.write_bytes(self.alarmsms)
     buf.write_bytes('&&')
     buf.write_bytes(self.address)
     buf.write_bytes('&&')
     buf.write_bytes(self.tel)
     buf.write_bytes('##')
     return buf.bytes
Beispiel #3
0
 def packet(self):
     from packet import NetWorkPacket
     pkt = NetWorkPacket()
     buf = ByteBuf()
     size = 4 + len(self.content)
     buf.write_uint8(size)
     buf.write_uint32(self.sequence)
     buf.write_bytes(self.content)
     buf.write_uint16(self.lang)
     pkt.set_payload(buf.bytes)
     pkt.type = self.Type.value
     return pkt