本文整理汇总了Python中protocol.Protocol.build_frame方法的典型用法代码示例。如果您正苦于以下问题:Python Protocol.build_frame方法的具体用法?Python Protocol.build_frame怎么用?Python Protocol.build_frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protocol.Protocol
的用法示例。
在下文中一共展示了Protocol.build_frame方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mk_multiple_messages
# 需要导入模块: from protocol import Protocol [as 别名]
# 或者: from protocol.Protocol import build_frame [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 build_frame [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 build_frame [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 build_frame [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 build_frame [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)