コード例 #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)
コード例 #2
0
ファイル: message.py プロジェクト: tftcmengxue/Tibet.6
 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
コード例 #3
0
ファイル: message.py プロジェクト: adoggie/PyDawn
 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