Just like I have used the following inline code incorporating WiFi.mode(WIFI_STA) to turn off the ESP8266 access point:
I would like to use WiFi.BSSID or WiFi.BSSIDstr to retrieve the current BSSID so I can confirm which access point I am connected to after using the wifi.Connect3 command.
I have tried the following, but obviously there is a syntax error:
In what form do I need to declare the MAC variable and use it in the inline code to retrieve WiFi.BSSID (or WiFi.BSSIDstr)?
B4X:
Private Sub AppStart
Serial1.Initialize(115200)
RunNative("SetSTA", Null) 'Turn off AP mode
End Sub
#if C
void SetSTA(B4R::Object* o) {
WiFi.mode(WIFI_STA);
}
#end if
I would like to use WiFi.BSSID or WiFi.BSSIDstr to retrieve the current BSSID so I can confirm which access point I am connected to after using the wifi.Connect3 command.
I have tried the following, but obviously there is a syntax error:
B4X:
Sub Process_Globals
Private MAC() As Byte
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
RunNative("GetMAC", Null) 'Get BSSID of AP connected to
End Sub
#if C
void GetMAC(B4R::Object* o) {
b4r_main::_mac = WiFi.BSSID;
}
#end if
In what form do I need to declare the MAC variable and use it in the inline code to retrieve WiFi.BSSID (or WiFi.BSSIDstr)?