Skip to content

Commit 7192c70

Browse files
codestyle unification
1 parent 6e22665 commit 7192c70

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

UNOR4USBBridge/cmds_esp_generic.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "at_handler.h"
55
extern "C" {
6-
#include "esp32-hal-tinyusb.h"
6+
#include "esp32-hal-tinyusb.h"
77
}
88

99
void CAtHandler::add_cmds_esp_generic() {
@@ -52,22 +52,22 @@ void CAtHandler::add_cmds_esp_generic() {
5252
return chAT::CommandStatus::OK;
5353
}
5454
default:
55-
return chAT::CommandStatus::ERROR;
55+
return chAT::CommandStatus::ERROR;
5656
}
5757
};
5858

59-
/* ....................................................................... */
59+
/* ....................................................................... */
6060
command_table[_FWVERSION] = [this](auto & srv, auto & parser) {
6161
/* ....................................................................... */
6262
switch (parser.cmd_mode) {
6363
case chAT::CommandMode::Read: {
6464
srv.write_response_prompt();
65-
srv.write_cstr(ESP_FW_VERSION);
65+
srv.write_cstr(ESP_FW_VERSION);
6666
srv.write_line_end();
6767
return chAT::CommandStatus::OK;
6868
}
6969
default:
70-
return chAT::CommandStatus::ERROR;
70+
return chAT::CommandStatus::ERROR;
7171
}
7272
};
7373

@@ -82,19 +82,19 @@ void CAtHandler::add_cmds_esp_generic() {
8282

8383
auto &type_str = parser.args[0];
8484
if (type_str.empty()) {
85-
return chAT::CommandStatus::ERROR;
85+
return chAT::CommandStatus::ERROR;
8686
}
8787
int _type = atoi(type_str.c_str());
8888

8989
auto &operation_str = parser.args[1];
9090
if (operation_str.empty()) {
91-
return chAT::CommandStatus::ERROR;
91+
return chAT::CommandStatus::ERROR;
9292
}
9393
uint8_t operation = atoi(operation_str.c_str());
9494

9595
auto &filename = parser.args[2];
9696
if (filename.empty()) {
97-
return chAT::CommandStatus::ERROR;
97+
return chAT::CommandStatus::ERROR;
9898
}
9999

100100
FILE* f;
@@ -119,7 +119,7 @@ void CAtHandler::add_cmds_esp_generic() {
119119
std::vector<uint8_t> data_received;
120120
data_received = srv.inhibit_read(size);
121121
size_t offset = data_received.size();
122-
122+
123123
if(offset < size) {
124124

125125
data_received.resize(size);
@@ -134,7 +134,7 @@ void CAtHandler::add_cmds_esp_generic() {
134134
}
135135
int res = file.write(data_received.data(), data_received.size());
136136
if(res == 0){
137-
return chAT::CommandStatus::ERROR;
137+
return chAT::CommandStatus::ERROR;
138138
}
139139

140140
file.close();
@@ -186,7 +186,7 @@ void CAtHandler::add_cmds_esp_generic() {
186186
return chAT::CommandStatus::OK;
187187
}
188188
case WIFI_FILE_APPEND: {
189-
uint8_t size = 0;
189+
uint8_t size = 0;
190190
if (parser.args.size() >= 3) {
191191
auto &size_str = parser.args[3];
192192
if (size_str.empty()) {
@@ -200,7 +200,7 @@ void CAtHandler::add_cmds_esp_generic() {
200200
std::vector<uint8_t> data_received;
201201
data_received = srv.inhibit_read(size);
202202
size_t offset = data_received.size();
203-
203+
204204
if(offset < size) {
205205

206206
data_received.resize(size);
@@ -216,12 +216,12 @@ void CAtHandler::add_cmds_esp_generic() {
216216

217217
int res = file.write(data_received.data(), data_received.size());
218218
if(res == 0){
219-
return chAT::CommandStatus::ERROR;
219+
return chAT::CommandStatus::ERROR;
220220
}
221221

222222
file.close();
223223
srv.continue_read();
224-
224+
225225
return chAT::CommandStatus::OK;
226226
}
227227
default:
@@ -239,14 +239,14 @@ void CAtHandler::add_cmds_esp_generic() {
239239
command_table[_MOUNTFS] = [this](auto & srv, auto & parser) {
240240
/* ....................................................................... */
241241
switch (parser.cmd_mode) {
242-
case chAT::CommandMode::Write: {
243-
if (parser.args.size() != 1) {
242+
case chAT::CommandMode::Write: {
243+
if (parser.args.size() != 1) {
244244
return chAT::CommandStatus::ERROR;
245245
}
246246

247247
auto &format_on_fault = parser.args[0];
248248
if (format_on_fault.empty()) {
249-
return chAT::CommandStatus::ERROR;
249+
return chAT::CommandStatus::ERROR;
250250
}
251251
int _fof = atoi(format_on_fault.c_str());
252252
if(!SPIFFS.begin(_fof)){
@@ -277,7 +277,7 @@ void CAtHandler::add_cmds_esp_generic() {
277277
for (int i = 0; i < MAX_CLIENT_AVAILABLE; i++) {
278278
serverClients[i].client.stop();
279279
}
280-
280+
281281
for (int i = 0; i < MAX_SERVER_AVAILABLE; i++) {
282282
if (serverWiFi[i] != nullptr) {
283283
serverWiFi[i]->end();
@@ -305,7 +305,7 @@ void CAtHandler::add_cmds_esp_generic() {
305305
clients[i] = nullptr;
306306
}
307307
}
308-
308+
309309
clients_num = 0;
310310

311311
for (int i = 0; i < MAX_CLIENT_AVAILABLE; i++) {
@@ -323,15 +323,15 @@ void CAtHandler::add_cmds_esp_generic() {
323323

324324
WiFi.disconnect();
325325
WiFi.softAPdisconnect();
326-
326+
327327
srv.write_response_prompt();
328328
srv.write_line_end();
329329
return chAT::CommandStatus::OK;
330330
}
331331
default:
332332
return chAT::CommandStatus::ERROR;
333-
}
333+
}
334334
};
335335
}
336336

337-
#endif
337+
#endif

0 commit comments

Comments
 (0)