SAKURA Internet / SakuraIO Featured

Dependents:   patlite_sakuraio sakuraio_lte_firmwareupdater shownet2017-iinebutton patlite_sakuraio_stack ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers commands.h Source File

commands.h

00001 /* SAKURA Internet IoT Communication Module Library for mbed
00002  *
00003  * The MIT License (MIT)
00004  *
00005  * Copyright (c) SAKURA Internet Inc.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a copy
00008  * of this software and associated documentation files (the "Software"),
00009  * to deal in the Software without restriction, including without limitation
00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the Software
00012  * is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00018  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00020  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00021  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00022  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 // Common
00026 #define CMD_GET_CONNECTION_STATUS 0x01
00027 #define CMD_GET_SIGNAL_QUALITY    0x02
00028 #define CMD_GET_DATETIME          0x03
00029 #define CMD_ECHO_BACK             0x0f
00030 
00031 // IO
00032 #define CMD_READ_ADC  0x10
00033 
00034 // Transmit
00035 #define CMD_TX_ENQUEUE      0x20
00036 #define CMD_TX_SENDIMMED    0x21
00037 #define CMD_TX_LENGTH       0x22
00038 #define CMD_TX_CLEAR        0x23
00039 #define CMD_TX_SEND         0x24
00040 #define CMD_TX_STAT         0x25
00041 
00042 // Receive
00043 #define CMD_RX_DEQUEUE      0x30
00044 #define CMD_RX_PEEK         0x31
00045 #define CMD_RX_LENGTH       0x32
00046 #define CMD_RX_CLEAR        0x33
00047 
00048 // File Download
00049 #define CMD_START_FILE_DOWNLOAD       0x40
00050 #define CMD_GET_FILE_METADATA         0x41
00051 #define CMD_GET_FILE_DOWNLOAD_STATUS  0x42
00052 #define CMD_CANCEL_FILE_DOWNLOAD      0x43
00053 #define CMD_GET_FILE_DATA             0x44
00054 
00055 // Operation
00056 #define CMD_GET_PRODUCT_ID              0xA0
00057 #define CMD_GET_UNIQUE_ID               0xA1
00058 #define CMD_GET_FIRMWARE_VERSION        0xA2
00059 #define CMD_UNLOCK                      0xA8
00060 #define CMD_UPDATE_FIRMWARE             0xA9
00061 #define CMD_GET_UPDATE_FIRMWARE_STATUS  0xAA
00062 #define CMD_SOFTWARE_RESET              0xAF
00063 
00064 #define CMD_SET_POWER_SAVE_MODE         0xB0
00065 #define CMD_GET_POWER_SAVE_MODE         0xB1
00066 
00067 
00068 // Response
00069 #define CMD_ERROR_NONE             0x01
00070 #define CMD_ERROR_PARITY           0x02
00071 #define CMD_ERROR_MISSING          0x03
00072 #define CMD_ERROR_INVALID_SYNTAX   0x04
00073 #define CMD_ERROR_RUNTIME          0x05
00074 #define CMD_ERROR_LOCKED           0x06
00075 #define CMD_ERROR_BUSY             0x07
00076 
00077 
00078 // FileStatus
00079 #define FILE_STATUS_ERROR           0x01
00080 #define FILE_STATUS_INVALID_REQUEST 0x02
00081 #define FILE_STATUS_NOTFOUND        0x81
00082 #define FILE_STATUS_SERVER_ERROR    0x82
00083 #define FILE_STATUS_INVALID_DATA    0x83