mirror of https://github.com/ARMmbed/mbed-os.git
ESP8266: astyle, remove from the .astyleignore-file
parent
7ed16fbd76
commit
c9eaa07236
|
|
@ -21,7 +21,6 @@ rtos/TARGET_CORTEX/rtx5
|
||||||
TESTS/mbed_hal/trng/pithy
|
TESTS/mbed_hal/trng/pithy
|
||||||
targets
|
targets
|
||||||
components/802.15.4_RF
|
components/802.15.4_RF
|
||||||
components/wifi
|
|
||||||
components/TARGET_PSA/TARGET_TFM
|
components/TARGET_PSA/TARGET_TFM
|
||||||
tools
|
tools
|
||||||
components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl
|
components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ bool ESP8266::at_available()
|
||||||
|
|
||||||
_smutex.lock();
|
_smutex.lock();
|
||||||
// Might take a while to respond after HW reset
|
// 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")
|
ready = _parser.send("AT")
|
||||||
&& _parser.recv("OK\n");
|
&& _parser.recv("OK\n");
|
||||||
if (ready) {
|
if (ready) {
|
||||||
|
|
@ -195,7 +195,7 @@ bool ESP8266::start_uart_hw_flow_ctrl(void)
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
// Start board's flow control
|
// 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) {
|
} 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
|
// Data stream can be truncated
|
||||||
if (amount > 2048 && _sock_i[id].proto == NSAPI_TCP) {
|
if (amount > 2048 && _sock_i[id].proto == NSAPI_TCP) {
|
||||||
amount = 2048;
|
amount = 2048;
|
||||||
// Datagram must stay intact
|
// Datagram must stay intact
|
||||||
} else if (amount > 2048 && _sock_i[id].proto == NSAPI_UDP) {
|
} else if (amount > 2048 && _sock_i[id].proto == NSAPI_UDP) {
|
||||||
tr_debug("UDP datagram maximum size is 2048");
|
tr_debug("UDP datagram maximum size is 2048");
|
||||||
return NSAPI_ERROR_PARAMETER;
|
return NSAPI_ERROR_PARAMETER;
|
||||||
|
|
@ -606,7 +606,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!_parser.recv(">")) {
|
if (!_parser.recv(">")) {
|
||||||
tr_debug("ESP8266::send(): didn't get \">\"");
|
tr_debug("ESP8266::send(): didn't get \">\"");
|
||||||
ret = NSAPI_ERROR_WOULD_BLOCK;
|
ret = NSAPI_ERROR_WOULD_BLOCK;
|
||||||
goto END;
|
goto END;
|
||||||
|
|
@ -657,7 +657,7 @@ void ESP8266::_oob_packet_hdlr()
|
||||||
return;
|
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)) {
|
if (_parser.recv("%d\n", &amount)) {
|
||||||
_sock_i[id].tcp_data_avbl = 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);
|
_process_oob(timeout, true);
|
||||||
|
|
||||||
if (_sock_i[id].tcp_data_avbl != 0) {
|
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_i[id].tcp_data_rcvd = NSAPI_ERROR_WOULD_BLOCK;
|
||||||
_sock_active_id = id;
|
_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:<data_len>,' but it's not how the FW responds...
|
// NOTE: documentation v3.0 says '+CIPRECVDATA:<data_len>,' but it's not how the FW responds...
|
||||||
bool done = _parser.send("AT+CIPRECVDATA=%d,%lu", id, amount)
|
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_i[id].tcp_data = NULL;
|
||||||
_sock_active_id = -1;
|
_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)) {
|
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",
|
ret = _parser.recv("+CWLAP:(%d,\"%32[^\"]\",%hhd,\"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\",%hhu,%d,%d,%d,%d,%d,%d)\n",
|
||||||
&sec,
|
&sec,
|
||||||
ap->ssid,
|
ap->ssid,
|
||||||
&ap->rssi,
|
&ap->rssi,
|
||||||
&ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5],
|
&ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5],
|
||||||
&ap->channel,
|
&ap->channel,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy);
|
&dummy);
|
||||||
} else {
|
} else {
|
||||||
ret = _parser.recv("+CWLAP:(%d,\"%32[^\"]\",%hhd,\"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\",%hhu,%d,%d)\n",
|
ret = _parser.recv("+CWLAP:(%d,\"%32[^\"]\",%hhd,\"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx\",%hhu,%d,%d)\n",
|
||||||
&sec,
|
&sec,
|
||||||
ap->ssid,
|
ap->ssid,
|
||||||
&ap->rssi,
|
&ap->rssi,
|
||||||
&ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5],
|
&ap->bssid[0], &ap->bssid[1], &ap->bssid[2], &ap->bssid[3], &ap->bssid[4], &ap->bssid[5],
|
||||||
&ap->channel,
|
&ap->channel,
|
||||||
&dummy,
|
&dummy,
|
||||||
&dummy);
|
&dummy);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ void ESP8266Interface::_connect_async()
|
||||||
_connect_event_id = _global_event_queue->call_in(ESP8266_CONNECT_TIMEOUT, callback(this, &ESP8266Interface::_connect_async));
|
_connect_event_id = _global_event_queue->call_in(ESP8266_CONNECT_TIMEOUT, callback(this, &ESP8266Interface::_connect_async));
|
||||||
if (!_connect_event_id) {
|
if (!_connect_event_id) {
|
||||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
|
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();
|
_cmutex.unlock();
|
||||||
|
|
@ -227,7 +227,7 @@ int ESP8266Interface::connect()
|
||||||
|
|
||||||
if (!_connect_event_id) {
|
if (!_connect_event_id) {
|
||||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
|
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)
|
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);
|
status = _esp.send(socket->id, data, size);
|
||||||
|
|
||||||
if (status == NSAPI_ERROR_WOULD_BLOCK
|
if (status == NSAPI_ERROR_WOULD_BLOCK
|
||||||
&& socket->proto == NSAPI_TCP
|
&& socket->proto == NSAPI_TCP
|
||||||
&& core_util_atomic_cas_u8(&_cbs[socket->id].deferred, &expect_false, true)) {
|
&& core_util_atomic_cas_u8(&_cbs[socket->id].deferred, &expect_false, true)) {
|
||||||
tr_debug("Postponing SIGIO from the device");
|
tr_debug("Postponing SIGIO from the device");
|
||||||
if (!_global_event_queue->call_in(50, callback(this, &ESP8266Interface::event_deferred))) {
|
if (!_global_event_queue->call_in(50, callback(this, &ESP8266Interface::event_deferred))) {
|
||||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
|
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) {
|
} 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));
|
_oob_event_id = _global_event_queue->call_in(50, callback(this, &ESP8266Interface::proc_oob_evnt));
|
||||||
if (!_oob_event_id) {
|
if (!_oob_event_id) {
|
||||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
|
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()
|
void ESP8266Interface::proc_oob_evnt()
|
||||||
{
|
{
|
||||||
_oob_event_id = 0; // Allows creation of a new event
|
_oob_event_id = 0; // Allows creation of a new event
|
||||||
_esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true);
|
_esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsapi_error_t ESP8266Interface::_conn_status_to_error()
|
nsapi_error_t ESP8266Interface::_conn_status_to_error()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue