diff --git a/xcplib/main_cfg.h b/xcplib/main_cfg.h index 5c7dfc0..d6f9dd1 100644 --- a/xcplib/main_cfg.h +++ b/xcplib/main_cfg.h @@ -55,4 +55,4 @@ #define OPTION_DEFAULT_DBG_LEVEL 3 // @@@@ -#define PLATFORM_ENABLE_GET_LOCAL_ADDR +//#define PLATFORM_ENABLE_GET_LOCAL_ADDR diff --git a/xcplib/src/xcpEthTl.c b/xcplib/src/xcpEthTl.c index 97b1de4..18bcb5e 100644 --- a/xcplib/src/xcpEthTl.c +++ b/xcplib/src/xcpEthTl.c @@ -475,7 +475,11 @@ void XcpEthTlGetInfo(BOOL* isTcp, uint8_t* mac, uint8_t* addr, uint16_t *port) { if (isTcp!=NULL) *isTcp = gXcpTl.ServerUseTCP; if (addr!=NULL) memcpy(addr, gXcpTl.ServerAddr, 4); - if (mac!=NULL) memcpy(mac, gXcpTl.ServerMac, 4); +#ifdef PLATFORM_ENABLE_GET_LOCAL_ADDR + if (mac!=NULL) memcpy(mac, gXcpTl.ServerMac, 6); +#else + if (mac!=NULL) memset(mac, 0, 6); +#endif if (port!=NULL) *port = gXcpTl.ServerPort; }