ENC28J60 Component Updates
Posted: Mon May 23, 2016 12:17 am
I have two requests for this component. Is it possible to modify the Initialize to include setting the IP and MAC addresses.
That way I can make them software selectable. I need to allow them to be set in software, because if you have two or more systems on one network, different addresses are required currently requiring a recompile each time.
I have added a CheckForARPReply function, this is needed if you use MakeARPRequest. You could include this in the revised component. See below.
Parameters are - LENGTH
Returns 1 for successful ARP reply
Use - GetSendersMAC address from local network hosts. E.g modem/gateway so you can send email.
Cruzxia
That way I can make them software selectable. I need to allow them to be set in software, because if you have two or more systems on one network, different addresses are required currently requiring a recompile each time.
I have added a CheckForARPReply function, this is needed if you use MakeARPRequest. You could include this in the revised component. See below.
Parameters are - LENGTH
Returns 1 for successful ARP reply
Use - GetSendersMAC address from local network hosts. E.g modem/gateway so you can send email.
Code: Select all
{
//Local variable definitions
MX_UINT8 FCR_RETVAL;
FCR_RETVAL = 0;
if (FCL_LENGTH < 60)
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[12] != 0x08 || FCV_0f5c1_TCPIP_ENC28J60__BUFFER[13] != 0x06) //Test for ARP
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[21] != 0x02) //Test for ARP Reply code 2
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[0x26] != 192)
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[0x27] != 168)
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[0x28] != 1)
{
goto FCC_CheckForARP_R;
// } else {
}
if (FCV_0f5c1_TCPIP_ENC28J60__BUFFER[0x29] != 90)
{
goto FCC_CheckForARP_R;
// } else {
}
FCR_RETVAL = 1;
FCC_CheckForARP_R:
;
return (FCR_RETVAL);
}