WE310F5  39.00.000
m2mb_httpc.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
45 #ifndef M2MB_INC_HTTP_CLIENT_M2MB_HTTPC_H_
46 #define M2MB_INC_HTTP_CLIENT_M2MB_HTTPC_H_
47 
68 /*-----------------------------------------------------------------------------------------------*/
69 
70 
75 /*-----------------------------------------------------------------------------------------------*/
76 /* Global declarations ==========================================================================*/
77 #define M2MB_HTTPCLIENT_MAX_URL_LENGTH 1024 //was 256
78 #define M2MB_HTTPCLIENT_MAX_HOST_LENGTH 64
79 
86 typedef enum M2MB_HTTPC_METHODS {
94 
95 
99 typedef enum M2MB_HTTPC_STATES
100 {
122 
123 
127 typedef enum M2MB_HTTPC_CONF_ID
128 {
147 
151 typedef struct M2MB_HTTPC_RESPONSE{
159 
213 typedef VOID (*M2MB_HTTPC_CB_T)(
214  VOID* arg,
215  M2MB_HTTPC_STATES_E state,
216  M2MB_HTTPC_RESPONSE_T* value);
217 
224  struct param{
227  }param;
237 
246 {
256 
257 
258 
259 /*-----------------------------------------------------------------------------------------------*/
313 /*-----------------------------------------------------------------------------------------------*/
314 
316  HANDLE *hndl,
317  M2MB_HTTPC_OPEN_PARAMS_T* params);
318 
319 /*-----------------------------------------------------------------------------------------------*/
424 /*-----------------------------------------------------------------------------------------------*/
425 
427  HANDLE handle,
428  M2MB_HTTPC_CONF_ID_E conf_id,
429  M2MB_HTTPC_CONF_PARAMS_T * conf_params);
430 
431 /*-----------------------------------------------------------------------------------------------*/
531 /*-----------------------------------------------------------------------------------------------*/
532 
534  HANDLE handle,
535  M2MB_HTTPC_CONF_ID_E conf_id,
536  M2MB_HTTPC_CONF_PARAMS_T * conf_params);
537 
538 /*-----------------------------------------------------------------------------------------------*/
623 /*-----------------------------------------------------------------------------------------------*/
624 
626  HANDLE handle,
627  UINT8 *url,
628  UINT16 port);
629 
630 /*-----------------------------------------------------------------------------------------------*/
724 /*-----------------------------------------------------------------------------------------------*/
725 
727  VOID *handle,
728  M2MB_HTTPC_METHODS_E method,
729  UINT8 *url);
730 /*-----------------------------------------------------------------------------------------------*/
948 /*-----------------------------------------------------------------------------------------------*/
950  VOID *handle,
951  UINT8 isFirstPacket,
952  UINT8 *body,
953  UINT32 body_length,
954  UINT32 total_length);
955 
956 /*-----------------------------------------------------------------------------------------------*/
1052 /*-----------------------------------------------------------------------------------------------*/
1054  HANDLE handle);
1055 
1056 
1060 /*-----------------------------------------------------------------------------------------------*/
1061 
1062 
1063 #endif /* M2MB_INC_HTTP_CLIENT_M2MB_HTTPC_H_ */
M2MB_STATUS_T m2mb_httpc_close(HANDLE handle)
closes an HTTP client session.
M2MB_STATUS_T m2mb_httpc_open(HANDLE *hndl, M2MB_HTTPC_OPEN_PARAMS_T *params)
create http client context
M2MB_STATUS_T m2mb_httpc_set_request(VOID *handle, M2MB_HTTPC_METHODS_E method, UINT8 *url)
Set the http request.
Socket IPv4/IPv6 Internet address union.
Definition: m2mb_socket.h:386
M2MB_HTTPC_STATES
HTTP client callback state.
Definition: m2mb_httpc.h:99
M2MB_HTTPC_METHODS
supported http request method for use with m2mb_httpc_request.
Definition: m2mb_httpc.h:86
enum M2MB_HTTPC_METHODS M2MB_HTTPC_METHODS_E
supported http request method for use with m2mb_httpc_request.
unsigned char UINT8
Definition: m2mb_types.h:86
HTTP client configuration params structure for use in m2mb_http_set_cfg and m2mb_httpc_get_cfg APIs...
Definition: m2mb_httpc.h:223
VOID(* M2MB_HTTPC_CB_T)(VOID *arg, M2MB_HTTPC_STATES_E state, M2MB_HTTPC_RESPONSE_T *value)
User registered callback for returning response message.
Definition: m2mb_httpc.h:213
INT32 M2MB_STATUS_T
Definition: m2mb_status.h:97
M2MB_STATUS_T m2mb_httpc_connect(HANDLE handle, UINT8 *url, UINT16 port)
Connects to an HTTP server in Blocking mode.
M2MB_STATUS_T m2mb_httpc_get_cfg(HANDLE handle, M2MB_HTTPC_CONF_ID_E conf_id, M2MB_HTTPC_CONF_PARAMS_T *conf_params)
get the http client session information
unsigned short UINT16
Definition: m2mb_types.h:87
HANDLE M2MB_HTTPC_CTXT_HANDLE
HTTPC context handle. This is obtained from m2mb_httpc_open API and then used in subsequent HTTPC A...
Definition: m2mb_httpc.h:82
HTTPC parameters required to open a client connection.
Definition: m2mb_httpc.h:245
M2MB_STATUS_T m2mb_httpc_set_cfg(HANDLE handle, M2MB_HTTPC_CONF_ID_E conf_id, M2MB_HTTPC_CONF_PARAMS_T *conf_params)
update the http client session configurations
union M2MB_HTTPC_CONF_PARAMS M2MB_HTTPC_CONF_PARAMS_T
HTTP client configuration params structure for use in m2mb_http_set_cfg and m2mb_httpc_get_cfg APIs...
struct M2MB_HTTPC_CONF_PARAMS::param param
void VOID
Definition: m2mb_types.h:74
struct M2MB_HTTPC_RESPONSE M2MB_HTTPC_RESPONSE_T
HTTP client response for use in user callback.
struct M2MB_HTTPC_OPEN_PARAMS M2MB_HTTPC_OPEN_PARAMS_T
HTTPC parameters required to open a client connection.
unsigned long int UINT32
Definition: m2mb_types.h:88
enum M2MB_HTTPC_CONF_ID M2MB_HTTPC_CONF_ID_E
HTTP client confg id for use in m2mb_http_set_cfg and m2mb_httpc_get_cfg APIs.
M2MB_HTTPC_CONF_ID
HTTP client confg id for use in m2mb_http_set_cfg and m2mb_httpc_get_cfg APIs.
Definition: m2mb_httpc.h:127
signed int INT32
Definition: m2mb_types.h:82
M2MB_STATUS_T m2mb_httpc_send(VOID *handle, UINT8 isFirstPacket, UINT8 *body, UINT32 body_length, UINT32 total_length)
Send HTTP information from the http client session.
void * HANDLE
Definition: m2mb_types.h:98
enum M2MB_HTTPC_STATES M2MB_HTTPC_STATES_E
HTTP client callback state.
M2MB_IP46_ADDR_T IP46_addr
Definition: m2mb_httpc.h:231
M2MB_HTTPC_CB_T cb
Definition: m2mb_httpc.h:253
HTTP client response for use in user callback.
Definition: m2mb_httpc.h:151