If I call WiFi.macAddress() before calling WiFi.begin I get a random incorrect mac address returned. a call to begin, even if no parameters are supplied or connection is made, is needed for the correct mac to be returned.
byte mac; WiFi.macAddress(mac);
returns a random address in the variable mac but
byte mac; Wifi.begin(); WiFi.macAddress(mac);
Returns the the address printed on my MKR1000.
Although the example code includes a connection to an access point there is no mention of this requirement in the documentation or an explanation as to why it should be necessary.
I realise that good programming practise dictates that initialising the device is a good idea but, since it confused me, I'm sure it will mislead others as well. The random mac looked genuine until I realised it was the wrong number.
Basically I'm asking if either a warning could be added to the documentation or the behaviour of the library changed to return all FFs prior to initialisation which would be consistent with what happens after you've called WiFi.end() and far more obvious.