File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,33 @@ void CAtHandler::add_cmds_preferences() {
200
200
}
201
201
};
202
202
203
+ /* ....................................................................... */
204
+ command_table[_PREF_TYPE] = [this ](auto & srv, auto & parser) {
205
+ /* ....................................................................... */
206
+ switch (parser.cmd_mode ) {
207
+ case chAT::CommandMode::Write: {
208
+ if (parser.args .size () != 1 ) {
209
+ return chAT::CommandStatus::ERROR;
210
+ }
211
+
212
+ auto &key = parser.args [0 ];
213
+ if (key.empty ()) {
214
+ return chAT::CommandStatus::ERROR;
215
+ }
216
+
217
+ String error = String (pref.getType (key.c_str ())) + " \r\n " ;
218
+
219
+ srv.write_response_prompt ();
220
+ srv.write_str ((const char *)(error.c_str ()));
221
+ srv.write_line_end ();
222
+ return chAT::CommandStatus::OK;
223
+
224
+ }
225
+ default :
226
+ return chAT::CommandStatus::ERROR;
227
+ }
228
+ };
229
+
203
230
/* ....................................................................... */
204
231
command_table[_PREF_GET] = [this ](auto & srv, auto & parser) {
205
232
/* ....................................................................... */
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ enum file_op {
130
130
#define _PREF_CLEAR "+PREFCLEAR"
131
131
#define _PREF_REMOVE "+PREFREMOVE"
132
132
#define _PREF_PUT "+PREFPUT"
133
+ #define _PREF_TYPE "+PREFTYPE"
133
134
#define _PREF_GET "+PREFGET"
134
135
#define _PREF_LEN "+PREFLEN"
135
136
#define _PREF_STAT "+PREFSTAT"
You can’t perform that action at this time.
0 commit comments