Page 1 of 1

<!--VARIABLE EthernetMac -->

Posted: Mon Oct 14, 2013 10:19 pm
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

Re: <!--VARIABLE EthernetMac -->

Posted: Tue Oct 15, 2013 9:36 am
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

Re: <!--VARIABLE EthernetMac -->

Posted: Tue Oct 15, 2013 7:04 pm
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!