在带Free_RTOS下程序卡死在lRetVal = HTTPCli_getResponseStatus(httpClient);没有返回值
时间:10-02
整理:3721RD
点击:
Hi,TI的员工们:
你们好。我是在httpserver引入httpclient,创建了一个任务通过httpclient向服务器发送数据,但是发现发送数据后无法读取响应,程序一直卡死在lRetVal = HTTPCli_getResponseStatus(httpClient);没有返回值,确认服务器已经收到数据了。请教是什么问题?
static void HTTPClientTask(void *pvParameters) { long lRetVal = -1; HTTPCli_Struct httpClient; //Connect to Network lRetVal = ConnectToNetwork(); if(lRetVal < 0) { UART_PRINT("\n\r***********连接WIFi失败**************\n\r"); LOOP_FOREVER(); } //Handle Async Events while(1) { UART_PRINT("\n\r*********************开始连接服务器****************\n\r"); lRetVal = ConnectToHTTPServer(&httpClient); if(lRetVal < 0) { ERR_PRINT(lRetVal); LOOP_FOREVER(); } UART_PRINT("\n\r"); UART_PRINT("HTTP Post Begin:\n\r\r\n"); lRetVal = HTTPPostMethod(&httpClient); if(lRetVal < 0) { UART_PRINT("HTTP Post failed.\n\r"); } UART_PRINT("\r\nHTTP Post End:\n\r"); HTTPCli_disconnect(&httpClient); Delay(); Delay(); } }
给的代码貌似没有这个函数调用,请参考这个博文介绍。
http://blog.csdn.net/hytgab/article/details/47113013