-->
Page 1 of 3

Finding localMAC on SparkFun WiFi Shield/Arduino

PostPosted: Fri Jun 02, 2017 5:17 am
by Johnd2117
I'm trying to find the MAC on my SparkFun WiFi Shield. I have tried to use to following code:

int16_t myMAC = localMAC();

The code appears to have a cast from int16_t to char *. I have to admit that I don't know enough to make it work. Any help would be welcome.

Re: Finding localMAC on SparkFun WiFi Shield/Arduino

PostPosted: Fri Jun 02, 2017 1:58 pm
by atexit8
Johnd2117 wrote:I'm trying to find the MAC on my SparkFun WiFi Shield. I have tried to use to following code:

int16_t myMAC = localMAC();

The code appears to have a cast from int16_t to char *. I have to admit that I don't know enough to make it work. Any help would be welcome.



What does their documentation say?

Re: Finding localMAC on SparkFun WiFi Shield/Arduino

PostPosted: Fri Jun 02, 2017 4:08 pm
by Johnd2117
I have tried to find documentation on google but have not had any joy. :)

Re: Finding localMAC on SparkFun WiFi Shield/Arduino

PostPosted: Sat Jun 03, 2017 9:52 am
by martinayotte
A MAC address is an array of 6 bytes, so it is really strange that you use a single int16_t.

On Arduino, the functions are the following :

For AP :
Code: Select alluint8_t* softAPmacAddress(uint8_t* mac);
String softAPmacAddress(void);

For STA :
Code: Select alluint8_t * macAddress(uint8_t* mac);
String macAddress();