@@ -116,7 +116,7 @@ bool ESP8266::at_available()
116116 if (ready) {
117117 break ;
118118 }
119- tr_debug (" waiting AT response" );
119+ tr_debug (" at_available(): Waiting AT response. " );
120120 }
121121 _smutex.unlock ();
122122
@@ -227,7 +227,7 @@ bool ESP8266::start_uart_hw_flow_ctrl(void)
227227 _smutex.unlock ();
228228
229229 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. " );
231231 }
232232#else
233233 if (_serial_rts != NC || _serial_cts != NC) {
@@ -268,7 +268,7 @@ bool ESP8266::reset(void)
268268 set_timeout (ESP8266_RECV_TIMEOUT);
269269 for (int i = 0 ; i < 2 ; i++) {
270270 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. " );
272272 continue ;
273273 }
274274
@@ -285,7 +285,7 @@ bool ESP8266::reset(void)
285285 }
286286 }
287287
288- tr_debug (" reset(): done : %s" , done ? " OK" : " FAIL" );
288+ tr_debug (" reset(): Done : %s. " , done ? " OK" : " FAIL" );
289289
290290 _clear_socket_packets (ESP8266_ALL_SOCKET_IDS);
291291 set_timeout ();
@@ -484,7 +484,7 @@ int ESP8266::scan(WiFiAccessPoint *res, unsigned limit, scan_mode mode, unsigned
484484 }
485485
486486 if (!(ret_parse_send && _parser.recv (" OK\n " ))) {
487- tr_warning (" scan(): AP info parsing aborted" );
487+ tr_warning (" scan(): AP info parsing aborted. " );
488488 // Lets be happy about partial success and not return NSAPI_ERROR_DEVICE_ERROR
489489 if (!_scan_r.cnt ) {
490490 _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
547547
548548 _smutex.unlock ();
549549
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" ));
551551
552552 return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
553553}
@@ -598,7 +598,7 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv
598598
599599 _smutex.unlock ();
600600
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" ));
602602
603603 return done ? NSAPI_ERROR_OK : NSAPI_ERROR_DEVICE_ERROR;
604604}
@@ -621,7 +621,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
621621 amount = 2048 ;
622622 // Datagram must stay intact
623623 } 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 . " );
625625 return NSAPI_ERROR_PARAMETER;
626626 }
627627
@@ -630,12 +630,12 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
630630 _busy = false ;
631631 _error = false ;
632632 if (!_parser.send (" AT+CIPSEND=%d,%" PRIu32, id, amount)) {
633- tr_debug (" ESP8266:: send(): AT+CIPSEND failed" );
633+ tr_debug (" send(): AT+CIPSEND failed. " );
634634 goto END;
635635 }
636636
637637 if (!_parser.recv (" >" )) {
638- tr_debug (" ESP8266:: send(): didn 't get \" >\" " );
638+ tr_debug (" send(): Didn 't get \" >\" " );
639639 ret = NSAPI_ERROR_WOULD_BLOCK;
640640 goto END;
641641 }
@@ -650,22 +650,22 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount)
650650 // error hierarchy, from low to high
651651 if (_busy) {
652652 ret = NSAPI_ERROR_WOULD_BLOCK;
653- tr_debug (" ESP8266:: send(): modem busy" );
653+ tr_debug (" send(): Modem busy. " );
654654 }
655655
656656 if (ret == NSAPI_ERROR_DEVICE_ERROR) {
657657 ret = NSAPI_ERROR_WOULD_BLOCK;
658- tr_debug (" ESP8266:: send(): send failed" );
658+ tr_debug (" send(): Send failed. " );
659659 }
660660
661661 if (_error) {
662662 ret = NSAPI_ERROR_CONNECTION_LOST;
663- tr_debug (" ESP8266:: send(): connection disrupted" );
663+ tr_debug (" send(): Connection disrupted. " );
664664 }
665665
666666 if (!_sock_i[id].open && ret != NSAPI_ERROR_OK) {
667667 ret = NSAPI_ERROR_CONNECTION_LOST;
668- tr_debug (" ESP8266:: send(): socket closed abruptly" );
668+ tr_debug (" send(): Socket closed abruptly. " );
669669 }
670670
671671 set_timeout ();
@@ -708,7 +708,7 @@ void ESP8266::_oob_packet_hdlr()
708708
709709 struct packet *packet = (struct packet *)malloc (pdu_len);
710710 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. " );
712712 return ;
713713 }
714714 _heap_usage += pdu_len;
@@ -798,10 +798,10 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t
798798BUSY:
799799 _process_oob (ESP8266_RECV_TIMEOUT, true );
800800 if (_busy) {
801- tr_debug (" _recv_tcp_passive(): modem busy" );
801+ tr_debug (" _recv_tcp_passive(): Modem busy. " );
802802 ret = NSAPI_ERROR_WOULD_BLOCK;
803803 } else {
804- tr_error (" _recv_tcp_passive(): unknown state" );
804+ tr_error (" _recv_tcp_passive(): Unknown state. " );
805805 ret = NSAPI_ERROR_DEVICE_ERROR;
806806 }
807807 _smutex.unlock ();
@@ -1024,7 +1024,7 @@ bool ESP8266::_recv_ap(nsapi_wifi_ap_t *ap)
10241024
10251025 if (ret < 0 ) {
10261026 _parser.abort ();
1027- tr_warning (" _recv_ap(): AP info missing" );
1027+ tr_warning (" _recv_ap(): AP info missing. " );
10281028 }
10291029
10301030 ap->security = sec < 5 ? (nsapi_security_t )sec : NSAPI_SECURITY_UNKNOWN;
@@ -1054,19 +1054,19 @@ void ESP8266::_oob_ready()
10541054 _conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
10551055 _conn_stat_cb ();
10561056
1057- tr_debug (" _oob_reset(): reset detected" );
1057+ tr_debug (" _oob_reset(): Reset detected. " );
10581058}
10591059
10601060void ESP8266::_oob_busy ()
10611061{
10621062 char status;
10631063 if (_parser.scanf (" %c...\n " , &status)) {
10641064 if (status == ' s' ) {
1065- tr_debug (" busy s..." );
1065+ tr_debug (" _oob_busy(): Busy s..." );
10661066 } else if (status == ' p' ) {
1067- tr_debug (" busy p..." );
1067+ tr_debug (" _oob_busy(): Busy p..." );
10681068 } else {
1069- tr_error (" unrecognized busy state '%c...'" , status);
1069+ tr_error (" _oob_busy(): unrecognized busy state '%c...'" , status);
10701070 MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
10711071 " ESP8266::_oob_busy() unrecognized busy state\n " );
10721072 }
@@ -1144,35 +1144,35 @@ void ESP8266::_oob_socket0_closed()
11441144{
11451145 static const int id = 0 ;
11461146 _sock_i[id].open = false ;
1147- tr_debug (" socket %d closed" , id);
1147+ tr_debug (" _oob_socket0_closed(): Socket %d closed. " , id);
11481148}
11491149
11501150void ESP8266::_oob_socket1_closed ()
11511151{
11521152 static const int id = 1 ;
11531153 _sock_i[id].open = false ;
1154- tr_debug (" socket %d closed" , id);
1154+ tr_debug (" _oob_socket1_closed(): Socket %d closed. " , id);
11551155}
11561156
11571157void ESP8266::_oob_socket2_closed ()
11581158{
11591159 static const int id = 2 ;
11601160 _sock_i[id].open = false ;
1161- tr_debug (" socket %d closed" , id);
1161+ tr_debug (" _oob_socket2_closed(): Socket %d closed. " , id);
11621162}
11631163
11641164void ESP8266::_oob_socket3_closed ()
11651165{
11661166 static const int id = 3 ;
11671167 _sock_i[id].open = false ;
1168- tr_debug (" socket %d closed" , id);
1168+ tr_debug (" _oob_socket3_closed(): %d closed. " , id);
11691169}
11701170
11711171void ESP8266::_oob_socket4_closed ()
11721172{
11731173 static const int id = 4 ;
11741174 _sock_i[id].open = false ;
1175- tr_debug (" socket %d closed" , id);
1175+ tr_debug (" _oob_socket0_closed(): Socket %d closed. " , id);
11761176}
11771177
11781178void ESP8266::_oob_connection_status ()
@@ -1191,16 +1191,16 @@ void ESP8266::_oob_connection_status()
11911191 } else if (strcmp (status, " CONNECTED\n " ) == 0 ) {
11921192 _conn_status = NSAPI_STATUS_CONNECTING;
11931193 } else {
1194- tr_error (" invalid AT cmd \' %s\' " , status);
1194+ tr_error (" _oob_connection_status(): Invalid AT cmd \' %s\' . " , status);
11951195 MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
11961196 " ESP8266::_oob_connection_status: invalid AT cmd\n " );
11971197 }
11981198 } else {
1199- tr_error (" _oob_connection_status(): network status timeout, disconnecting" );
1199+ tr_error (" _oob_connection_status(): Network status timeout, disconnecting. " );
12001200 if (!disconnect ()) {
1201- tr_warning (" _oob_connection_status(): driver initiated disconnect failed" );
1201+ tr_warning (" _oob_connection_status(): Driver initiated disconnect failed. " );
12021202 } else {
1203- tr_debug (" _oob_connection_status(): disconnected " );
1203+ tr_debug (" _oob_connection_status(): Disconnected. " );
12041204 }
12051205 _conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
12061206 }
0 commit comments