完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
您好,对于TCPIPHTHPNETNETRICICWRESE()函数,有人知道什么是“DIAKACK”参数吗?我不知道什么时候我必须在TCPPIPSHtpUpFrand函数中设置/清除它,我可以多次调用TCPPIPSHTTPNET NETRICADION,还是必须调用它一次?我能做吗?谢谢
以上来自于百度翻译 以下为原文 Hello, For TCPIP_HTTP_NET_DynamicWrite() function, someone know what is "needAck" parameter for ? I don't know when I must set/clear it In a TCPIP_HTTP_Print function, I can call several times TCPIP_HTTP_NET_DynamicWrite or must call it one time ? ie : can I do it ? TCPIP_HTTP_DYN_PRINT_RES TCPIP_HTTP_Print_hello_world(TCPIP_HTTP_NET_CONN_HANDLE connHandle, const TCPIP_HTTP_DYN_VAR_DCPT *vDcpt){ TCPIP_HTTP_NET_DynamicWriteString(vDcpt, "Hello ", false); TCPIP_HTTP_NET_DynamicWriteString(vDcpt, "World !", false); } Thanks |
|
相关推荐
19个回答
|
|
|
当我搜索和声DIR时,我看到了一个描述DIAACK参数的条目。
以上来自于百度翻译 以下为原文 When I search the harmony dir for I see an entry describing the needAck parameter. |
|
|
|
|
|
|
|
|
|
|
|
是的,我确实理解它的必要性和如何使用它。尽管和声文档有很多细节,但它常常是很迟钝的。有时我发现我必须尝试这个选项并观察结果(通常当我遇到一些我以前没有见过/使用过的东西,而我不耐烦的时候)有SAMP。使用它的LES设置假和真。
以上来自于百度翻译 以下为原文 Yes I do understand the need for it and how to use it. Though the Harmony Documentation is there in great detail it is often quite obtuse. Sometimes I find I must try the option and observe the results ( usually when I encounter something I have not seen/used before and I am impatient ) There are samples that make use of it set both false and true. |
|
|
|
|
|
从THECPIPHTHIPNETNETDRORICICWORD的头文件解释(同样应该在文档中,因为它是从这个文件中派生出来的):“用户通过这个调用传入的缓冲区在内部使用可用的动态变量缓冲描述符排队。这意味着缓冲区必须是持久的。一旦缓冲区被处理并发送到输出,动态调用回调将被调用,以通知用户相应的缓冲区可以被重用/释放。“因此,可能需要一段时间,直到该缓冲区被处理。例如,在ROM/Flash中,当它被处理时,它没有关系,没有什么可以做的,所以你可以通过“DIAKACK==false”。但是,如果你已经动态地分配了那个缓冲区,或者你使用一个缓冲池,你可以在不同的任务中共享。缓冲区现在可以提供给您,您可以重用它。我希望澄清一下。
以上来自于百度翻译 以下为原文 From the header file explanation for the TCPIP_HTTP_NET_DynamicWrite (the same should be in the documentation, since it's derived from this): "The buffer passed in by the user with this call is queued internally using an available dynamic variable buffer descriptor. That means that the buffer has to be persistent. Once the buffer is processed and sent to output, the dynamicAck callback will be called, to inform the user that the corresponding buffer can be reused/freed." So, it may take a while until that buffer is processed. If you've passed in a constant buffer, for example, in ROM/flash, then it does not matter when it's been processed, there's nothing to do about it, so you can pass in "needAck == false". However, if you've allocated that buffer dynamically, or you use a pool of buffers which you share among various tasks, etc. you want to know that the buffer is now available to you and you can reuse it. I hope that clarifies it a bit. |
|
|
|
|
|
|
|
|
|
|
|
在MLA中,我使用了CurHTTP.CalbPoPs作为状态机来发送大量数据:我在和谐中看到,我可以使用TCPIpHypHtpInEngutsCalnCouthPosig()和TCPIpHypHypTyNoNeCalnalCalpReBasePoSt函数来替换CurHTHTP.CalbPoPs,但它们是遗留的。阿蒙尼?我在哪里可以找到一个例子?此外,在HtpPoad进程(JSONOBJ)中需要持久数据。CurHTTHP.数据不存在于和谐中:我该怎么办?=是否可以使用TCPIPHTHPSNETLICANDATIONDATFUGETER()返回的缓冲区?我可以写在这个缓冲区(与Cookie和POST没有冲突吗?)?
以上来自于百度翻译 以下为原文 With MLA I used curHTTP.callbackPos as state machine to send a large amout of data : void HTTPPrint_bigData(void){ char data[151]; MAKEJSON_OBJ *jsonObj = curHTTP.data; if(curHTTP.callbackPos == 0){ curHTTP.callbackPos = 1; initJson(jsonObj); } while(TCPIsPutReady(sktHTTP) > 150){ switch(curHTTP.callbackPos){ case 1: getStringInfo1(data, jsonObj); TCPPutString(sktHTTP, data); break; case 2: getStringInfo2(data, jsonObj); TCPPutString(sktHTTP, data); break; case 3: getStringInfo3(data, jsonObj); TCPPutString(sktHTTP, data); break; default: getStringInfo4(data, jsonObj); TCPPutString(sktHTTP, data); curHTTP.callbackPos = 0; // exit return; } curHTTP.callbackPos++; } } I saw in Harmony I can use TCPIP_HTTP_NET_ConnectionCallbackPosGet() and TCPIP_HTTP_NET_ConnectionCallbackPosSet functions to replace curHTTP.callbackPos but they are legacy. What is the best practice to do it with Harmony ? Where can I find an exemple ? Also, I need persistant data during the HTTPPrint process (to jsonObj). curHTTP.data doesn't exist in Harmony : how can I do ? => can I use buffer returned by TCPIP_HTTP_NET_ConnectionDataBufferGet() ? I can write in this buffer (there is no conflict with cookie and POST ?) ? |
|
|
|
|
|
首选的协调机制是使用TCPIpHtpHypNETyDyPrrnter()和ReTurnTCPIpHypPyDyPrpTyRestOpjyType,只要您有更多的数据要发送。一旦完成并打印最后一个动态内容,只需返回TrpTCPIpHypPyDypPrimtTrasReStION。
以上来自于百度翻译 以下为原文 The preferred Harmony mechanism is using TCPIP_HTTP_NET_DynPrint() and returning TCPIP_HTTP_DYN_PRINT_RES_PROCESS_AGAIN for as long as you have more data to send. Once you're done and print the last dynamic content, simply return TCPIP_HTTP_DYN_PRINT_RES_DONE. |
|
|
|
|
|
是的,但是如何替换CurHTP.CalbPOS状态机系统呢?…您在TCPIPSHHTPNETNICANDATIONDATUFFER()缓冲区中保存状态机值吗?问题是,TcCPIPHtpHypNeTnClutoDuffuffEnter()缓冲区没有初始化为TCPIPHITHPSPRead函数的第一次调用0。您能告诉我如何更改我的代码以实现和谐吗?
以上来自于百度翻译 以下为原文 Yes but how do you do to replace curHTTP.callbackPos state machine system ? ... You save state machine value in TCPIP_HTTP_NET_ConnectionDataBufferGet() buffer ? => problem is that TCPIP_HTTP_NET_ConnectionDataBufferGet() buffer isn't initialized to 0 for the first call of TCPIP_HTTP_Print function. Could you show me how do you do to change my code for Harmony ? |
|
|
|
|
|
我更改了HtpPyAppListGeDimeBuffER()函数,但我不确定这是最好的方法:
以上来自于百度翻译 以下为原文 I changed HTTP_APP_GetDynamicBuffer() function but I'm not sure it is the best method : typedef struct { uint16_t busy; // buffer is currently in process uint16_t bufferSize; // size of the associated buffer uint32_t sm; // state machine value TCPIP_HTTP_NET_CONN_HANDLE connHandle; // Leave this variable just before data to align dat address to void* pointer // buffer for writing the dynamic variable callback content // => address of this variable, must be void* pointer aligned !!!!! char data[HTTP_APP_DYNVAR_BUFFER_SIZE]; }HTTP_APP_DYNVAR_BUFFER; // helper to get one of the application's dynamic buffer that are used in the // dynamic variables processing HTTP_APP_DYNVAR_BUFFER *HTTP_APP_GetDynamicBuffer(TCPIP_HTTP_NET_CONN_HANDLE connHandle){ int ix; HTTP_APP_DYNVAR_BUFFER *pDynBuffer; HTTP_APP_DYNVAR_BUFFER *pNotUsedBuffer = NULL; pDynBuffer = httpDynVarBuffers; for(ix = 0; ix < sizeof(httpDynVarBuffers)/sizeof(*httpDynVarBuffers); ++ix, pDynBuffer++) { if(pDynBuffer->busy == 0){ pNotUsedBuffer = pDynBuffer; } else { if(pDynBuffer->connHandle == connHandle){ return pDynBuffer; } } } if(pNotUsedBuffer){ if(pNotUsedBuffer->busy == 0){ pNotUsedBuffer->busy = 1; pNotUsedBuffer->sm = 0; return pNotUsedBuffer; } } return 0; // No buffer available } |
|
|
|
|
|
…这不是一个好的方法,因为当HTTP进程确认缓冲区时,SM值丢失。
以上来自于百度翻译 以下为原文 ... It isn't a good methode because when HTTP process acknowledge buffer, sm value is lost |
|
|
|
|
|
您可以在您的httppAppAddiValux缓冲区中存储2个其他成员:要发送的字节总数——当您发送更新的发送字节的缓冲区时,当前的字节数,当您得到回调时,您知道是否需要再次返回或完成。这是你想要实现的,发送大量字节,或者是别的什么东西?
以上来自于百度翻译 以下为原文 You could store in your HTTP_APP_DYNVAR_BUFFER 2 other members: - the total number of bytes you want to send - the current number of bytes sent When you send the buffer you update the sent bytes and when you get the callback you know if you need to return AGAIN or DONE. You don't need to use the HTTP internal data for this. Is this what you want to achieve, sending a large number of bytes, or is it something else? |
|
|
|
|
|
您好,我不确定我理解了:当调用TCPIPHHTPJNETYONEXPROCEGER()时,只有当“字节总数”=“当前发送的字节数”时,我才能清除忙变量。但是,如果在HoppPress进程(IE:连接超时)中丢失连接,我必须如何清除繁忙变量?
以上来自于百度翻译 以下为原文 Hello, I'm not sure that I understood : when TCPIP_HTTP_NET_DynAcknowledge() is called, I must clear busy variable only if "the total number of bytes" = "the current number of bytes sent" ? But, If the connection is lost during the HTTPPrint process (ie : connection timeout), how must I do to clear the busy variable ? |
|
|
|
|
|
我想说的是,你可以使用与回调前完全相同的逻辑。但是保持你自己的变量,而不是依靠HTTP来为你提供存储。如果连接丢失,我猜浏览器会重新连接并再次请求页面。不确定你在这里想要达到什么目的。请给出更多细节。
以上来自于百度翻译 以下为原文 What I'm trying to say is that you can use exactly the same logic that you had before with the callbackPos. But maintain your own variables rather than rely on the HTTP to provide storage for you. If the connection is lost, I guess the browser will reconnect and ask again for the pages. Not sure what you're trying to achieve here. Please give some more details. |
|
|
|
|
|
我的问题是,我不知道如何检测TCPIPSHHTPX打印的第一个调用以及连接的结束或/和TCPPIPSHTPUPrPress进程:它是强制的init和释放我的变量。= & gt;我需要TCPIPpHtpP.NETSyEngRePoT()函数新事件:连接关闭。如果浏览器重新连接再次询问页面,我的新HTTP句柄将打开:如果我的变量没有被释放,我会有内存溢出。你能给我一个例子来管理应用程序代码中的回调变量吗?
以上来自于百度翻译 以下为原文 My problem is that I don't see how to detect the first call of a TCPIP_HTTP_Print and the end of the connection or/and TCPIP_HTTP_Print process : it is mandatory to init and to free my variables. => I need for TCPIP_HTTP_NET_EventReport() function new event : connection close. If browser reconnect and ask again for the pages, I new HTTP handle will be open : if my variables aren't freed, I will have a memory overflow. Can you give me an exemple to manage a callbackPos variable in application code ? |
|
|
|
|
|
我想我理解你正在描述的情况。内部HTTPNET检测到一个断开(超时或远程连接关闭,例如)。可以添加一个新的断开事件,让你知道相应的连接不再活跃。LY分配的资源仍在等待处理。我将在这里发布一个更新HTTPNET文件,您可以尝试一下,让我知道它是否适合您。
以上来自于百度翻译 以下为原文 I think I understand the situation that you're describing. Internally HTTP_NET detects a disconnect (timeout or remote connection closed, for example). A new disconnect event could be added to let you know that the corresponding connection is no longer active. That would allow you to free any previously allocated resources that are still waiting for processing. I'll post here an update of http_net file and you can give it a try and let me know if it works for you. |
|
|
|
|
|
请使用附加的文件并尝试它(删除.txt扩展)。添加了一些事件:TCPIPPHITHOSPONTCPIPCIPHHTPNETNEXEngEclipse,DeNETCPIPPHTTPNET,EngEnEclipse,TimeOutOutTCPIPHHTPNETEngEngEclipse,PraseRoTrpCPIPHHTPNETEngEnEclipse。但是这些名字应该相当清楚。等待一些进一步的验证,这些更改将被添加到中继线代码中。现在你应该拥有所有的事件来帮助正确地管理你的资源。如果提供的代码有任何问题,请告诉我们。
HTTPNET.C.TXT(204.96 KB)-下载了40次HTTPYNETHIPULATET.H.TXT(24.21 KB)-下载了29次 以上来自于百度翻译 以下为原文 Please use the attached files and give it a try (remove the .txt extension). Few events have been added: TCPIP_HTTP_NET_EVENT_OPEN TCPIP_HTTP_NET_EVENT_CLOSE_DONE TCPIP_HTTP_NET_EVENT_CLOSE_TIMEOUT TCPIP_HTTP_NET_EVENT_CLOSE_POST_ERROR TCPIP_HTTP_NET_EVENT_CLOSE_REMOTE. Explanations are in the http_net.h but the names should be fairly clear. Pending some further validation the changes will be added to the trunk code. You should have all the events now to help with properly managing your resources. Let us know if any issues with the supplied code. Attachment(s) http_net.h.txt (111.49 KB) - downloaded 25 times http_net.c.txt (204.96 KB) - downloaded 40 times http_net_private.h.txt (24.21 KB) - downloaded 29 times |
|
|
|
|
|
|
|
|
|
|
|
我有一些疑问:对于一个连接句柄,当调用TCPIpHutpHypPyTrnType()函数中的TCPPIpHutpHypItRead()函数时,在调用TCPPIpHtpPyp之前,HTTPNET是否调用TCPIpHypHIPNETYONDYNORGEER()或Dyn buffer之前已经确认的HTTPNET?rTin()函数?
以上来自于百度翻译 以下为原文 I have some doubts : for a connHandle, when you call TCPIP_HTTP_NET_DynamicWrite() in a TCPIP_HTTP_Print() function, is it possible that HTTP_NET call TCPIP_HTTP_Print() function before TCPIP_HTTP_NET_DynAcknowledge() or HTTP_NET wait that Dyn buffer has been acknowledged before recall TCPIP_HTTP_Print() function ? |
|
|
|
|
|
如果底层TCP传输速度慢(网络问题等)和多个动态缓冲区与TCPIPHITHPSPNETRIGICICWREST()一起排队,那么我认为在所有先前的缓冲区都被排除并被确认之前,可以开始处理另一个动态变量。这是您的任务吗?离子?
以上来自于百度翻译 以下为原文 If the underlying TCP transport is slow (network problems, etc.) and multiple dynamic buffers are queued with TCPIP_HTTP_NET_DynamicWrite() then I think it's possible to begin the processing of another dynamic variable before all the previous buffers went out and were acknowledged. Is this your question? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1097浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 07:22 , Processed in 1.560161 second(s), Total 108, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1093