本文整理汇总了Python中action.Action.noCommand方法的典型用法代码示例。如果您正苦于以下问题:Python Action.noCommand方法的具体用法?Python Action.noCommand怎么用?Python Action.noCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类action.Action
的用法示例。
在下文中一共展示了Action.noCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseATCommand
# 需要导入模块: from action import Action [as 别名]
# 或者: from action.Action import noCommand [as 别名]
def parseATCommand(self, rawATCommand):
action = Action()
#We don't know yet if we have parser implemented for this AT command,
#set error state for now
action.noCommand = True
if not isinstance(rawATCommand, str):
action.isInErrorState = True
return action
if rawATCommand[:4] == "RING":
action.incomingCall = True
action.isInErrorState = False
action.noCommand = False
self.log.pushLogMsg("Incoming call")
if rawATCommand[:10] == "NO CARRIER" or rawATCommand[:9] == "NO ANSWER":
action.incomingCall = False
action.isInErrorState = False
action.noCommand = False
action.callDisconnected = True
self.log.pushLogMsg("Call disconnected")
if action.noCommand == True:
self.log.pushLogMsg(("AT parser failed to parse the AT command: " + rawATCommand)) #rawATCommand.toString()))
return action