| 12345678910111213141516171819202122232425262728 |
- from .BxCmd import baseBxCmd
- from .BxCmdCode import CMD_SYSTEM_STATE
- class CmdState(baseBxCmd):
- """系统状态命令"""
- def __init__(self):
- super().__init__(CMD_SYSTEM_STATE.group, CMD_SYSTEM_STATE.code)
- def Build(self):
- """构建命令数据"""
- result = bytearray()
- # 写入命令组
- result.append(self.Group())
- # 写入命令
- result.append(self.Cmd())
- # 写入响应标志
- result.append(self.ReqResp())
- # 写入保留字r0 r1
- result.append(0x00)
- result.append(0x00)
- return bytes(result)
- # 创建CmdState实例的函数
- def NewCmdState():
- """创建系统状态命令实例"""
- return CmdState()
|