This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:TI-RTOS
硬件: TM4C1294NCPDT,我们设计了我们的产品。
IAR:7.50.3.10751
TI-RTOS: tirtos_tivac_2_14_04_31
1.使用
UDP 回波 | 显示如何使用 UDP 套接字的 UDP 回显示例 |
2. 我编辑 unsigned char macAddress[6]={0x00、0x00、0x00、0x00、0x00、0x00、 0x00}、 因为
/*获取 MAC 地址*/
FlashUserGet (&ulUser0、&ulUser1); ulUser0=0xffffffff、ulUser1=0xffffffff;
3.编辑 localAddr.Sin_addr.s_addr = inet_addr ("192.168.1.5");//htonl (INADDR_ANY);在 udpEcho.c 中
4. PC 的 IP 为192.168.1.78, excuete --> udpSendReceive 192.168.1.5 100 1 -s100
5. tm4c 无法从 PC 重新获取数据,而且无法从 Wireshark 捕获数据,Wireshark 会显示“谁是192.168.1.5”? 请告知 192.168.1.78。
6. PC ehternet 显示100Mb 链路,PC 与 tm4c 连接,而不使用路由器。
请问原因是什么?
感谢您的回复。
您好!
在第3步"编辑 localAddr.sin addr.s_addr = inet_addr ("192.168.1.5");//htonl (INADDR_ANY);在 udpEcho.c"中、您似乎正在尝试设置静态 IP 地址。 如果是、则这不是正确的方法。 要设置静态 IP、应恢复 udpEcho.c 中的更改、而应编辑 udpEcho.cfg、并在底部添加以下行:
VAR IP = xdc.useModule('ti.ndk.config.Ip'); IP.address ="192.168.1.5"; IP.MASK ="255.255.255.0; ip.gatewayIpAddr ="192.168.1.1";
请尝试使用这些更改再次运行程序。
此致、
达尔顿