本文整理汇总了Python中protocol.Protocol.mk_header方法的典型用法代码示例。如果您正苦于以下问题:Python Protocol.mk_header方法的具体用法?Python Protocol.mk_header怎么用?Python Protocol.mk_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protocol.Protocol
的用法示例。
在下文中一共展示了Protocol.mk_header方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mk_multiple_messages
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import mk_header [as 别名]
def mk_multiple_messages(self, effect, messages, delay):
buf = ""
i = 1
for message in messages:
if(i<(len(messages))):
trame = Protocol.build_frame(Protocol.mk_header(addr=self.addr),
Protocol.mk_serst(more=True),
Protocol.mk_page(msg=message, num = '00' + str(i), persist_time = delay, last = False, effect = effect))
else:
print 'last'
trame = Protocol.build_frame(Protocol.mk_header(addr=self.addr),
Protocol.mk_serst(more=False),
Protocol.mk_page(msg=message, num = '00' + str(i), persist_time= delay, last = True, effect = effect))
print trame.encode("hex")
self.send(trame)
sleep(0.1)
i = i + 1
return buf
示例2: simple_sliding_message
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import mk_header [as 别名]
def simple_sliding_message(self, message):
buf = Protocol.build_frame(Protocol.mk_header(addr=self.addr), Protocol.mk_serst(), Protocol.mk_page(msg=message, effect = 'SLIDE'))
self.send(buf)
示例3: alert_message
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import mk_header [as 别名]
def alert_message(self, message):
buf = Protocol.build_frame(Protocol.mk_header(addr=self.addr), Protocol.mk_serst(), Protocol.mk_page(msg=message, cmd='FLASH'))
self.send(buf)
示例4: simple_static_message
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import mk_header [as 别名]
def simple_static_message(self, message):
buf = Protocol.build_frame(Protocol.mk_header(addr=self.addr), Protocol.mk_serst(), Protocol.mk_page(msg=message, effect = 'APPEAR'))
self.send(buf)
示例5: time_message
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import mk_header [as 别名]
def time_message(self):
buf = Protocol.build_frame(Protocol.mk_header(addr=self.addr), Protocol.mk_serst(), Protocol.mk_page(time=True))
self.send(buf)