TuyaOS
|
wrapper for HTTP session manager 更多...
结构体 | |
struct | S_HTTP_MANAGER |
The HTTP session manager structure. 更多... | |
宏定义 | |
#define | INVALID_HTTP_SESSION_ID 0xFFFFffff |
#define | MAX_HTTP_SESSION_NUM 16 |
#define | MAX_HTTP_URL_LEN 256 |
类型定义 | |
typedef SESSION_ID(* | FUNC_HTTP_SESSION_CREATE) (IN CONST CHAR_T *url, BOOL_T is_persistent) |
This API is used to create HTTP session 更多... | |
typedef SESSION_ID(* | FUNC_HTTP_SESSION_CREATE_TLS) (IN CONST CHAR_T *url, BOOL_T is_persistent, tuya_tls_config_t *config) |
This API is used to create HTTP session 更多... | |
typedef OPERATE_RET(* | FUNC_HTTP_SESSION_DESTORY) (SESSION_ID session) |
This API is used to destroy HTTP session 更多... | |
typedef OPERATE_RET(* | FUNC_HTTP_SESSION_RECEIVE) (SESSION_ID session, http_resp_t **resp) |
This API is used to recv response header from HTTP session 更多... | |
typedef OPERATE_RET(* | FUNC_HTTP_SESSION_RECEIVE_DATA) (SESSION_ID session, http_resp_t *pResp, BYTE_T **pDataOut) |
This API is used to recv response content from HTTP session. 更多... | |
typedef OPERATE_RET(* | FUNC_HTTP_SESSION_SEND) (IN CONST SESSION_ID session, IN CONST http_req_t *req, http_hdr_field_sel_t field_flags) |
This API is used to send HTTP session request 更多... | |
typedef S_HTTP_SESSION * | SESSION_ID |
枚举 | |
enum | E_HTTP_SESSION_STATE { HTTP_FREE = 0 , HTTP_DISCONNECT , HTTP_CONNECTING , HTTP_CONNECTED , HTTP_UPLOADING } |
Definition of HTTP session state | |
函数 | |
S_HTTP_MANAGER * | get_http_manager_instance (VOID_T) |
Retrieve instance of HTTP session manager 更多... | |
wrapper for HTTP session manager
typedef SESSION_ID(* FUNC_HTTP_SESSION_CREATE) (IN CONST CHAR_T *url, BOOL_T is_persistent) |
This API is used to create HTTP session
[in] | url | URL of HTTP session, max len of URL is 256 |
[in] | is_persistent | Session is persistent or not |
typedef SESSION_ID(* FUNC_HTTP_SESSION_CREATE_TLS) (IN CONST CHAR_T *url, BOOL_T is_persistent, tuya_tls_config_t *config) |
This API is used to create HTTP session
[in] | url | URL of HTTP session, max len of URL is 256 |
[in] | is_persistent | Session is persistent or not |
typedef OPERATE_RET(* FUNC_HTTP_SESSION_DESTORY) (SESSION_ID session) |
This API is used to destroy HTTP session
[in] | session | Session returned from the call to FUNC_HTTP_SESSION_CREATE |
typedef OPERATE_RET(* FUNC_HTTP_SESSION_RECEIVE) (SESSION_ID session, http_resp_t **resp) |
This API is used to recv response header from HTTP session
[in] | session | Session returned from the call to FUNC_HTTP_SESSION_CREATE |
[in,out] | resp | Pointer to a pointer of type http_resp_t .The structure will be allocated by the callee. Note that the caller does not need to free the structure allocated and returned from this API. The allocation and free is done by the callee automatically |
typedef OPERATE_RET(* FUNC_HTTP_SESSION_RECEIVE_DATA) (SESSION_ID session, http_resp_t *pResp, BYTE_T **pDataOut) |
This API is used to recv response content from HTTP session.
[in] | session | Session returned from the call to FUNC_HTTP_SESSION_CREATE |
[in] | pResp | The http_resp_t structure returned from the call to FUNC_HTTP_SESSION_RECEIVE |
[in,out] | pDataOut | Caller allocated buffer |
typedef OPERATE_RET(* FUNC_HTTP_SESSION_SEND) (IN CONST SESSION_ID session, IN CONST http_req_t *req, http_hdr_field_sel_t field_flags) |
This API is used to send HTTP session request
[in] | session | Session returned from the call to FUNC_HTTP_SESSION_CREATE |
[in] | req | The http_req_t structure filled up with appropriate parameters |
[in] | field_flags | The http_hdr_field_sel_t, OR of zero or more flags |
S_HTTP_MANAGER * get_http_manager_instance | ( | VOID_T | ) |
Retrieve instance of HTTP session manager