diff --git a/.astyleignore b/.astyleignore index 4c81f9d5ce..c047ab677e 100644 --- a/.astyleignore +++ b/.astyleignore @@ -21,7 +21,6 @@ rtos/TARGET_CORTEX/rtx5 TESTS/mbed_hal/trng/pithy targets components/802.15.4_RF -components/wifi components/TARGET_PSA/TARGET_TFM tools components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl diff --git a/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp b/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp index 5121243595..2e33400769 100644 --- a/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp +++ b/components/wifi/esp8266-driver/ESP8266/ESP8266.cpp @@ -100,7 +100,7 @@ bool ESP8266::at_available() _smutex.lock(); // Might take a while to respond after HW reset - for(int i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { ready = _parser.send("AT") && _parser.recv("OK\n"); if (ready) { @@ -195,7 +195,7 @@ bool ESP8266::start_uart_hw_flow_ctrl(void) if (done) { // Start board's flow control - _serial.set_flow_control(SerialBase::RTSCTS, _serial_rts, _serial_cts); + _serial.set_flow_control(SerialBase::RTSCTS, _serial_rts, _serial_cts); } } else if (_serial_rts != NC) { @@ -591,7 +591,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount) // Data stream can be truncated if (amount > 2048 && _sock_i[id].proto == NSAPI_TCP) { amount = 2048; - // Datagram must stay intact + // Datagram must stay intact } else if (amount > 2048 && _sock_i[id].proto == NSAPI_UDP) { tr_debug("UDP datagram maximum size is 2048"); return NSAPI_ERROR_PARAMETER; @@ -606,7 +606,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount) goto END; } - if(!_parser.recv(">")) { + if (!_parser.recv(">")) { tr_debug("ESP8266::send(): didn't get \">\""); ret = NSAPI_ERROR_WOULD_BLOCK; goto END; @@ -657,7 +657,7 @@ void ESP8266::_oob_packet_hdlr() return; } - if(_tcp_passive && _sock_i[id].open == true && _sock_i[id].proto == NSAPI_TCP) { + if (_tcp_passive && _sock_i[id].open == true && _sock_i[id].proto == NSAPI_TCP) { if (_parser.recv("%d\n", &amount)) { _sock_i[id].tcp_data_avbl = amount; @@ -726,7 +726,7 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t _process_oob(timeout, true); if (_sock_i[id].tcp_data_avbl != 0) { - _sock_i[id].tcp_data = (char*)data; + _sock_i[id].tcp_data = (char *)data; _sock_i[id].tcp_data_rcvd = NSAPI_ERROR_WOULD_BLOCK; _sock_active_id = id; @@ -735,7 +735,7 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t // NOTE: documentation v3.0 says '+CIPRECVDATA:,' but it's not how the FW responds... bool done = _parser.send("AT+CIPRECVDATA=%d,%lu", id, amount) - && _parser.recv("OK\n"); + && _parser.recv("OK\n"); _sock_i[id].tcp_data = NULL; _sock_active_id = -1; @@ -972,26 +972,26 @@ bool ESP8266::_recv_ap(nsapi_wifi_ap_t *ap) if (FW_AT_LEAST_VERSION(_at_v.major, _at_v.minor, _at_v.patch, 0, ESP8266_AT_VERSION_WIFI_SCAN_CHANGE)) { ret = _parser.recv("+CWLAP:(%d,\"%32[^\"]\",%hhd,\"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\",%hhu,%d,%d,%d,%d,%d,%d)\n", - &sec, - ap->ssid, - &ap->rssi, - &ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5], - &ap->channel, - &dummy, - &dummy, - &dummy, - &dummy, - &dummy, - &dummy); + &sec, + ap->ssid, + &ap->rssi, + &ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5], + &ap->channel, + &dummy, + &dummy, + &dummy, + &dummy, + &dummy, + &dummy); } else { ret = _parser.recv("+CWLAP:(%d,\"%32[^\"]\",%hhd,\"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\",%hhu,%d,%d)\n", - &sec, - ap->ssid, - &ap->rssi, - &ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5], - &ap->channel, - &dummy, - &dummy); + &sec, + ap->ssid, + &ap->rssi, + &ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5], + &ap->channel, + &dummy, + &dummy); } diff --git a/components/wifi/esp8266-driver/ESP8266Interface.cpp b/components/wifi/esp8266-driver/ESP8266Interface.cpp index a102c6be3b..296804cda0 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.cpp +++ b/components/wifi/esp8266-driver/ESP8266Interface.cpp @@ -183,7 +183,7 @@ void ESP8266Interface::_connect_async() _connect_event_id = _global_event_queue->call_in(ESP8266_CONNECT_TIMEOUT, callback(this, &ESP8266Interface::_connect_async)); if (!_connect_event_id) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \ - "ESP8266Interface::_connect_async(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); + "ESP8266Interface::_connect_async(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); } } _cmutex.unlock(); @@ -227,7 +227,7 @@ int ESP8266Interface::connect() if (!_connect_event_id) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \ - "connect(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); + "connect(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); } while (_if_blocking && (_conn_status_to_error() != NSAPI_ERROR_IS_CONNECTED) @@ -582,12 +582,12 @@ int ESP8266Interface::socket_send(void *handle, const void *data, unsigned size) status = _esp.send(socket->id, data, size); if (status == NSAPI_ERROR_WOULD_BLOCK - && socket->proto == NSAPI_TCP - && core_util_atomic_cas_u8(&_cbs[socket->id].deferred, &expect_false, true)) { + && socket->proto == NSAPI_TCP + && core_util_atomic_cas_u8(&_cbs[socket->id].deferred, &expect_false, true)) { tr_debug("Postponing SIGIO from the device"); if (!_global_event_queue->call_in(50, callback(this, &ESP8266Interface::event_deferred))) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \ - "socket_send(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); + "socket_send(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); } } else if (status == NSAPI_ERROR_WOULD_BLOCK && socket->proto == NSAPI_UDP) { @@ -741,7 +741,7 @@ void ESP8266Interface::event() _oob_event_id = _global_event_queue->call_in(50, callback(this, &ESP8266Interface::proc_oob_evnt)); if (!_oob_event_id) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \ - "ESP8266Interface::event(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); + "ESP8266Interface::event(): unable to add event to queue. Increase \"events.shared-eventsize\"\n"); } } @@ -821,8 +821,8 @@ void ESP8266Interface::refresh_conn_state_cb() void ESP8266Interface::proc_oob_evnt() { - _oob_event_id = 0; // Allows creation of a new event - _esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true); + _oob_event_id = 0; // Allows creation of a new event + _esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true); } nsapi_error_t ESP8266Interface::_conn_status_to_error()