ESP32 compile error with scan networks

I am trying to run following sketch on ESP32 but get compile error.

What could be the solution to resolve this issue ?

C:\Users\ebhynes\AppData\Local\Temp\arduino_modified_sketch_647803\sketch_apr04a.ino: In function 'void setup()':
sketch_apr04a:17:29: error: call of overloaded 'BSSID(int)' is ambiguous
   17 |       values[i] = WiFi.BSSID(0)[i];
      |                   ~~~~~~~~~~^~~
In file included from C:\Users\ebhynes\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi\src/WiFi.h:34,
                 from C:\Users\ebhynes\AppData\Local\Temp\arduino_modified_sketch_647803\sketch_apr04a.ino:1:
C:\Users\ebhynes\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi\src/WiFiSTA.h:171:12: note: candidate: 'uint8_t* WiFiSTAClass::BSSID(uint8_t*)'
  171 |   uint8_t *BSSID(uint8_t *bssid = NULL);
      |            ^~~~~
In file included from C:\Users\ebhynes\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi\src/WiFi.h:36:
C:\Users\ebhynes\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi\src/WiFiScan.h:52:12: note: candidate: 'uint8_t* WiFiScanClass::BSSID(uint8_t, uint8_t*)'
   52 |   uint8_t *BSSID(uint8_t networkItem, uint8_t *bssid = NULL);
      | 

Sketch:

#include <WiFi.h>

void setup() {
 
  //int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300, uint8_t channel = 0, const char * ssid=nullptr, const uint8_t * bssid=nullptr);
  int n = WiFi.scanNetworks(true, false, false, 5, 7, "HTM");
    
  Serial.begin(115200);
    
  delay(10);  // Minimum 10 milliseonds delay required to reliably receive message from Gateway.
     
      
      
      for (int i = 0; i < 4; i++) 
     {
      uint8_t values[4];
      values[i] = WiFi.BSSID(0)[i];
      
     }
}  
void loop() { }     

What's the point of that sketch?
Shouldn't you begin wifi first?

I am trying to store MAC data of AP. There is no need to start wifi for this purrpose.

Thanks.

I was able to solve it by using following code:

uint8_t command;

int n = WiFi.scanNetworks(true, true, false, 5, apChannel, ssid);
  for (int i = 0; i < n ; ++i) { for (int j = 0; j < 6; j++) {
  command[j] = WiFi.BSSID(i)[j]; }}