BxCmdCode.py 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. class CmdCode:
  2. def __init__(self, name, group, code):
  3. self.name = name
  4. self.group = group
  5. self.code = code
  6. # 命令常量定义
  7. CMD_ACK = CmdCode("ack", 0xa0, 0x00)
  8. CMD_NACK = CmdCode("nack", 0xa0, 0x01)
  9. CMD_DEL_FILE = CmdCode("delete file", 0xa1, 0x01)
  10. CMD_SYSTEM_STATE = CmdCode("system state", 0xa1, 0x02)
  11. CMD_SYSTEM_PING = CmdCode("ping", 0xa2, 0x00)
  12. CMD_SYSTEM_HEARTBEAT = CmdCode("system heartbeat", 0xa4, 0x07)
  13. CMD_START_WRITE_FILE = CmdCode("start write file", 0xa1, 0x05)
  14. CMD_WRITE_FILE = CmdCode("write file", 0xa1, 0x06)
  15. CMD_WRITE_TRANS_START = CmdCode("start write trans", 0xa1, 0x07)
  16. CMD_WRITE_TRANS_STOP = CmdCode("stop the write trans", 0xa1, 0x08)
  17. CMD_WRITE_CUSTOMER_INFO = CmdCode("write customer information", 0xa1, 0x09)
  18. CMD_GET_FILE_INTO = CmdCode("get file information", 0xa1, 0x0a)
  19. CMD_GET_FILE_CONTENT = CmdCode("get file content", 0xa1, 0x0b)
  20. CMD_SYSTEM_CLOCK_CORRECT = CmdCode("system clock correct", 0xa2, 0x03)
  21. CMD_READ_PARAMS = CmdCode("read params", 0xa2, 0x0a)
  22. CMD_SOUND = CmdCode("add sound", 0xa2, 0x0e)
  23. CMD_TURN_ON_OFF = CmdCode("turn on/off screen", 0xa3, 0x00)
  24. CMD_TIMING_SWITCH = CmdCode("auto turn on/off screen", 0xa3, 0x01)
  25. CMD_SCREEN_BRIGHTNESS = CmdCode("set brightness", 0xa3, 0x02)
  26. CMD_LOCK_UNLOCK = CmdCode("lock or unlock program", 0xa3, 0x04)
  27. CMD_SEND_DYNAMIC_AREA = CmdCode("send dynamic area", 0xa3, 0x06)
  28. CMD_DEL_DYNAMIC_AREA = CmdCode("delete dynamic area", 0xa3, 0x07)
  29. CMD_CANCEL_TIMING_SWITCH = CmdCode("cancel auto turn on/off screen", 0xa3, 0x08)
  30. CMD_CLEAR_SCREEN = CmdCode("clear the screen", 0xa3, 0x10)