Microchip® Advanced Software Framework

http_client_config Struct Reference

HTTP client configuration structure.

Configuration struct for a HTTP client instance. This structure should be initialized by the http_client_get_config_defaults function before being modified by the user application.

#include <http_client.h>

Data Fields

uint16_t port
 TCP port number of HTTP. More...
 
char * recv_buffer
 Rx buffer. More...
 
uint32_t recv_buffer_size
 Maximum size of the receive buffer. More...
 
uint32_t send_buffer_size
 Send buffer size in the HTTP client service. More...
 
uint16_t timeout
 Time value for the request time out. More...
 
struct sw_timer_moduletimer_inst
 Timer module for the request timeout Default value is NULL. More...
 
uint8_t tls
 A flag for the whether using the TLS socket or not. More...
 
const char * user_agent
 User agent of this client. More...
 

uint16_t http_client_config::port

TCP port number of HTTP.

Default value is 80.

Referenced by http_client_get_config_defaults(), http_client_send_request(), and http_client_socket_resolve_handler().

uint32_t http_client_config::recv_buffer_size
uint32_t http_client_config::send_buffer_size

Send buffer size in the HTTP client service.

This buffer is located in the stack. Therefore, The size of the buffer increases the speed will increase, but it may cause a stack overflow. Apache server is not supported that packet header is divided in the multiple packets. So, it MUST bigger than 192. Default value is 192.

Referenced by _http_client_request(), http_client_get_config_defaults(), and http_client_init().

uint16_t http_client_config::timeout

Time value for the request time out.

Unit is milliseconds. Default value is 20000. (20 seconds)

Referenced by _http_client_recved_packet(), http_client_get_config_defaults(), http_client_init(), and http_client_socket_event_handler().

struct sw_timer_module* http_client_config::timer_inst
uint8_t http_client_config::tls

A flag for the whether using the TLS socket or not.

Default value is 0.

Referenced by http_client_get_config_defaults(), and http_client_send_request().

const char* http_client_config::user_agent

User agent of this client.

This value is must located in the Heap or code region. Default value is Atmel/{version}

Referenced by _http_client_request(), and http_client_get_config_defaults().