#include "debug_conf.h"
#include "exosite_example.h"
#include "io1_board.h"
#include "tick_counter.h"
Macros | |
#define | EXOSITE_EXAMPLE_HTTP_ACTIVATE_URL "http://atmel.m2.exosite.com/provision/activate" |
#define | EXOSITE_EXAMPLE_HTTP_CIK_EXT_HEADER "X-Exosite-CIK:%s\r\n" |
#define | EXOSITE_EXAMPLE_HTTP_CONTENT_TYPE "application/x-www-form-urlencoded; charset=utf-8" |
#define | EXOSITE_EXAMPLE_HTTP_READ_AND_WRITE_URL "http://atmel.m2.exosite.com/onep:v1/stack/alias?led" |
Functions | |
static bool | _exosite_example_configure_http_client (exosite_http_cb cb) |
Configure HTTP client module. More... | |
static void | _exosite_example_configure_timer (void) |
Configure Timer module. More... | |
void | _exosite_example_http_close (void *priv_data) |
int | _exosite_example_http_get_contents_length (void *priv_data) |
const char * | _exosite_example_http_get_contents_type (void *priv_data) |
int | _exosite_example_http_read (void *priv_data, char *buffer, uint32_t size, uint32_t written) |
struct http_entity * | _exosite_example_http_set_default_entity (void) |
bool | exosite_example_activiate (char *activate_data) |
bool | exosite_example_init (exosite_http_cb cb) |
bool | exosite_example_read_and_write (char *write_data, char *cik) |
Variables | |
struct http_entity | g_http_entity = {0,} |
struct http_client_module | http_client_module_inst |
Instance of HTTP client module. More... | |
struct sw_timer_module | swt_module_inst |
Instance of Timer module. More... | |
#define EXOSITE_EXAMPLE_HTTP_ACTIVATE_URL "http://atmel.m2.exosite.com/provision/activate" |
Referenced by exosite_example_activiate().
#define EXOSITE_EXAMPLE_HTTP_CIK_EXT_HEADER "X-Exosite-CIK:%s\r\n" |
Referenced by exosite_example_read_and_write().
#define EXOSITE_EXAMPLE_HTTP_CONTENT_TYPE "application/x-www-form-urlencoded; charset=utf-8" |
Referenced by _exosite_example_http_get_contents_type().
#define EXOSITE_EXAMPLE_HTTP_READ_AND_WRITE_URL "http://atmel.m2.exosite.com/onep:v1/stack/alias?led" |
Referenced by exosite_example_read_and_write().
|
static |
Configure HTTP client module.
References DEBUG, DEBUG_CONF_EXOSITE, DEBUG_EOL, http_client_get_config_defaults(), http_client_init(), http_client_module_inst, http_client_register_callback(), http_client_config::recv_buffer_size, ret, http_client_config::send_buffer_size, swt_module_inst, http_client_config::timer_inst, and http_client_config::user_agent.
Referenced by exosite_example_init().
|
static |
Configure Timer module.
References sw_timer_enable(), sw_timer_get_config_defaults(), sw_timer_init(), and swt_module_inst.
Referenced by exosite_example_init().
void _exosite_example_http_close | ( | void * | priv_data | ) |
Referenced by _exosite_example_http_set_default_entity().
int _exosite_example_http_get_contents_length | ( | void * | priv_data | ) |
Referenced by _exosite_example_http_set_default_entity().
const char * _exosite_example_http_get_contents_type | ( | void * | priv_data | ) |
References EXOSITE_EXAMPLE_HTTP_CONTENT_TYPE.
Referenced by _exosite_example_http_set_default_entity().
int _exosite_example_http_read | ( | void * | priv_data, |
char * | buffer, | ||
uint32_t | size, | ||
uint32_t | written | ||
) |
References length.
Referenced by _exosite_example_http_set_default_entity().
struct http_entity * _exosite_example_http_set_default_entity | ( | void | ) |
References _exosite_example_http_close(), _exosite_example_http_get_contents_length(), _exosite_example_http_get_contents_type(), _exosite_example_http_read(), http_entity::close, g_http_entity, http_entity::get_contents_length, http_entity::get_contents_type, http_entity::is_chunked, NULL, http_entity::priv_data, and http_entity::read.
Referenced by exosite_example_activiate(), and exosite_example_read_and_write().
bool exosite_example_activiate | ( | char * | activate_data | ) |
bool exosite_example_init | ( | exosite_http_cb | cb | ) |
References _exosite_example_configure_http_client(), _exosite_example_configure_timer(), DEBUG, DEBUG_CONF_EXOSITE, and DEBUG_EOL.
Referenced by main().
bool exosite_example_read_and_write | ( | char * | write_data, |
char * | cik | ||
) |
References _exosite_example_http_set_default_entity(), DEBUG, DEBUG_CONF_EXOSITE, DEBUG_EOL, EXOSITE_EXAMPLE_HTTP_CIK_EXT_HEADER, EXOSITE_EXAMPLE_HTTP_READ_AND_WRITE_URL, http_client_module_inst, http_client_send_request(), HTTP_METHOD_POST, http_entity::priv_data, ret, and tick_counter_pending_timer().
Referenced by main().
struct http_entity g_http_entity = {0,} |
Referenced by _exosite_example_http_set_default_entity().
struct http_client_module http_client_module_inst |
Instance of HTTP client module.
struct sw_timer_module swt_module_inst |
Instance of Timer module.