Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
iotivity-test-client.c File Reference
#include <stdio.h>
#include <arpa/inet.h>
#include "sol-log.h"
#include "sol-buffer.h"
#include "sol-coap.h"
#include "sol-mainloop.h"
#include "sol-oic-client.h"

Data Structures

struct  Context
 

Macros

#define DEVICE_ID_LEN   (16)
 
#define POST_REQUEST_POWER   (13)
 
#define PUT_REQUEST_POWER   (7)
 
#define streq(a, b)   (strcmp((a), (b)) == 0)
 

Enumerations

enum  test_number_codes {
  TEST_DISCOVERY = 1, TEST_NON_CONFIRMABLE_GET = 2, TEST_NON_CONFIRMABLE_PUT = 4, TEST_NON_CONFIRMABLE_POST = 5,
  TEST_NON_CONFIRMABLE_DELETE = 6, TEST_NON_CONFIRMABLE_OBSERVE = 7, TEST_NON_CONFIRMABLE_INVALID_GET = 8, TEST_CONFIRMABLE_GET = 9,
  TEST_CONFIRMABLE_POST = 10, TEST_CONFIRMABLE_DELETE = 11, TEST_CONFIRMABLE_OBSERVE = 12, TEST_DISCOVER_PLATFORM = 19,
  TEST_DISCOVER_DEVICES = 20
}
 

Functions

static void check_delete_request (void *data, enum sol_coap_response_code response_code, struct sol_oic_client *cli, const struct sol_network_link_addr *cliaddr, const struct sol_oic_map_reader *map_reader)
 
static void check_post_request (void *data, enum sol_coap_response_code response_code, struct sol_oic_client *cli, const struct sol_network_link_addr *cliaddr, const struct sol_oic_map_reader *map_reader)
 
static void check_put_request (void *data, enum sol_coap_response_code response_code, struct sol_oic_client *cli, const struct sol_network_link_addr *cliaddr, const struct sol_oic_map_reader *map_reader)
 
static bool check_response_code (enum sol_coap_response_code response_code, int test_number)
 
static void device_id_decode (const char *device_id_encoded, char *device_id)
 
static void dump_byte_string (struct sol_buffer *buf, const struct sol_str_slice bytes)
 
static void fill_info (const struct sol_oic_map_reader *map_reader, bool *state, int32_t *power)
 
static bool found_resource (void *data, struct sol_oic_client *cli, struct sol_oic_resource *res)
 
static bool found_resource_print (void *data, struct sol_oic_client *cli, struct sol_oic_resource *res)
 
int main (int argc, char *argv[])
 
static void platform_info_cb (void *data, struct sol_oic_client *cli, const struct sol_oic_platform_info *info)
 
static int post_fill_repr_map (struct sol_oic_map_writer *repr_map)
 
static void print_response (void *data, enum sol_coap_response_code response_code, struct sol_oic_client *cli, const struct sol_network_link_addr *cliaddr, const struct sol_oic_map_reader *map_reader)
 
static int put_fill_repr_map (struct sol_oic_map_writer *repr_map)
 
static void resource_notify (void *data, enum sol_coap_response_code response_code, struct sol_oic_client *cli, const struct sol_network_link_addr *cliaddr, const struct sol_oic_map_reader *map_reader)
 
static void server_info_cb (void *data, struct sol_oic_client *cli, const struct sol_oic_device_info *info)
 
static void usage (void)
 

Macro Definition Documentation

#define DEVICE_ID_LEN   (16)
#define POST_REQUEST_POWER   (13)
#define PUT_REQUEST_POWER   (7)
#define streq (   a,
 
)    (strcmp((a), (b)) == 0)

Enumeration Type Documentation

Enumerator
TEST_DISCOVERY 
TEST_NON_CONFIRMABLE_GET 
TEST_NON_CONFIRMABLE_PUT 
TEST_NON_CONFIRMABLE_POST 
TEST_NON_CONFIRMABLE_DELETE 
TEST_NON_CONFIRMABLE_OBSERVE 
TEST_NON_CONFIRMABLE_INVALID_GET 
TEST_CONFIRMABLE_GET 
TEST_CONFIRMABLE_POST 
TEST_CONFIRMABLE_DELETE 
TEST_CONFIRMABLE_OBSERVE 
TEST_DISCOVER_PLATFORM 
TEST_DISCOVER_DEVICES 

Function Documentation

static void check_delete_request ( void *  data,
enum sol_coap_response_code  response_code,
struct sol_oic_client cli,
const struct sol_network_link_addr cliaddr,
const struct sol_oic_map_reader map_reader 
)
static
static void check_post_request ( void *  data,
enum sol_coap_response_code  response_code,
struct sol_oic_client cli,
const struct sol_network_link_addr cliaddr,
const struct sol_oic_map_reader map_reader 
)
static
static void check_put_request ( void *  data,
enum sol_coap_response_code  response_code,
struct sol_oic_client cli,
const struct sol_network_link_addr cliaddr,
const struct sol_oic_map_reader map_reader 
)
static
static bool check_response_code ( enum sol_coap_response_code  response_code,
int  test_number 
)
static
static void device_id_decode ( const char *  device_id_encoded,
char *  device_id 
)
static
static void dump_byte_string ( struct sol_buffer buf,
const struct sol_str_slice  bytes 
)
static
static void fill_info ( const struct sol_oic_map_reader map_reader,
bool *  state,
int32_t *  power 
)
static
static bool found_resource ( void *  data,
struct sol_oic_client cli,
struct sol_oic_resource res 
)
static
static bool found_resource_print ( void *  data,
struct sol_oic_client cli,
struct sol_oic_resource res 
)
static
int main ( int  argc,
char *  argv[] 
)
static void platform_info_cb ( void *  data,
struct sol_oic_client cli,
const struct sol_oic_platform_info info 
)
static
static int post_fill_repr_map ( struct sol_oic_map_writer repr_map)
static
static void print_response ( void *  data,
enum sol_coap_response_code  response_code,
struct sol_oic_client cli,
const struct sol_network_link_addr cliaddr,
const struct sol_oic_map_reader map_reader 
)
static
static int put_fill_repr_map ( struct sol_oic_map_writer repr_map)
static
static void resource_notify ( void *  data,
enum sol_coap_response_code  response_code,
struct sol_oic_client cli,
const struct sol_network_link_addr cliaddr,
const struct sol_oic_map_reader map_reader 
)
static
static void server_info_cb ( void *  data,
struct sol_oic_client cli,
const struct sol_oic_device_info info 
)
static
static void usage ( void  )
static