sync
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
VERSION = {
|
||||
"min_protocol_version": 1,
|
||||
"max_protocol_version": 1,
|
||||
"current_protocol_version": None
|
||||
"current_protocol_version": None,
|
||||
}
|
||||
|
||||
SYNC_SEQ = b'BUZZ'
|
||||
@@ -33,56 +33,45 @@ ERRORS = {
|
||||
0x40: "NOT_IMPLEMENTED",
|
||||
}
|
||||
|
||||
FRAME_TYPE_REQUEST = 0x01
|
||||
FRAME_TYPE_ACK = 0x10
|
||||
FRAME_TYPE_RESPONSE = 0x11
|
||||
FRAME_TYPE_STREAM_START = 0x12
|
||||
FRAME_TYPE_STREAM_CHUNK = 0x13
|
||||
FRAME_TYPE_STREAM_END = 0x14
|
||||
FRAME_TYPE_LIST_START = 0x15
|
||||
FRAME_TYPE_LIST_CHUNK = 0x16
|
||||
FRAME_TYPE_LIST_END = 0x17
|
||||
FRAME_TYPE_ERROR = 0xFF
|
||||
|
||||
FRAME_TYPES = {
|
||||
'request': FRAME_TYPE_REQUEST,
|
||||
'ack': FRAME_TYPE_ACK,
|
||||
'response': FRAME_TYPE_RESPONSE,
|
||||
'error': FRAME_TYPE_ERROR,
|
||||
'stream_start': FRAME_TYPE_STREAM_START,
|
||||
'stream_chunk': FRAME_TYPE_STREAM_CHUNK,
|
||||
'stream_end': FRAME_TYPE_STREAM_END,
|
||||
'list_start': FRAME_TYPE_LIST_START,
|
||||
'list_chunk': FRAME_TYPE_LIST_CHUNK,
|
||||
'list_end': FRAME_TYPE_LIST_END
|
||||
'request': 0x01,
|
||||
|
||||
'ack': 0x10,
|
||||
|
||||
'response': 0x11,
|
||||
'stream_start': 0x12,
|
||||
'stream_chunk': 0x13,
|
||||
'stream_end': 0x14,
|
||||
'list_start': 0x15,
|
||||
'list_chunk': 0x16,
|
||||
'list_end': 0x17,
|
||||
|
||||
'error': 0xFF,
|
||||
}
|
||||
|
||||
CMD_GET_PROTOCOL_VERSION = 0x00
|
||||
CMD_GET_FIRMWARE_STATUS = 0x01
|
||||
CMD_GET_FLASH_INFO = 0x02
|
||||
|
||||
CMD_LIST_DIR = 0x10
|
||||
CMD_CRC_32 = 0x11
|
||||
CMD_MKDIR = 0x12
|
||||
CMD_RM = 0x13
|
||||
CMD_STAT = 0x18
|
||||
CMD_RENAME = 0x19
|
||||
|
||||
CMD_PUT_FILE = 0x20
|
||||
CMD_PUT_FW = 0x21
|
||||
CMD_GET_FILE = 0x22
|
||||
|
||||
COMMANDS = {
|
||||
'get_protocol_version': CMD_GET_PROTOCOL_VERSION,
|
||||
'get_firmware_status': CMD_GET_FIRMWARE_STATUS,
|
||||
'get_flash_info': CMD_GET_FLASH_INFO,
|
||||
'list_dir': CMD_LIST_DIR,
|
||||
'stat': CMD_STAT,
|
||||
'rm': CMD_RM,
|
||||
'rename': CMD_RENAME,
|
||||
'mkdir': CMD_MKDIR,
|
||||
'crc_32': CMD_CRC_32,
|
||||
'put_file': CMD_PUT_FILE,
|
||||
'get_file': CMD_GET_FILE,
|
||||
'put_fw': CMD_PUT_FW,
|
||||
'get_protocol_version': 0x00,
|
||||
'get_firmware_status': 0x01,
|
||||
'get_flash_info': 0x02,
|
||||
'confirm_fw': 0x03,
|
||||
'reboot': 0x04,
|
||||
|
||||
'list_dir': 0x10,
|
||||
'crc_32': 0x11,
|
||||
'mkdir': 0x12,
|
||||
'rm': 0x13,
|
||||
'stat': 0x18,
|
||||
'rename': 0x19,
|
||||
|
||||
'put_file': 0x20,
|
||||
'put_fw': 0x21,
|
||||
'get_file': 0x22,
|
||||
'put_tags': 0x24,
|
||||
'get_tags': 0x25,
|
||||
|
||||
'play': 0x30,
|
||||
'stop': 0x31,
|
||||
|
||||
'set_setting': 0x40,
|
||||
'get_setting': 0x41,
|
||||
}
|
||||
Reference in New Issue
Block a user