So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Johnd2117
#66634 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.
User avatar
By atexit8
#66653
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?
User avatar
By martinayotte
#66678 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();