完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我使用的是HARMony 1.07。我需要知道网络接口是否就绪,这意味着:-电缆已连接,IP地址已分配,等等……换句话说,堆栈正在工作。我原本打算使用:TCPIP_STACK_NetisReady,但是它要求使用TCPIP_NET_HANDLE hNet.我如何得到HNET?我有一个Obj.tcpip,在TCPIP_STACK_Status初始化期间使用,等待堆栈就绪。我需要从我的主代码而不是从任何post或print函数中知道它,然后我知道我可以安全地调用其他函数,比如TCPIP_SNTP_ConnectionInitiate、TCPIP_SNTP_TimeStampGet等……谢谢你的帮助!最好的问候,Stephane。
以上来自于百度翻译 以下为原文 Hello I am using Harmony 1.07. I need to know if the network interface is ready which means: - The cable is connected - The IP Address is assigned - etc... In other words, the stack is working. I was thinking to use: TCPIP_STACK_NetIsReady but it is asking for TCPIP_NET_HANDLE hNet. How do I get hnet? I have sysObj.tcpip which is used during initialization for TCPIP_STACK_Status waiting for the stack to be ready. I need to know it from my main code and not from any post or print functions then I know I can call other functions safely like TCPIP_SNTP_ConnectionInitiate, TCPIP_SNTP_TimeStampGet etc... Thank you for your help! Best Regards, Stephane. |
|
相关推荐
15个回答
|
|
看看示例项目有一个函数来获取网络句柄。
以上来自于百度翻译 以下为原文 Look at the example projects There is a function to get the net handle. |
|
|
|
我猜我猜我找不到它。有什么线索可以告诉我们什么是正确的代码?斯蒂夫
以上来自于百度翻译 以下为原文 I searched but I guess I was not able to find it. Any clue on what is the correct code to do this? Steph |
|
|
|
对不起,我星期一才能查到。您可以尝试在和声帮助文件中查找它。
以上来自于百度翻译 以下为原文 Sorry I could not look it up till Monday. You can try looking it up in the Harmony help file. |
|
|
|
HeloLi看到这个函数:TCPIPPNETHORE TCPIPSISTACKIDENXXTENT(int NETIX);NETId=接口索引。接口是什么?网络配置?我猜第一个和声(PIC32)是0,下一个是WiFi的1?谢谢您!Stephane。
以上来自于百度翻译 以下为原文 Hello I am seeing this function: TCPIP_NET_HANDLE TCPIP_STACK_IndexToNet(int netIx); netId = Interface index. What is the Interface? The network configuration? I guess 0 for the first one declared in Harmony (PIC32INT) and 1 for the next one like Wifi? Thank you! Stephane. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
例子没有给出解释,我在一个例子中看到了,文件真的很轻。它从来没有给出参数的真正解释,只是第一个意思。谢谢Stephane。
以上来自于百度翻译 以下为原文 Examples are not giving explanations, I saw it in one example, the documentations is really light. It is never giving the real explanations of the parameters, just the first meaning. Thanks Stephane. |
|
|
|
如果您查看TCP/IP Web服务器,应该有一个函数调用。你可以看到他们是如何使用它的。这些例子很少有有用的评论,很少解释行动。如果你不能让它工作,就在星期一撞上胎面。
以上来自于百度翻译 以下为原文 If you look at the TCP/IP web server there should be a call to the function. You can see how they used it. The examples have few useful comments and little explain action. If you can't get it to work, bump the tread on Monday. |
|
|
|
是的,您可以使用TCPIP_STACK_IndexToNet(int netIx),如果netIx是第一个配置的接口的0,第二个配置的接口为1,等等。也可以使用接口名称:TCPIP_NET_HANDLE hNet=TCPIP_STACK_NetHandleGet("PIC32INT");或者TCPIP_NET_HANDLE hNet=TCPIP_STACK_NetHandleGet("eth0")。orTCPIP_NET_HANDLE hNet=TCPIP_STACK_NetHandleGet(“wlan0”);所有内容都在文档和头文件中:tcpip_manager.h。这是授予对堆栈控件访问权限的模块:堆栈管理器。
以上来自于百度翻译 以下为原文 Yes, you can use TCPIP_STACK_IndexToNet(int netIx) wher the netIx is the 0 for the 1st configured interface, 1 for the second and so on. Alternatively you can use the interface name: TCPIP_NET_HANDLE hNet = TCPIP_STACK_NetHandleGet("PIC32INT"); or TCPIP_NET_HANDLE hNet = TCPIP_STACK_NetHandleGet("eth0"); or TCPIP_NET_HANDLE hNet = TCPIP_STACK_NetHandleGet("wlan0"); It's all in the documentation and in the header file: tcpip_manager.h. This is the module that gives access to the stack control: the stack manager. |
|
|
|
非常感谢您提供的函数TCPIP_STACK_NetHandleGet,我更喜欢这个。另一个问题当我们有两个网络配置时,堆栈选择这两个接口中的任何一个来执行这些函数?例如,如果我有PIC32INT+SPI Wifi模块,当我执行TCPIP_SNTP_TimeStampGet时,堆栈将尝试使用两个接口,直到找到连接的接口?非常感谢你的帮助!最好的问候!Stephane。
以上来自于百度翻译 以下为原文 Hello Thank you very much for the function TCPIP_STACK_NetHandleGet, I prefer this one. Another question When we have 2 Network Configurations, the stack select any of the 2 interfaces to execute the functions? For example, if I have PIC32INT + a SPI Wifi Module, when I execute TCPIP_SNTP_TimeStampGet, the stack will try using both interfaces until it finds one which is connected? Thank you very much for your help! Best Regards! Stephane. |
|
|
|
您可以指定首选SNTP接口:1。初始化数据TCPIPPSntppMeqEnEngIfg::NTPyIdFrute2。运行时CaltTCPIpnSntppLnCalnApple PARAMSET(TCPIPPNETHORACE NETH,…)。堆栈将尝试第一首选的接口,但是如果首选接口下降,将尝试另一个接口。但是,一旦接口被选择,它将不执行重试,如果NTP服务器不应答,例如。
以上来自于百度翻译 以下为原文 You can specify the preferred SNTP interface using: 1. either the initialization data TCPIP_SNTP_MODULE_CONFIG::ntp_interface 2. or the run time call TCPIP_SNTP_ConnectionParamSet(TCPIP_NET_HANDLE netH, ...). The stack will try 1st the preferred interface but if the preferred interface is down will try another one. However, once the interface is selected, it won't perform retries, if the NTP server does not reply, for example. |
|
|
|
你好,Rainad,非常感谢你!因此,如果我理解得很好,在初始化时,默认情况下,它会拿起一个上升。因此,如果网络电缆没有连接并且Wifi模块是开着的,例如,它将拾取Wifi。最好有一个函数来知道该堆栈是否准备好独立于接口的各种模块的各种功能。我想我需要循环以上功能的各种接口,直到我找到一个可以考虑的整体,它已经准备好了吗?再次感谢!Steph!
以上来自于百度翻译 以下为原文 Hi Rainad, Great thank you! So if I understand well, at initialization, by default, it will pick up the one which is up. So if the network cable is not connected and the Wifi module is on for example, it will pick up the Wifi. Would have been good to have a function to know if the stack is ready for the various functions of the various modules independently of the interface. I guess I need to loop over the various interface with above function until I find one ready to consider overall it is ready? Thanks again!! Steph. |
|
|
|
所有的模块都是在堆栈初始化后准备好的(初始化成功)。ETS电缆或Wi-Fi断开可能在任何时候发生,所以它与堆栈模块无关。TecPIPStaskNeTraseRead()将告诉你,那个特定的接口是否准备就绪,以便您可以启动CO。名词。之后,如果想监视接口状态,只需使用USETCPIPSTACKEnEnType。一旦连接被启动,然后电缆被移除,你将失去连接。
以上来自于百度翻译 以下为原文 All the modules are ready after the stack was initialized (and initialization succeeded). A ETH cable or Wi-Fi disconnect can happen at any time, so it's nothing to do with the stack modules. The TCPIP_STACK_NetIsReady() will tell you if that particular interface is ready so that you can start your connections. After that, simply use TCPIP_STACK_NetIsLinked if you want to monitor the interface status. Once a connection is started and then the cable is removed you'll just lose connectivity. |
|
|
|
非常感谢你的大力帮助,Stephane。
以上来自于百度翻译 以下为原文 Hello Thanks a lot for your great help, Regards, Stephane. |
|
|
|
只有小组成员才能发言,加入小组>>
5184 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3179 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2230 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
511浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 14:56 , Processed in 1.605086 second(s), Total 74, Slave 67 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号