Obtain MAC address
Obtain MAC address
Hey,
I'd like to get the MAC address of the DS. I think it is possible with readFirmware(), but that's for ARM7 only. It should also be possible with Wifi_GetData(), but that doesn't seem to work if you're not connected to the Wi-Fi... So how should I do this?
Thanks in advance,
Jan
I'd like to get the MAC address of the DS. I think it is possible with readFirmware(), but that's for ARM7 only. It should also be possible with Wifi_GetData(), but that doesn't seem to work if you're not connected to the Wi-Fi... So how should I do this?
Thanks in advance,
Jan
Re: Obtain MAC address
why not use the arm7?
Re: Obtain MAC address
Code: Select all
Wifi_InitDefault(false);
Code: Select all
volatile Wifi_MainStruct * WifiData;
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Obtain MAC address
Because almost nobody should be using a custom arm7, 99% of the code out there using custom arm7 is *horrendous* and we'd really rather not encourage people to use it.zeromus wrote:why not use the arm7?
If there's a need to obtain the MAC address then there should be a means to do it in libnds.
Jan, what's this for?
Re: Obtain MAC address
In my NIFI homebrews i use :
Code: Select all
Wifi_InitDefault(false);
...
u8 macAddress[6];
Wifi_GetData(WIFIGETDATA_MACADDRESS, 6, macAddress);
Re: Obtain MAC address
I need it because I don't want the user to be able to use another DS than the DS it has run on first. And the MAC address is the only unique number the DS has. And it isn't possible to change it I think. I found the way already:
Thanks for the help anyway!
PS: the MAC Address isn't editable right?
Code: Select all
unsigned char mac_address[6];
char *GetMACAddress(void) {
Wifi_EnableWifi();
Wifi_InitDefault(false);
Wifi_GetData(WIFIGETDATA_MACADDRESS,6,&mac_address[0]);
Wifi_DisableWifi();
return mac_address;
}
PS: the MAC Address isn't editable right?
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Obtain MAC address
The MAC address can be changed, yes. This sort of thing is easily patched out of homebrew though so it might be a bit of wasted effort.
Re: Obtain MAC address
Isn't the whole point of a MAC address that it's unique?
-
- Site Admin
- Posts: 2003
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Obtain MAC address
Well, yes but then people do silly things like lock software to a MAC address so provision is made to transfer a MAC address from an old machine being scrapped to a shiny new one and avoid being "taxed" for upgrading hardware.
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests