stm32_ota/HARDWARE/LTE/EC20/ec20http.h

34 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef _EC20HTTP_H
#define _EC20HTTP_H
#include "ec20net.h"
/*****************************************
*自定义变量类型
****************************************/
typedef struct
{
char *postBuf ; //HTTP请求 Header+Body格式其中Body用一个%s限定格式下面body字段给出具体格式
char *host ; //HTTP请求的主机
char *httpPort ; //HTTP请求的接口名
char *body ; //HTTP请求body格式
}POSTP_s ; //存放POST请求相关参数的结构体变量类型
/*****************************************
*内部函数声明
****************************************/
RunResult EC20_SendHttpCmd( uint8_t cmdNum, char *format,... ) ; // EC20通过串口发送HTTP相关命令
RunResult Http_Config(void) ; //HTTP相关基本配置
RunResult Http_PDP_Init( void ) ; //EC20 HTTP context的初始化只需要调用一次即可
RunResult Set_HttpURL(char *host) ; //设置HTTP请求的URL
void HttpErrorCode( int errCode ) ; //解析HTTP返回的错误码
/*****************************************
*对外接口函数声明
*注意所有共外部调用的接口入口参数全部统一为ChannalP_s *channal
****************************************/
extern RunResult Http_Init( void ) ; //HTTP初始化
extern RunResult Send_Post( POSTP_s *psHttpP, char* postBody ) ; //http发送post请求
extern RunResult Http_Read( void ) ; //读取HTTP返回的数据报文
#endif