完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我使用PIC32以太网启动器套件2和Belkely-TCPP-客户端MPLAB和谐示例应用程序来连接我的PC上的服务器应用程序:IP:192.16883.6和端口:9999。我猜我正在做一些错误的IP转换到字节(在MPLAB中不再定义字节,所以我使用了无符号字符映射)。如下:案例AppDAT.AdR.SnO.D.S.un.b. SyB1=(unChar char)192;AppDATA AdDr.SnAdR.S.un.b. SyB2=(unChar char)168;AppDATA ADDR.SnAdRD.S.un.S.un.b. Syb3 =(unChar char)88;AppDATA AdR.SnAdRD.Syun.Sunun.B.SyB4=(unChar char)6;AppDATA(连接(AppDATA套接字,(StutoSokADDR*)和AppDATA.ADDR,ADDLLN)0)返回;AppDATA状态=AppHyBSDyStand;}我附加了MPLAB和谐TCPIP栈配置,我的PC的网络配置和完整的A邮政编码。任何帮助都是值得赞赏的。
以上来自于百度翻译 以下为原文 I am using PIC32 Ethernet Starter Kit 2 and berkeley_tcp_client MPLAB HARMony example app to connect a server app on my PC with IP: 192.168.88.6 and Port: 9999. I guess I am doing something wrong with IP conversion to byte (there is no longer byte is defined in MPLAB so I used unsigned char casting) as follows: case APP_BSD_CONNECT: { appData.addr.sin_addr.S_un.S_un_b.s_b1 = (unsigned char)192; appData.addr.sin_addr.S_un.S_un_b.s_b2 = (unsigned char)168; appData.addr.sin_addr.S_un.S_un_b.s_b3 = (unsigned char)88; appData.addr.sin_addr.S_un.S_un_b.s_b4 = (unsigned char)6; appData.addr.sin_port = 9999; int addrlen = sizeof(struct sockaddr); if(connect( appData.socket, (struct sockaddr*)&appData.addr, addrlen) < 0) return; appData.state = APP_BSD_SEND; } I attached the MPLAB Harmony TCPIP Stack configuration, network configuration of my PC and the full app.c code to the post. Any help is appreciated.. Kind Regards Sarp Attached Image(s) Attachment(s) app.c (15.50 KB) - downloaded 45 times |
|
相关推荐
3个回答
|
|
|
看起来PC和PIC32都配置了相同的IP地址:192.1688. 6.你需要在网络上有每个主机有它自己的地址。
以上来自于百度翻译 以下为原文 It looks like both the PC and the PIC32 are configured with the same IP address: 192.168.88.6. You need to have each host on the network with its own address. |
|
|
|
|
|
事实上,PIC32的IP是不可配置的,因为它是客户端,并且它的IP是由网络提供的。无论如何,我改变了IP地址,仍然不起作用。谢谢你的回复!
以上来自于百度翻译 以下为原文 In fact, IP of PIC32 is not configurable since it is client and its IP is given by the network. Anyway, I changed the IP address and still does not work. Thanks for the reply! |
|
|
|
|
|
如果PIC32板有一个合适的IP地址,那么最好的办法是发布一个WiReSARK日志,这样我们就可以看一看。你能从PIC32板上从PC机和PC机上ping PIC32板,其他的东西看起来都很好吗?
以上来自于百度翻译 以下为原文 If the PIC32 board has a proper IP address for that network, then probably the best way to have an idea of what's going on is to post a wireshark log, so we can take a look. Can you ping the PIC32 board from your PC and the PC from the PIC32 board, everything else seems to be working fine? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
454 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3529 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
466浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 17:54 , Processed in 0.788604 second(s), Total 75, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2291