Skip to content

Commit c0de743

Browse files
codestyle changes
1 parent aef6457 commit c0de743

File tree

5 files changed

+127
-127
lines changed

5 files changed

+127
-127
lines changed

UNOR4USBBridge/UNOR4USBBridge.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void ets_putc_handler(char c)
6161

6262
/* -------------------------------------------------------------------------- */
6363
void CAtHandler::onWiFiEvent(WiFiEvent_t event) {
64-
/* -------------------------------------------------------------------------- */
65-
switch (event) {
64+
/* -------------------------------------------------------------------------- */
65+
switch (event) {
6666
case ARDUINO_EVENT_WIFI_READY:
6767
wifi_status = WIFI_ST_IDLE_STATUS;
6868
break;
@@ -81,7 +81,7 @@ void CAtHandler::onWiFiEvent(WiFiEvent_t event) {
8181
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
8282
wifi_status = WIFI_ST_IDLE_STATUS;
8383
break;
84-
case ARDUINO_EVENT_WIFI_AP_START:
84+
case ARDUINO_EVENT_WIFI_AP_START:
8585
wifi_status = WIFI_ST_AP_LISTENING;
8686
break;
8787
case ARDUINO_EVENT_WIFI_AP_STOP:
@@ -91,7 +91,7 @@ void CAtHandler::onWiFiEvent(WiFiEvent_t event) {
9191
wifi_status = WIFI_ST_AP_CONNECTED;
9292
break;
9393
case ARDUINO_EVENT_WIFI_AP_STADISCONNECTED:
94-
94+
9595

9696
break;
9797
case ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED:
@@ -120,7 +120,7 @@ void atLoop(void* param) {
120120

121121
/* -------------------------------------------------------------------------- */
122122
void setup() {
123-
/* -------------------------------------------------------------------------- */
123+
/* -------------------------------------------------------------------------- */
124124

125125
/* redirect stdout */
126126
stdout = funopen(NULL, NULL, &write_fn, NULL, NULL);
@@ -184,7 +184,7 @@ static uint8_t buf[2048];
184184

185185
/* -------------------------------------------------------------------------- */
186186
void loop() {
187-
/* -------------------------------------------------------------------------- */
187+
/* -------------------------------------------------------------------------- */
188188

189189
if (SERIAL_USER.baudRate() != _baud) {
190190
_baud = SERIAL_USER.baudRate();

UNOR4USBBridge/at_handler.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,62 +22,62 @@ uint8_t CAtHandler::wifi_status = WIFI_ST_IDLE_STATUS;
2222
/* -------------------------------------------------------------------------- */
2323
CClientWrapper CAtHandler::getClient(int sock) {
2424
/* -------------------------------------------------------------------------- */
25-
CClientWrapper rv;
26-
27-
bool is_server = false;
28-
bool is_sslclienet = false;
29-
30-
int internal_sock = -1;
31-
32-
if(sock >= START_SSL_CLIENT_SOCK) {
33-
internal_sock = sock - START_SSL_CLIENT_SOCK;
34-
is_sslclienet = true;
35-
} else
36-
if(sock >= START_CLIENT_SERVER_SOCK) {
37-
internal_sock = sock - START_CLIENT_SERVER_SOCK;
38-
is_server = true;
39-
}
40-
else {
41-
internal_sock = sock;
42-
}
43-
44-
if(internal_sock < 0 || internal_sock >= MAX_CLIENT_AVAILABLE) {
45-
rv.client = nullptr;
46-
rv.sslclient = nullptr;
47-
rv.can_delete = -1;
48-
return rv;
49-
}
25+
CClientWrapper rv;
26+
27+
bool is_server = false;
28+
bool is_sslclienet = false;
29+
30+
int internal_sock = -1;
31+
32+
if(sock >= START_SSL_CLIENT_SOCK) {
33+
internal_sock = sock - START_SSL_CLIENT_SOCK;
34+
is_sslclienet = true;
35+
} else
36+
if(sock >= START_CLIENT_SERVER_SOCK) {
37+
internal_sock = sock - START_CLIENT_SERVER_SOCK;
38+
is_server = true;
39+
}
40+
else {
41+
internal_sock = sock;
42+
}
43+
44+
if(internal_sock < 0 || internal_sock >= MAX_CLIENT_AVAILABLE) {
45+
rv.client = nullptr;
46+
rv.sslclient = nullptr;
47+
rv.can_delete = -1;
48+
return rv;
49+
}
5050

51-
if (is_sslclienet) {
51+
if (is_sslclienet) {
5252
rv.sslclient = sslclients[internal_sock];
5353
rv.can_delete = internal_sock;
54-
}
55-
else if(is_server) {
54+
}
55+
else if(is_server) {
5656
rv.client = &serverClients[internal_sock].client;
5757
rv.can_delete = -1;
58-
}
59-
else {
58+
}
59+
else {
6060
rv.client = clients[internal_sock];
6161
rv.can_delete = internal_sock;
62-
}
63-
return rv;
62+
}
63+
return rv;
6464
}
6565

6666

6767

6868
/* -------------------------------------------------------------------------- */
6969
void CAtHandler::run() {
70-
/* -------------------------------------------------------------------------- */
71-
at_srv.run();
72-
vTaskDelay(1);
70+
/* -------------------------------------------------------------------------- */
71+
at_srv.run();
72+
vTaskDelay(1);
7373
}
7474

7575

7676

7777
/* -------------------------------------------------------------------------- */
7878
CAtHandler::CAtHandler(HardwareSerial *s) : last_server_client_sock(0) {
79-
/* -------------------------------------------------------------------------- */
80-
79+
/* -------------------------------------------------------------------------- */
80+
8181
for(int i = 0; i < MAX_CLIENT_AVAILABLE; i++) {
8282
clients[i] = nullptr;
8383
}
@@ -119,16 +119,16 @@ CAtHandler::CAtHandler(HardwareSerial *s) : last_server_client_sock(0) {
119119

120120
if (it == command_table.end()) {
121121
return chAT::CommandStatus::ERROR;
122-
}
122+
}
123123
else {
124124
return it->second(srv, srv.parser());
125125
}
126126
});
127127

128-
/* SET UP COMMAND TABLE */
128+
/* SET UP COMMAND TABLE */
129129
add_cmds_esp_generic();
130130
add_cmds_wifi_station();
131-
add_cmds_wifi_softAP();
131+
add_cmds_wifi_softAP();
132132
add_cmds_wifi_SSL();
133133
add_cmds_wifi_netif();
134134
add_cmds_wifi_udp();

UNOR4USBBridge/at_handler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class CServerClient {
5454

5555
class CAtHandler {
5656
private:
57-
static uint8_t wifi_status;
57+
static uint8_t wifi_status;
5858

5959
int last_server_client_sock;
60-
60+
6161
WiFiUDP * udps[MAX_UDP_AVAILABLE];
6262
WiFiServer * serverWiFi[MAX_SERVER_AVAILABLE];
6363
WiFiClient * clients[MAX_CLIENT_AVAILABLE];
@@ -80,8 +80,8 @@ class CAtHandler {
8080
CClientWrapper getClient(int sock);
8181

8282
void add_cmds_esp_generic();
83-
void add_cmds_wifi_station();
84-
void add_cmds_wifi_softAP();
83+
void add_cmds_wifi_station();
84+
void add_cmds_wifi_softAP();
8585
void add_cmds_wifi_SSL();
8686
void add_cmds_wifi_netif();
8787
void add_cmds_wifi_udp();

UNOR4USBBridge/cmds_ota.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Arduino_UNOWIFIR4_OTA OTA;
1010
void CAtHandler::add_cmds_ota() {
1111
/* ....................................................................... */
1212
command_table[_OTA_SETCAROOT] = [this](auto & srv, auto & parser) {
13-
/* ....................................................................... */
13+
/* ....................................................................... */
1414
switch (parser.cmd_mode) {
1515
case chAT::CommandMode::Write: {
1616
if (parser.args.size() != 1) {
@@ -26,7 +26,7 @@ void CAtHandler::add_cmds_ota() {
2626
if(!ca_root_size) {
2727
return chAT::CommandStatus::ERROR;
2828
}
29-
29+
3030
ota_cert_buf = srv.inhibit_read(ca_root_size);
3131
size_t offset = ota_cert_buf.size();
3232
if(offset < ca_root_size) {
@@ -40,7 +40,7 @@ void CAtHandler::add_cmds_ota() {
4040
return chAT::CommandStatus::OK;
4141
}
4242
default:
43-
return chAT::CommandStatus::ERROR;
43+
return chAT::CommandStatus::ERROR;
4444
}
4545
};
4646

@@ -60,7 +60,7 @@ void CAtHandler::add_cmds_ota() {
6060
if (parser.args.size() != 1) {
6161
return chAT::CommandStatus::ERROR;
6262
}
63-
63+
6464
auto &path = parser.args[0];
6565
if (path.empty()) {
6666
return chAT::CommandStatus::ERROR;
@@ -89,7 +89,7 @@ void CAtHandler::add_cmds_ota() {
8989
if (url.empty()) {
9090
return chAT::CommandStatus::ERROR;
9191
}
92-
92+
9393
int ota_error = OTA.download(url.c_str());
9494
String error = String((int)ota_error) + "\r\n";
9595
srv.write_response_prompt();
@@ -156,7 +156,7 @@ void CAtHandler::add_cmds_ota() {
156156
if (parser.args.size() != 1) {
157157
return chAT::CommandStatus::ERROR;
158158
}
159-
159+
160160
auto &path = parser.args[0];
161161
if (path.empty()) {
162162
return chAT::CommandStatus::ERROR;

0 commit comments

Comments
 (0)