代码库中https_client.c文件修改↓
/**
* @brief HTTP解析请求数据
*
* @param https_request_data
* @return char*
*/
static char* https_get_data(const char* https_request_data)
{
char* request_data = https_request_data;
static char* https_data;
https_data = pvPortMalloc(1024*4);
memset(https_data, 0, 1024*2);
char* date = pvPortMalloc(64);
char* request_value = strtok(request_data, "\n");
for (size_t i = 0; i < 8; i++)
{
printf("%s\r\n", request_value);
if (i==2) strcpy(date, request_value);
request_value = strtok(NULL, "\n");
}
get_https_date(date);
if (request_value != NULL) {
strcpy(https_data, request_value);
}
vPortFree(date);
return https_data;
}
AiPi-Open-Kits/AiPi-Eyes_weather/demos/240X320_ui/custom/custom.h中修改
typedef struct {
char city[16];
char date[12];
char week[10];
char wea[24];
char wea_img[8];
char tem[4];
char tem_day[4];
char tem_night[4];
char win[24];
char win_speed[24];
char win_meter[12];
char air[4];
char pressure[8];
char humidity[8];
} weather_t;
Comments | NOTHING