8 #define MAX_COMMAND_LENGTH 16 9 #define MAX_STATUS_LENGTH 32 12 #define COMMAND_INFO_OK_ID 100 13 #define COMMAND_INFO_OK "OK" 14 #define COMMAND_INFO_OK_WITH_TEXT_ID 101 15 #define COMMAND_INFO_OK_WITH_TEXT "OK WITH TEXT" 16 #define COMMAND_INFO_XMODEM_WAIT_ID 110 17 #define COMMAND_INFO_XMODEM_WAIT "WAITING FOR XMODEM" 18 #define COMMAND_INFO_FALSE_ID 120 19 #define COMMAND_INFO_FALSE "FALSE" 20 #define COMMAND_INFO_TRUE_ID 121 21 #define COMMAND_INFO_TRUE "TRUE" 22 #define COMMAND_ERR_UNKNOWN_CMD_ID 200 23 #define COMMAND_ERR_UNKNOWN_CMD "UNKNOWN COMMAND" 24 #define COMMAND_ERR_INVALID_USAGE_ID 201 25 #define COMMAND_ERR_INVALID_USAGE "INVALID COMMAND USAGE" 26 #define COMMAND_ERR_INVALID_PARAM_ID 202 27 #define COMMAND_ERR_INVALID_PARAM "INVALID PARAMETER" 28 #define COMMAND_ERR_TIMEOUT_ID 203 29 #define COMMAND_ERR_TIMEOUT "TIMEOUT" 30 #define TIMEOUT_COMMAND 255 // this is just for the CommandLine module to know that this is a timeout command 33 #define COMMAND_CHAR_TRUE '1' 34 #define COMMAND_CHAR_FALSE '0' 35 #define COMMAND_CHAR_SUGGEST '?' 37 #define COMMAND_UID_BUFSIZE 32 39 #define COMMAND_IS_SUGGEST_STRING(x) ( ((x)[0] == COMMAND_CHAR_SUGGEST) && ((x)[1] == '\0') ) 41 typedef uint8_t CommandStatusIdType;
42 typedef const char CommandStatusMessageType[MAX_STATUS_LENGTH];
44 typedef CommandStatusIdType(*CommandExecFuncType)(
char *OutMessage);
45 typedef CommandStatusIdType(*CommandExecParamFuncType)(
char *OutMessage,
const char *InParams);
46 typedef CommandStatusIdType(*CommandSetFuncType)(
char *OutMessage,
const char *InParam);
47 typedef CommandStatusIdType(*CommandGetFuncType)(
char *OutParam);
50 char Command[MAX_COMMAND_LENGTH];
51 CommandExecFuncType ExecFunc;
52 CommandExecParamFuncType ExecParamFunc;
53 CommandSetFuncType SetFunc;
54 CommandGetFuncType GetFunc;
57 #define COMMAND_VERSION "VERSION" 58 CommandStatusIdType CommandGetVersion(
char *OutParam);
60 #define COMMAND_CONFIG "CONFIG" 61 CommandStatusIdType CommandGetConfig(
char *OutParam);
62 CommandStatusIdType CommandSetConfig(
char *OutMessage,
const char *InParam);
64 #define COMMAND_UID "UID" 65 #define COMMAND_UID_RANDOM "RANDOM" 66 CommandStatusIdType CommandGetUid(
char *OutParam);
67 CommandStatusIdType CommandSetUid(
char *OutMessage,
const char *InParam);
69 #define COMMAND_READONLY "READONLY" 70 CommandStatusIdType CommandGetReadOnly(
char *OutParam);
71 CommandStatusIdType CommandSetReadOnly(
char *OutMessage,
const char *InParam);
73 #define COMMAND_UPLOAD "UPLOAD" 74 CommandStatusIdType CommandExecUpload(
char *OutMessage);
76 #define COMMAND_DOWNLOAD "DOWNLOAD" 77 CommandStatusIdType CommandExecDownload(
char *OutMessage);
79 #define COMMAND_RESET "RESET" 80 CommandStatusIdType CommandExecReset(
char *OutMessage);
82 #define COMMAND_UPGRADE "UPGRADE" 83 CommandStatusIdType CommandExecUpgrade(
char *OutMessage);
85 #define COMMAND_MEMSIZE "MEMSIZE" 86 CommandStatusIdType CommandGetMemSize(
char *OutParam);
88 #define COMMAND_UIDSIZE "UIDSIZE" 89 CommandStatusIdType CommandGetUidSize(
char *OutParam);
91 #define COMMAND_RBUTTON "RBUTTON" 92 CommandStatusIdType CommandGetRButton(
char *OutParam);
93 CommandStatusIdType CommandSetRButton(
char *OutMessage,
const char *InParam);
95 #define COMMAND_RBUTTON_LONG "RBUTTON_LONG" 96 CommandStatusIdType CommandGetRButtonLong(
char *OutParam);
97 CommandStatusIdType CommandSetRButtonLong(
char *OutMessage,
const char *InParam);
99 #define COMMAND_LBUTTON "LBUTTON" 100 CommandStatusIdType CommandGetLButton(
char *OutParam);
101 CommandStatusIdType CommandSetLButton(
char *OutMessage,
const char *InParam);
103 #define COMMAND_LBUTTON_LONG "LBUTTON_LONG" 104 CommandStatusIdType CommandGetLButtonLong(
char *OutParam);
105 CommandStatusIdType CommandSetLButtonLong(
char *OutMessage,
const char *InParam);
108 #define COMMAND_LEDGREEN "LEDGREEN" 109 CommandStatusIdType CommandGetLedGreen(
char *OutParam);
110 CommandStatusIdType CommandSetLedGreen(
char *OutMessage,
const char *InParam);
112 #define COMMAND_LEDRED "LEDRED" 113 CommandStatusIdType CommandGetLedRed(
char *OutParam);
114 CommandStatusIdType CommandSetLedRed(
char *OutMessage,
const char *InParam);
116 #define COMMAND_PIN "PIN" 117 CommandStatusIdType CommandGetPin(
char *OutParam);
118 CommandStatusIdType CommandSetPin(
char *OutMessage,
const char *InParam);
120 #define COMMAND_LOGMODE "LOGMODE" 121 CommandStatusIdType CommandGetLogMode(
char *OutParam);
122 CommandStatusIdType CommandSetLogMode(
char *OutMessage,
const char *InParam);
124 #define COMMAND_LOGMEM "LOGMEM" 125 CommandStatusIdType CommandGetLogMem(
char *OutParam);
127 #define COMMAND_LOGDOWNLOAD "LOGDOWNLOAD" 128 CommandStatusIdType CommandExecLogDownload(
char *OutMessage);
130 #define COMMAND_STORELOG "LOGSTORE" 131 CommandStatusIdType CommandExecStoreLog(
char *OutMessage);
133 #define COMMAND_LOGCLEAR "LOGCLEAR" 134 CommandStatusIdType CommandExecLogClear(
char *OutMessage);
136 #define COMMAND_SETTING "SETTING" 137 CommandStatusIdType CommandGetSetting(
char *OutParam);
138 CommandStatusIdType CommandSetSetting(
char *OutMessage,
const char *InParam);
140 #define COMMAND_CLEAR "CLEAR" 141 CommandStatusIdType CommandExecClear(
char *OutMessage);
143 #define COMMAND_STORE "STORE" 144 CommandStatusIdType CommandExecStore(
char *OutMessage);
146 #define COMMAND_RECALL "RECALL" 147 CommandStatusIdType CommandExecRecall(
char *OutMessage);
149 #define COMMAND_CHARGING "CHARGING" 150 CommandStatusIdType CommandGetCharging(
char *OutParam);
152 #define COMMAND_HELP "HELP" 153 CommandStatusIdType CommandExecHelp(
char *OutMessage);
155 #define COMMAND_RSSI "RSSI" 156 CommandStatusIdType CommandGetRssi(
char *OutParam);
158 #define COMMAND_SYSTICK "SYSTICK" 159 CommandStatusIdType CommandGetSysTick(
char *OutParam);
161 #define COMMAND_SEND_RAW "SEND_RAW" 162 CommandStatusIdType CommandExecParamSendRaw(
char *OutMessage,
const char *InParams);
164 #define COMMAND_SEND "SEND" 165 CommandStatusIdType CommandExecParamSend(
char *OutMessage,
const char *InParams);
167 #define COMMAND_GETUID "GETUID" 168 CommandStatusIdType CommandExecGetUid(
char *OutMessage);
170 #define COMMAND_DUMP_MFU "DUMP_MFU" 171 CommandStatusIdType CommandExecDumpMFU(
char *OutMessage);
173 #define COMMAND_CLONE_MFU "CLONE_MFU" 174 CommandStatusIdType CommandExecCloneMFU(
char *OutMessage);
176 #define COMMAND_IDENTIFY_CARD "IDENTIFY" 177 CommandStatusIdType CommandExecIdentifyCard(
char *OutMessage);
179 #define COMMAND_TIMEOUT "TIMEOUT" 180 CommandStatusIdType CommandGetTimeout(
char *OutMessage);
181 CommandStatusIdType CommandSetTimeout(
char *OutMessage,
const char *InParam);
183 #define COMMAND_THRESHOLD "THRESHOLD" 184 CommandStatusIdType CommandGetThreshold(
char *OutParam);
185 CommandStatusIdType CommandSetThreshold(
char *OutMessage,
const char *InParam);
187 #define COMMAND_AUTOCALIBRATE "AUTOCALIBRATE" 188 CommandStatusIdType CommandExecAutocalibrate(
char *OutMessage);
190 #define COMMAND_FIELD "FIELD" 191 CommandStatusIdType CommandSetField(
char *OutMessage,
const char *InParam);
192 CommandStatusIdType CommandGetField(
char *OutMessage);
194 #define COMMAND_CLONE "CLONE" 195 CommandStatusIdType CommandExecClone(
char *OutMessage);
197 #ifdef CONFIG_ISO15693_SNIFF_SUPPORT 198 #define COMMAND_AUTOTHRESHOLD "AUTOTHRESHOLD" 199 CommandStatusIdType CommandGetAutoThreshold(
char *OutParam);
200 CommandStatusIdType CommandSetAutoThreshold(
char *OutMessage,
const char *InParam);
203 #ifdef ENABLE_RUNTESTS_TERMINAL_COMMAND 204 #include "../Tests/ChameleonTerminal.h" 207 #if defined(CONFIG_MF_DESFIRE_SUPPORT) && !defined(DISABLE_DESFIRE_TERMINAL_COMMANDS) 208 #include "../Application/DESFire/DESFireChameleonTerminal.h" 211 #define COMMAND_LIST_END ""