完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我最近刚开始使用HARMony和MPLLABX,因为我用MPLAB 8编译和使用TCPIP堆栈v5x的项目已经工作了两年,所以Goggle停止接受SSL连接。我试过添加Wolf SSL,但是无法工作,所以我决定尝试MPLAB X和Harmony。我花了几天试图让他们工作,我决定把SD卡和USB的旧MLA代码移植到我的和谐项目中。在移植它上花了几个小时之后,令人惊讶,令人惊讶——MLA代码没有任何问题地工作。最后要做的是让DDNS工作。再一次,我花了几个小时来弄清楚它为什么不工作——IP地址已经改变,我一直有一个状态DDNS_STATUS_UNCHANGED,不需要更新(在ddns.c中)以下是来自ddns.c的代码的一部分。从情况SM_CHECKIP_FIND_ADDRESS:,如果找到IP地址,代码直接进入情况SM_CHECKIP_DISCONNECT:,而不增加smDDNS。SMDDN增加。代码中的注释是-需要执行更新-即,我们应该到达情况SM_IP_UPDATE_HOME:。但是当smDDNS增加时,它将从SM_CHECKIP_FIND_ADDRESS更改为SM_CHECKIP_DISCONNECT,而不是SM_IP_UPDATE_HOME。这意味着在下一次运行任务时,我们以caseSM_CHECKIP_DISCONNECT结束,lastKnownIP等于ipParsed,我们返回SM_DONE——不需要更新!!!!我的问题的解决方案(除非我漏掉了什么东西)是在SM_CHECKIP_FIND_ADDRESS,smDDNS++的情况下添加。我希望这会帮助具有相同问题的人——除非我错了,并且代码应该正常工作? 以上来自于百度翻译 以下为原文 , I have started recently with Harmony and MPLAB X because my project that worked for a couple of years compiled with MPLAB 8 and using TCPIP stack v5xx stopped working - Goggle stopped accepting SSL connection. I have tried adding Wolf SSL but I couldn't get it to work so I decided to try MPLAB X and Harmony. An example of an app provided with Harmony, using Wolf SSL worked so there was a hope that I can get my project converted (re-done). After a lot of struggle, and giving up on SD Card and USB Host drivers from Harmony - I spent a couple of days trying to get them working I have decided to port old MLA code for SD Card and USB to my Harmony project. And after a couple of hours spent on porting it, surprise, surprise - MLA code works without any problems. The last thing to do was to get DDNS working. And again, I have spent a couple of hours to figure out why it doesn't work - IP address has changed and I always had a status DDNS_STATUS_UNCHANGED, no update required (in ddns.c) Below is part of the code from ddns.c smDDNS++; case SM_CHECKIP_FIND_ADDRESS: // Check if remote node is still connected. If not, force to the disconnect state, // but don't break because data may still be waiting. if(!TCPIP_TCP_IsConnected(MySocket) || SYS_TMR_TickCountGet() - DDnsTimer > 6*SYS_TMR_TickCounterFrequencyGet()) smDDNS = SM_CHECKIP_DISCONNECT; // Search out the " |
" delimiter in the response
wPos = TCPIP_TCP_ArrayFind(MySocket, (const uint8_t*)"", 7, 0, 0, false);
// If not yet found, break
if(wPos == 0xffff)
break;
// Read and terminate that string as the IP address (preventing buffer overflows)
if(wPos > 15u)
wPos = 15;
TCPIP_TCP_ArrayGet(MySocket, vBuffer, wPos);
vBuffer[wPos] = '