@@ -116,7 +116,7 @@ bool ESP8266::at_available()
116
116
if (ready) {
117
117
break ;
118
118
}
119
- tr_debug (" waiting AT response" );
119
+ tr_debug (" at_available(): Waiting AT response. " );
120
120
}
121
121
_smutex.unlock ();
122
122
@@ -227,7 +227,7 @@ bool ESP8266::start_uart_hw_flow_ctrl(void)
227
227
_smutex.unlock ();
228
228
229
229
if (!done) {
230
- tr_debug (" Enable UART HW flow control: FAIL" );
230
+ tr_debug (" start_uart_hw_flow_ctrl(): Enable UART HW flow control: FAIL. " );
231
231
}
232
232
#else
233
233
if (_serial_rts != NC || _serial_cts != NC) {
@@ -268,7 +268,7 @@ bool ESP8266::reset(void)
268
268
set_timeout (ESP8266_RECV_TIMEOUT);
269
269
for (int i = 0 ; i < 2 ; i++) {
270
270
if (!_parser.send (" AT+RST" ) || !_parser.recv (" OK\n " )) {
271
- tr_debug (" reset(): AT+RST failed or no response" );
271
+ tr_debug (" reset(): AT+RST failed or no response. " );
272
272
continue ;
273
273
}
274
274
@@ -285,7 +285,7 @@ bool ESP8266::reset(void)
285
285
}
286
286
}
287
287
288
- tr_debug (" reset(): done : %s" , done ? " OK" : " FAIL" );
288
+ tr_debug (" reset(): Done : %s. " , done ? " OK" : " FAIL" );
289
289
290
290
_clear_socket_packets (ESP8266_ALL_SOCKET_IDS);
291
291
set_timeout ();
@@ -484,7 +484,7 @@ int ESP8266::scan(WiFiAccessPoint *res, unsigned limit, scan_mode mode, unsigned
484
484
}
485
485
486
486
if (!(ret_parse_send && _parser.recv (" OK\n " ))) {
487
- tr_warning (" scan(): AP info parsing aborted" );
487
+ tr_warning (" scan(): AP info parsing aborted. " );
488
488
// Lets be happy about partial success and not return NSAPI_ERROR_DEVICE_ERROR
489
489
if (!_scan_r.cnt ) {
490
490
_scan_r.cnt = NSAPI_ERROR_DEVICE_ERROR;
@@ -547,7 +547,7 @@ nsapi_error_t ESP8266::open_udp(int id, const char *addr, int port, int local_po
547
547
548
548
_smutex.unlock ();
549
549
550
- tr_debug (" UDP socket %d opened: %s" , id, (_sock_i[id].open ? " true" : " false" ));
550
+ tr_debug (" open_udp(): UDP socket %d opened: %s. " , id, (_sock_i[id].open ? " true" : " false" ));
551
551
552
552
return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
553
553
}
@@ -598,7 +598,7 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv
598
598
599
599
_smutex.unlock ();
600
600
601
- tr_debug (" TCP socket %d opened: %s" , id, (_sock_i[id].open ? " true" : " false" ));
601
+ tr_debug (" open_tcp: TCP socket %d opened: %s . " , id, (_sock_i[id].open ? " true" : " false" ));
602
602
603
603
return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
604
604
}
@@ -621,7 +621,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
621
621
amount = 2048 ;
622
622
// Datagram must stay intact
623
623
} else if (amount > 2048 && _sock_i[id].proto == NSAPI_UDP) {
624
- tr_debug (" UDP datagram maximum size is 2048" );
624
+ tr_debug (" send(): UDP datagram maximum size is 2048 . " );
625
625
return NSAPI_ERROR_PARAMETER;
626
626
}
627
627
@@ -630,12 +630,12 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
630
630
_busy = false ;
631
631
_error = false ;
632
632
if (!_parser.send (" AT+CIPSEND=%d,%" PRIu32, id, amount)) {
633
- tr_debug (" ESP8266:: send(): AT+CIPSEND failed" );
633
+ tr_debug (" send(): AT+CIPSEND failed. " );
634
634
goto END;
635
635
}
636
636
637
637
if (!_parser.recv (" >" )) {
638
- tr_debug (" ESP8266:: send(): didn 't get \" >\" " );
638
+ tr_debug (" send(): Didn 't get \" >\" " );
639
639
ret = NSAPI_ERROR_WOULD_BLOCK;
640
640
goto END;
641
641
}
@@ -650,22 +650,22 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
650
650
// error hierarchy, from low to high
651
651
if (_busy) {
652
652
ret = NSAPI_ERROR_WOULD_BLOCK;
653
- tr_debug (" ESP8266:: send(): modem busy" );
653
+ tr_debug (" send(): Modem busy. " );
654
654
}
655
655
656
656
if (ret == NSAPI_ERROR_DEVICE_ERROR) {
657
657
ret = NSAPI_ERROR_WOULD_BLOCK;
658
- tr_debug (" ESP8266:: send(): send failed" );
658
+ tr_debug (" send(): Send failed. " );
659
659
}
660
660
661
661
if (_error) {
662
662
ret = NSAPI_ERROR_CONNECTION_LOST;
663
- tr_debug (" ESP8266:: send(): connection disrupted" );
663
+ tr_debug (" send(): Connection disrupted. " );
664
664
}
665
665
666
666
if (!_sock_i[id].open && ret != NSAPI_ERROR_OK) {
667
667
ret = NSAPI_ERROR_CONNECTION_LOST;
668
- tr_debug (" ESP8266:: send(): socket closed abruptly" );
668
+ tr_debug (" send(): Socket closed abruptly. " );
669
669
}
670
670
671
671
set_timeout ();
@@ -708,7 +708,7 @@ void ESP8266::_oob_packet_hdlr()
708
708
709
709
struct packet *packet = (struct packet *)malloc (pdu_len);
710
710
if (!packet) {
711
- tr_debug (" out of memory, unable to allocate memory for packet" );
711
+ tr_debug (" _oob_packet_hdlr(): Out of memory, unable to allocate memory for packet. " );
712
712
return ;
713
713
}
714
714
_heap_usage += pdu_len;
@@ -798,10 +798,10 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t
798
798
BUSY:
799
799
_process_oob (ESP8266_RECV_TIMEOUT, true );
800
800
if (_busy) {
801
- tr_debug (" _recv_tcp_passive(): modem busy" );
801
+ tr_debug (" _recv_tcp_passive(): Modem busy. " );
802
802
ret = NSAPI_ERROR_WOULD_BLOCK;
803
803
} else {
804
- tr_error (" _recv_tcp_passive(): unknown state" );
804
+ tr_error (" _recv_tcp_passive(): Unknown state. " );
805
805
ret = NSAPI_ERROR_DEVICE_ERROR;
806
806
}
807
807
_smutex.unlock ();
@@ -1024,7 +1024,7 @@ bool ESP8266::_recv_ap(nsapi_wifi_ap_t *ap)
1024
1024
1025
1025
if (ret < 0 ) {
1026
1026
_parser.abort ();
1027
- tr_warning (" _recv_ap(): AP info missing" );
1027
+ tr_warning (" _recv_ap(): AP info missing. " );
1028
1028
}
1029
1029
1030
1030
ap->security = sec < 5 ? (nsapi_security_t )sec : NSAPI_SECURITY_UNKNOWN;
@@ -1054,19 +1054,19 @@ void ESP8266::_oob_ready()
1054
1054
_conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
1055
1055
_conn_stat_cb ();
1056
1056
1057
- tr_debug (" _oob_reset(): reset detected" );
1057
+ tr_debug (" _oob_reset(): Reset detected. " );
1058
1058
}
1059
1059
1060
1060
void ESP8266::_oob_busy ()
1061
1061
{
1062
1062
char status;
1063
1063
if (_parser.scanf (" %c...\n " , &status)) {
1064
1064
if (status == ' s' ) {
1065
- tr_debug (" busy s..." );
1065
+ tr_debug (" _oob_busy(): Busy s..." );
1066
1066
} else if (status == ' p' ) {
1067
- tr_debug (" busy p..." );
1067
+ tr_debug (" _oob_busy(): Busy p..." );
1068
1068
} else {
1069
- tr_error (" unrecognized busy state '%c...'" , status);
1069
+ tr_error (" _oob_busy(): unrecognized busy state '%c...'" , status);
1070
1070
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
1071
1071
" ESP8266::_oob_busy() unrecognized busy state\n " );
1072
1072
}
@@ -1144,35 +1144,35 @@ void ESP8266::_oob_socket0_closed()
1144
1144
{
1145
1145
static const int id = 0 ;
1146
1146
_sock_i[id].open = false ;
1147
- tr_debug (" socket %d closed" , id);
1147
+ tr_debug (" _oob_socket0_closed(): Socket %d closed. " , id);
1148
1148
}
1149
1149
1150
1150
void ESP8266::_oob_socket1_closed ()
1151
1151
{
1152
1152
static const int id = 1 ;
1153
1153
_sock_i[id].open = false ;
1154
- tr_debug (" socket %d closed" , id);
1154
+ tr_debug (" _oob_socket1_closed(): Socket %d closed. " , id);
1155
1155
}
1156
1156
1157
1157
void ESP8266::_oob_socket2_closed ()
1158
1158
{
1159
1159
static const int id = 2 ;
1160
1160
_sock_i[id].open = false ;
1161
- tr_debug (" socket %d closed" , id);
1161
+ tr_debug (" _oob_socket2_closed(): Socket %d closed. " , id);
1162
1162
}
1163
1163
1164
1164
void ESP8266::_oob_socket3_closed ()
1165
1165
{
1166
1166
static const int id = 3 ;
1167
1167
_sock_i[id].open = false ;
1168
- tr_debug (" socket %d closed" , id);
1168
+ tr_debug (" _oob_socket3_closed(): %d closed. " , id);
1169
1169
}
1170
1170
1171
1171
void ESP8266::_oob_socket4_closed ()
1172
1172
{
1173
1173
static const int id = 4 ;
1174
1174
_sock_i[id].open = false ;
1175
- tr_debug (" socket %d closed" , id);
1175
+ tr_debug (" _oob_socket0_closed(): Socket %d closed. " , id);
1176
1176
}
1177
1177
1178
1178
void ESP8266::_oob_connection_status ()
@@ -1191,16 +1191,16 @@ void ESP8266::_oob_connection_status()
1191
1191
} else if (strcmp (status, " CONNECTED\n " ) == 0 ) {
1192
1192
_conn_status = NSAPI_STATUS_CONNECTING;
1193
1193
} else {
1194
- tr_error (" invalid AT cmd \' %s\' " , status);
1194
+ tr_error (" _oob_connection_status(): Invalid AT cmd \' %s\' . " , status);
1195
1195
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
1196
1196
" ESP8266::_oob_connection_status: invalid AT cmd\n " );
1197
1197
}
1198
1198
} else {
1199
- tr_error (" _oob_connection_status(): network status timeout, disconnecting" );
1199
+ tr_error (" _oob_connection_status(): Network status timeout, disconnecting. " );
1200
1200
if (!disconnect ()) {
1201
- tr_warning (" _oob_connection_status(): driver initiated disconnect failed" );
1201
+ tr_warning (" _oob_connection_status(): Driver initiated disconnect failed. " );
1202
1202
} else {
1203
- tr_debug (" _oob_connection_status(): disconnected " );
1203
+ tr_debug (" _oob_connection_status(): Disconnected. " );
1204
1204
}
1205
1205
_conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
1206
1206
}
0 commit comments