<!--VARIABLE EthernetMac -->

Discussion to talk about software related topics only.
Post Reply
roland.ames

<!--VARIABLE EthernetMac -->

Post by roland.ames »

I used

Code: Select all

<!--VARIABLE EthernetMac -->
in my html page to show the MAC address and it shows the incorrect data.

If I use instead,

Code: Select all

<!--FUNCTIONCALL HTML_EthernetMac -->
with

Code: Select all

void HTML_EthernetMac( int sock, PCSTR url)
{
    char line[80];
    BYTE * lpb;

    lpb = (BYTE*)(&EthernetMac);
    sniprintf(line,sizeof(line),"%02X:%02X:%02X:%02X:%02X:%02X<br>", (int)lpb[0], (int)lpb[1], (int)lpb[2], (int)lpb[3], (int)lpb[4], (int)lpb[5]);
    writestring(sock, line);
}
I get the correct value displayed!

The error is only in the last byte value

ie I have a module showing on the sticker "00:03:F4:06:01:18" yet when I use

Code: Select all

<!--VARIABLE EthernetMac -->
I get displayed "00:03:F4:06:01:AF"


This was seen on a MOD5234, but I guess this issue is generic across platforms??

I have seen the same issue on a MOD5441X

I am using NNDK release 2.6.3
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: <!--VARIABLE EthernetMac -->

Post by dciliske »

Wow... I have know idea how this went unnoticed for so long. Turns out, there was an index issue with printing the last byte in the WriteHtmlVariable. 6!=5

Fix: In 'system', on line 204 of file 'htmlwritefile.cpp'

fd_writehex( fd, lpb[6] );

should be

fd_writehex( fd, lpb[5] );

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
roland.ames

Re: <!--VARIABLE EthernetMac -->

Post by roland.ames »

It wasn't until I actually looked at the sticker on the module and compared it to what my web page was telling me that I found this. I guess no-one else bothers displaying the MAC address!
Post Reply