Skip to content

Commit 86c2984

Browse files
committed
Add debug print in socket_close. Remove tab characters.
1 parent 318c7ae commit 86c2984

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

adafruit_esp32spi/adafruit_esp32spi.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@
6666
_SCAN_NETWORKS = const(0x27)
6767
_GET_SOCKET_CMD = const(0x3F)
6868
_GET_STATE_TCP_CMD = const(0x29)
69-
_DATA_SENT_TCP_CMD = const(0x2A)
70-
_AVAIL_DATA_TCP_CMD = const(0x2B)
71-
_GET_DATA_TCP_CMD = const(0x2C)
69+
_DATA_SENT_TCP_CMD = const(0x2A)
70+
_AVAIL_DATA_TCP_CMD = const(0x2B)
71+
_GET_DATA_TCP_CMD = const(0x2C)
7272
_START_CLIENT_TCP_CMD = const(0x2D)
7373
_STOP_CLIENT_TCP_CMD = const(0x2E)
7474
_GET_CLIENT_STATE_TCP_CMD = const(0x2F)
75-
_DISCONNECT_CMD = const(0x30)
75+
_DISCONNECT_CMD = const(0x30)
7676
_GET_IDX_RSSI_CMD = const(0x32)
7777
_GET_IDX_ENCT_CMD = const(0x33)
7878
_REQ_HOST_BY_NAME_CMD = const(0x34)
7979
_GET_HOST_BY_NAME_CMD = const(0x35)
8080
_START_SCAN_NETWORKS = const(0x36)
8181
_GET_FW_VERSION_CMD = const(0x37)
82-
_PING_CMD = const(0x3E)
82+
_PING_CMD = const(0x3E)
8383

8484
_SEND_DATA_TCP_CMD = const(0x44)
8585
_GET_DATABUF_TCP_CMD = const(0x45)
@@ -612,6 +612,8 @@ def socket_connect(self, socket_num, dest, port, conn_mode=TCP_MODE):
612612

613613
def socket_close(self, socket_num):
614614
"""Close a socket using the ESP32's internal reference number"""
615+
if self._debug:
616+
print("*** Closing socket #%d" % socket_num)
615617
self._socknum_ll[0][0] = socket_num
616618
resp = self._send_command_get_response(_STOP_CLIENT_TCP_CMD, self._socknum_ll)
617619
if resp[0][0] != 1:

0 commit comments

Comments
 (0)