Embedded Wireless Framework
Data Structures | Typedefs | Functions
Modem adapter http API

HTTP functions. More...

Data Structures

struct  _ewf_adapter_api_http
 

Typedefs

typedef struct _ewf_adapter_api_http ewf_adapter_api_http
 
typedef int ewf_http_socket
 

Functions

ewf_result ewf_adapter_http_open (ewf_adapter *adapter_ptr, ewf_http_socket *http_socket_ptr)
 Open an HTTP socket. More...
 
ewf_result ewf_adapter_http_close (ewf_adapter *adapter_ptr, ewf_http_socket http_socket)
 Close an HTTP socket. More...
 
ewf_result ewf_adapter_http_context_configure (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, uint8_t context_id, uint8_t sprofile_id, const char *server_addr, uint16_t server_port, bool auth_type, const char *username_str, const char *password_str, bool ssl_enabled, uint32_t timeout)
 HTTP client configuration. More...
 
ewf_result ewf_adapter_http_get (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, const char *uri, char **response_ptr_ptr, uint32 *response_length_ptr)
 HTTP GET request. More...
 
ewf_result ewf_adapter_http_head (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, const char *uri_str, char **response_ptr_ptr, uint32 *response_length_ptr)
 HTTP HEAD request. More...
 
ewf_result ewf_adapter_http_delete (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, const char *uri_str, char **response_ptr_ptr, uint32 *response_length_ptr)
 HTTP DELETE request. More...
 
ewf_result ewf_adapter_http_post (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, const char *uri_str, const char *data, uint8_t content_type, char **response_ptr_ptr, uint32 *response_length_ptr)
 HTTP POST request. More...
 
ewf_result ewf_adapter_http_put (ewf_adapter *adapter_ptr, ewf_http_socket http_socket, const char *uri_str const char *data_str, uint8_t content_type, char **response_ptr_ptr, uint32 *response_length_ptr)
 HTTP PUT request. More...
 

Detailed Description

HTTP functions.

Function Documentation

◆ ewf_adapter_http_close()

ewf_result ewf_adapter_http_close ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket 
)

Close an HTTP socket.

Parameters
[in]http_socketSocket number used as HTTP Profile ID
Returns
ewf_result status code

◆ ewf_adapter_http_context_configure()

ewf_result ewf_adapter_http_context_configure ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
uint8_t  context_id,
uint8_t  sprofile_id,
const char *  server_addr,
uint16_t  server_port,
bool  auth_type,
const char *  username_str,
const char *  password_str,
bool  ssl_enabled,
uint32_t  timeout 
)

HTTP client configuration.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]context_idPDP context ID
[in]sprofile_idSecure profile ID
[in]server_addrString containing server IP address or server name
[in]server_portHTTP server port
[in]auth_typeAuthentication method/type (No Authentication/ Basic Authentication)
[in]username_strString indicating username for HTTP login
[in]password_strString indicating passowrd for HTTP login
[in]ssl_enabledHTTP secure option enable/disable
[in]timeoutTimeout in seconds
Returns
ewf_result status code

◆ ewf_adapter_http_delete()

ewf_result ewf_adapter_http_delete ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
const char *  uri_str,
char **  response_ptr_ptr,
uint32 *  response_length_ptr 
)

HTTP DELETE request.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]uri_strHTTP resource (uri)
[out]response_ptr_ptrResponse for the HTTP request, if available
[out]response_length_ptrPointer to lenght of response
Returns
ewf_result status code

◆ ewf_adapter_http_get()

ewf_result ewf_adapter_http_get ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
const char *  uri,
char **  response_ptr_ptr,
uint32 *  response_length_ptr 
)

HTTP GET request.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]uriHTTP resource (uri)
[out]response_ptrResponse for the HTTP request, if available
[out]response_length_ptrPointer to lenght of response
Returns
ewf_result status code

◆ ewf_adapter_http_head()

ewf_result ewf_adapter_http_head ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
const char *  uri_str,
char **  response_ptr_ptr,
uint32 *  response_length_ptr 
)

HTTP HEAD request.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]uri_strHTTP resource (uri)
[out]response_ptr_ptrResponse for the HTTP request, if available
[out]response_length_ptrPointer to lenght of response
Returns
ewf_result status code

◆ ewf_adapter_http_open()

ewf_result ewf_adapter_http_open ( ewf_adapter adapter_ptr,
ewf_http_socket *  http_socket_ptr 
)

Open an HTTP socket.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in,out]http_socket_ptrA pointer to an HTTP socket that will receive will initialized on open
Returns
ewf_result status code

◆ ewf_adapter_http_post()

ewf_result ewf_adapter_http_post ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
const char *  uri_str,
const char *  data,
uint8_t  content_type,
char **  response_ptr_ptr,
uint32 *  response_length_ptr 
)

HTTP POST request.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]uri_strHTTP resource (uri)
[in]dataData to be sent
[in]content_typeHTTP Content-Type identifier. Refer the modem user manual for supported types
[out]response_ptr_ptrResponse for the HTTP request, if available
[out]response_length_ptrPointer to lenght of response
Returns
ewf_result status code

◆ ewf_adapter_http_put()

ewf_result ewf_adapter_http_put ( ewf_adapter adapter_ptr,
ewf_http_socket  http_socket,
const char *uri_str const char *  data_str,
uint8_t  content_type,
char **  response_ptr_ptr,
uint32 *  response_length_ptr 
)

HTTP PUT request.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]http_socketThe HTTP socket
[in]uri_strHTTP resource (uri)
[in]data_strData to be sent
[in]content_typeHTTP Content-Type identifier. Refer the modem user manual for supported types
[out]response_ptr_ptrResponse for the HTTP request, if available
[out]response_length_ptrPointer to lenght of response
Returns
ewf_result status code