Connecting Wifi to specific MAC Address?

Hi,

I have 1 router and 2 wifi repeater which using same SSID.

Example:

  1. Router -> SSID = HomeWifi -> MAC = 80:7A:7B:7C:00:01
  2. Repeater01 -> SSID = HomeWifi -> MAC = 80:7A:7B:7C:00:02
  3. Repeater02 -> SSID = HomeWifi -> MAC = 80:7A:7B:7C:00:03
WiFi.begin(ssid, password);

Question:
Instead connecting to SSID, is there a way connect to specific MAC Address? For the example, I want connect to Repeater02 (which has different MAC address but using same SSID).

Please let me know and thanks for the answer.

yes, use WiFi.begin version with bssid parameter. it is the MAC address of the AP to which it should connect

Juraj:
yes, use WiFi.begin version with bssid parameter. it is the MAC address of the AP to which it should connect

Please show me the example code.

wieb:
Please show me the example code.

esp8266, esp32
https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/station-class.html#begin

WiFiEspAT
const byte bssid[] = {0x8A, 0x2F, 0xC3, 0xE9, 0x25, 0xC0};
int status = WiFi.begin(ssid, pass, bssid);

WiFiNINA, WiFi, WiF101, WiFiEsp, WiFiSpi, WiFiLink, - begin with bssid not implemented

Juraj:
esp8266, esp32
Station Class — ESP8266 Arduino Core 3.1.2-21-ga348833 documentation

WiFiEspAT
const byte bssid[] = {0x8A, 0x2F, 0xC3, 0xE9, 0x25, 0xC0};
int status = WiFi.begin(ssid, pass, bssid);

WiFiNINA, WiFi, WiF101, WiFiEsp, WiFiSpi, WiFiLink, - begin with bssid not implemented

Thanks a lot for the guidance.