寻根溯源,在eMBTCPReceive看到这样的定义:
eMBTCPReceive: *pucRcvAddress =MB_TCP_PSEUDO_ADDRESS;
#defineMB_TCP_PSEUDO_ADDRESS 255 原来设备从地址居然是一个宏定义!协议栈是这样解释的:
/* Modbus TCP does not useany addresses. Fake the source address such
* that the processing partdeals with this frame.*/
原来modbus-TCP根本不需要从地址,因为已经有IP地址以及MAC地址进行了绑定! |