Embedded Wireless Framework
ewf_adapter_api_http.h
Go to the documentation of this file.
1 /************************************************************************/
11 #ifndef __ewf_adapter_http__h__included__
12 #define __ewf_adapter_http__h__included__
13 
14 #include "ewf_adapter.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /************************************************************************/
28 typedef struct _ewf_adapter_api_http
29 {
30  ewf_result(*open)(ewf_adapter* adapter_ptr, ewf_http_socket * http_socket_ptr);
31  ewf_result(*close)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket);
32  ewf_result(*context_configure)(ewf_adapter* adapter_ptr,ewf_http_socket http_socket,
33  uint8_t context_id, uint8_t sprofile_id, const char * server_addr,
34  uint16_t server_port, bool auth_type, const char * username_str,
35  const char * password_str, bool ssl_enabled, uint32_t timeout);
36  ewf_result(*get)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
37  const char * uri,
38  char ** response_ptr_ptr, uint32 * response_length_ptr);
39  ewf_result(*head)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
40  const char * uri_str,
41  char ** response_ptr_ptr, uint32 * response_length_ptr);
42  ewf_result(*delete)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
43  const char * uri_str,
44  char ** response_ptr_ptr, uint32 * response_length_ptr);
45  ewf_result(*post)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
46  const char * uri_str,
47  const char * data, uint8_t content_type,
48  char ** response_ptr_ptr, uint32 * response_length_ptr);
49  ewf_result(*put)(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
50  const char * uri_str
51  const char * data_str, uint8_t content_type,
52  char ** response_ptr_ptr, uint32 * response_length_ptr);
53 
55 typedef int ewf_http_socket;
56 
63 ewf_result ewf_adapter_http_open(ewf_adapter* adapter_ptr, ewf_http_socket * http_socket_ptr);
64 
70 ewf_result ewf_adapter_http_close(ewf_adapter* adapter_ptr, ewf_http_socket http_socket);
71 
87 ewf_result ewf_adapter_http_context_configure(ewf_adapter* adapter_ptr,ewf_http_socket http_socket,
88  uint8_t context_id, uint8_t sprofile_id, const char * server_addr,
89  uint16_t server_port, bool auth_type, const char * username_str,
90  const char * password_str, bool ssl_enabled, uint32_t timeout);
91 
101 ewf_result ewf_adapter_http_get(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
102  const char * uri,
103  char ** response_ptr_ptr, uint32 * response_length_ptr);
104 
114 ewf_result ewf_adapter_http_head(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
115  const char * uri_str,
116  char ** response_ptr_ptr, uint32 * response_length_ptr);
117 
127 ewf_result ewf_adapter_http_delete(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
128  const char * uri_str,
129  char ** response_ptr_ptr, uint32 * response_length_ptr);
130 
142 ewf_result ewf_adapter_http_post(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
143  const char * uri_str,
144  const char * data, uint8_t content_type,
145  char ** response_ptr_ptr, uint32 * response_length_ptr);
146 
158 ewf_result ewf_adapter_http_put(ewf_adapter* adapter_ptr, ewf_http_socket http_socket,
159  const char * uri_str
160  const char * data_str, uint8_t content_type,
161  char ** response_ptr_ptr, uint32 * response_length_ptr);
162 
163 /************************************************************************/
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* __ewf_adapter_http__h__included__ */
The Embedded Wireless Framework adapter API implementation.
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.
ewf_result ewf_adapter_http_close(ewf_adapter *adapter_ptr, ewf_http_socket http_socket)
Close an HTTP socket.
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.
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.
ewf_result ewf_adapter_http_open(ewf_adapter *adapter_ptr, ewf_http_socket *http_socket_ptr)
Open an HTTP socket.
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.
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.
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.
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
Definition: ewf_adapter_api_http.h:29
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50