Home/Support/Support Forum/Get Mac Address on my 9215
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Get Mac Address on my 9215

0 votes
I am trying to get my MAC Address.

Right now I could only use this method:

char * NAGetAppBspMacAddress(void);

but it is giving me the default mac address that Digi uses when the NVRAM gets corrupted. It is not giving the right MAC Address.

I tried using
getMacAddress()
and
getDefaultMacAddress()

without success.

I can't seem to find the correct libraries to use the methods.

If there is some working code example doing this it would be great.
asked Nov 12, 2014 in NET+OS by hsantana New to the Community (22 points)

Please log in or register to answer this question.

2 Answers

+1 vote
I would have expected getMacAddress to work as it reads directly from FLASH. You could try the following:
write some code that calls customizeReadDevBoardParams(). You pass it a pointer to a devBoardParamsType struct (you must either malloc this or pass it a pointer to a stack or global variable). As always I recommend clearing the structure out before passing it to the API. The field ethernetMac should be the ethernet address of the module or chip. This is described in the API reference guide.

A couple of things:
In appconf.h of your project, if the macro APP_USE_NVRAM is defined as APP_DO_NOT_USE_NVRAM, then customizeReadDevBoardParams returns the NET+OS default values.

If your NVRAM values are crunched (the CRC value calculated does not equal the CRC value carried in NVRAM then customizeReadDevBoardParams will return the NET+OS values.

In appconf.h if the macro APP_USE_NVRAM is set to APP_FOR_MAC_ADDRESS_ONLY then the mac address could be read from appconf.h (default value).

The obvious question is are you sure your NVRAM data was NOT crunched?
answered Nov 13, 2014 by dakotas_dad Veteran of the Digi Community (694 points)
+1 vote
I solved the problem with customizeReadDevBoardParams().

Thanks!
answered Nov 14, 2014 by hsantana New to the Community (22 points)
...