本文整理匯總了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)