本文整理汇总了Python中message.little_endian函数的典型用法代码示例。如果您正苦于以下问题:Python little_endian函数的具体用法?Python little_endian怎么用?Python little_endian使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了little_endian函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_payload
def get_payload(self):
self.payload_fields.append(("Service", self.service))
self.payload_fields.append(("Port", self.port))
service = little_endian(bitstring.pack("8", self.service))
port = little_endian(bitstring.pack("32", self.port))
payload = service + port
return payload
示例2: get_payload
def get_payload(self):
reserved_8 = little_endian(bitstring.pack("8", self.reserved))
color = "".join(little_endian(bitstring.pack("16", field)) for field in self.color)
duration = little_endian(bitstring.pack("32", self.duration))
payload = reserved_8 + color + duration
payloadUi = " ".join("{:02x}".format(ord(c)) for c in payload)
return payload
示例3: get_payload
def get_payload(self):
self.payload_fields.append(("Count", self.service))
self.payload_fields.append(("Index", self.port))
count = little_endian(bitstring.pack("8", self.service))
index = little_endian(bitstring.pack("8", self.port))
payload = count + index
return payload