6262_GET_IPADDR_CMD = const (0x21 )
6363_GET_MACADDR_CMD = const (0x22 )
6464_GET_CURR_SSID_CMD = const (0x23 )
65+ _GET_CURR_BSSID_CMD = const (0x24 )
6566_GET_CURR_RSSI_CMD = const (0x25 )
6667_GET_CURR_ENCT_CMD = const (0x26 )
6768
8384_START_SCAN_NETWORKS = const (0x36 )
8485_GET_FW_VERSION_CMD = const (0x37 )
8586_GET_TIME = const (0x3B )
87+ _GET_IDX_BSSID_CMD = const (0x3C )
88+ _GET_IDX_CHAN_CMD = const (0x3D )
8689_PING_CMD = const (0x3E )
8790
8891_SEND_DATA_TCP_CMD = const (0x44 )
@@ -351,7 +354,7 @@ def start_scan_networks(self):
351354
352355 def get_scan_networks (self ):
353356 """The results of the latest SSID scan. Returns a list of dictionaries with
354- 'ssid', 'rssi' and 'encryption' entries, one for each AP found"""
357+ 'ssid', 'rssi', 'encryption', bssid, and channel entries, one for each AP found"""
355358 self ._send_command (_SCAN_NETWORKS )
356359 names = self ._wait_response_cmd (_SCAN_NETWORKS )
357360 #print("SSID names:", names)
@@ -362,6 +365,10 @@ def get_scan_networks(self):
362365 a_p ['rssi' ] = struct .unpack ('<i' , rssi )[0 ]
363366 encr = self ._send_command_get_response (_GET_IDX_ENCT_CMD , ((i ,),))[0 ]
364367 a_p ['encryption' ] = encr [0 ]
368+ bssid = self ._send_command_get_response (_GET_IDX_BSSID_CMD , ((i ,),))[0 ]
369+ a_p ['bssid' ] = bssid
370+ chan = self ._send_command_get_response (_GET_IDX_CHAN_CMD , ((i ,),))[0 ]
371+ a_p ['channel' ] = chan [0 ]
365372 APs .append (a_p )
366373 return APs
367374
@@ -431,6 +438,12 @@ def ssid(self):
431438 resp = self ._send_command_get_response (_GET_CURR_SSID_CMD , [b'\xFF ' ])
432439 return resp [0 ]
433440
441+ @property
442+ def bssid (self ):
443+ """The MAC-formatted service set ID of the access point we're connected to"""
444+ resp = self ._send_command_get_response (_GET_CURR_BSSID_CMD , [b'\xFF ' ])
445+ return resp [0 ]
446+
434447 @property
435448 def rssi (self ):
436449 """The receiving signal strength indicator for the access point we're
0 commit comments