绵绵呀
绵绵呀
This guy hasn't written anything yet

注册于 10 months ago

回答
5
文章
0
关注者
0

int ESP8266_Get_Comment ( void )
{

    at_response_t resp = RT_NULL;

    resp = at_create_resp(1024, 0, rt_tick_from_millisecond(10000));
    if (!resp)
    {
        LOG_E("No memory for response structure!");
        return -RT_ENOMEM;
    }

    if (at_exec_cmd(resp,"GET https://api.seniverse.com/v3/weather/now.json?key=St4bOhFvShcUJhU4_&location=beijing&language=zh-Hans&unit=c\r\n\r\n")!= RT_EOK)
    {
        LOG_E("AT client send commands failed, response error or timeout !");
        return 0;
    }

    LOG_D("line_num=%d", resp->line_counts);
    for (int i = 0; i < (int) resp->line_counts; i++)
    {
        LOG_D("%s", at_resp_get_line(resp, i + 1));
    }
    at_delete_resp(resp);
    return RT_EOK;
}

回到
顶部

发布
问题

投诉
建议