Soletta™ Framework
|
#include "sol-lwm2m-server.h"
#include "sol-mainloop.h"
#include "sol-vector.h"
#include "sol-util.h"
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
Macros | |
#define | CLIENT_PUBLIC_KEY |
#define | CLIENT_SERVER_PSK_ID ("cli1") |
#define | CLIENT_SERVER_PSK_KEY ("0123456789ABCDEF") |
#define | LATITUDE_ID (0) |
#define | LOCATION_OBJ_ID (6) |
#define | LONGITUDE_ID (1) |
#define | PSK_KEY_LEN 16 |
#define | RPK_PRIVATE_KEY_LEN 32 |
#define | RPK_PUBLIC_KEY_LEN (2 * RPK_PRIVATE_KEY_LEN) |
#define | SERVER_PRIVATE_KEY ("65c5e815d0c40e8f99143e5c905cbd9026444395af207a914063d8f0a7e63f22") |
#define | SERVER_PUBLIC_KEY |
#define | TIMESTAMP_ID (5) |
Enumerations | |
enum | location_object_status { LOCATION_OBJECT_NOT_FOUND, LOCATION_OBJECT_WITH_NO_INSTANCES, LOCATION_OBJECT_WITH_INSTANCES } |
Functions | |
static void | create_cb (void *data, struct sol_lwm2m_server *server, struct sol_lwm2m_client_info *cinfo, const char *path, enum sol_coap_response_code response_code) |
static void | create_location_obj (struct sol_lwm2m_server *server, struct sol_lwm2m_client_info *cinfo) |
static enum location_object_status | get_location_object_status (const struct sol_lwm2m_client_info *cinfo) |
static void | location_changed_cb (void *data, struct sol_lwm2m_server *server, struct sol_lwm2m_client_info *cinfo, const char *path, enum sol_coap_response_code response_code, enum sol_lwm2m_content_type content_type, struct sol_str_slice content) |
int | main (int argc, char *argv[]) |
static void | observe_location (struct sol_lwm2m_server *server, struct sol_lwm2m_client_info *cinfo) |
static void | registration_cb (void *data, struct sol_lwm2m_server *server, struct sol_lwm2m_client_info *cinfo, enum sol_lwm2m_registration_event event) |
Variables | |
static struct sol_blob | lat |
static struct sol_blob | longi |
#define CLIENT_PUBLIC_KEY |
Referenced by main().
#define CLIENT_SERVER_PSK_ID ("cli1") |
Referenced by main().
#define CLIENT_SERVER_PSK_KEY ("0123456789ABCDEF") |
Referenced by main().
#define LATITUDE_ID (0) |
Referenced by create_location_obj(), and location_changed_cb().
#define LOCATION_OBJ_ID (6) |
Referenced by get_location_object_status().
#define LONGITUDE_ID (1) |
Referenced by create_location_obj(), and location_changed_cb().
#define PSK_KEY_LEN 16 |
Referenced by main().
#define RPK_PRIVATE_KEY_LEN 32 |
Referenced by main().
#define RPK_PUBLIC_KEY_LEN (2 * RPK_PRIVATE_KEY_LEN) |
Referenced by main().
#define SERVER_PRIVATE_KEY ("65c5e815d0c40e8f99143e5c905cbd9026444395af207a914063d8f0a7e63f22") |
Referenced by main().
#define SERVER_PUBLIC_KEY |
Referenced by main().
#define TIMESTAMP_ID (5) |
Referenced by create_location_obj().
|
static |
References observe_location(), SOL_COAP_RESPONSE_CODE_CREATED, and sol_lwm2m_client_info_get_name().
Referenced by create_location_obj().
|
static |
|
static |
References LOCATION_OBJ_ID, LOCATION_OBJECT_NOT_FOUND, LOCATION_OBJECT_WITH_INSTANCES, LOCATION_OBJECT_WITH_NO_INSTANCES, sol_lwm2m_client_info_get_objects(), sol_lwm2m_client_object_get_id(), sol_lwm2m_client_object_get_instances(), SOL_PTR_VECTOR_FOREACH_IDX, and sol_ptr_vector_get_len().
Referenced by registration_cb().
|
static |
References sol_lwm2m_tlv::id, LATITUDE_ID, LONGITUDE_ID, SOL_BUFFER_DECLARE_STATIC, sol_buffer_fini(), SOL_COAP_RESPONSE_CODE_CHANGED, SOL_COAP_RESPONSE_CODE_CONTENT, sol_lwm2m_client_info_get_name(), SOL_LWM2M_CONTENT_TYPE_TLV, sol_lwm2m_parse_tlv(), sol_lwm2m_tlv_get_bytes(), sol_lwm2m_tlv_list_clear(), and SOL_VECTOR_FOREACH_IDX.
Referenced by observe_location().
int main | ( | int | argc, |
char * | argv[] | ||
) |
References CLIENT_PUBLIC_KEY, CLIENT_SERVER_PSK_ID, CLIENT_SERVER_PSK_KEY, sol_lwm2m_security_psk::id, key, sol_lwm2m_security_psk::key, sol_lwm2m_security_rpk::private_key, PSK_KEY_LEN, sol_lwm2m_security_rpk::public_key, registration_cb(), RPK_PRIVATE_KEY_LEN, RPK_PUBLIC_KEY_LEN, server, SERVER_PRIVATE_KEY, SERVER_PUBLIC_KEY, sol_blob_new_dup(), sol_blob_unref(), SOL_DECODE_BOTH, sol_init(), SOL_LWM2M_DEFAULT_SERVER_PORT_COAP, SOL_LWM2M_DEFAULT_SERVER_PORT_DTLS, SOL_LWM2M_SECURITY_MODE_CERTIFICATE, SOL_LWM2M_SECURITY_MODE_NO_SEC, SOL_LWM2M_SECURITY_MODE_PRE_SHARED_KEY, SOL_LWM2M_SECURITY_MODE_RAW_PUBLIC_KEY, sol_lwm2m_server_add_registration_monitor(), sol_lwm2m_server_del(), sol_lwm2m_server_new(), sol_run(), sol_shutdown(), sol_str_slice_from_str(), sol_util_base16_decode(), and usage().
|
static |
References location_changed_cb(), and sol_lwm2m_server_add_observer().
Referenced by create_cb(), and registration_cb().
|
static |
References create_location_obj(), get_location_object_status(), LOCATION_OBJECT_NOT_FOUND, LOCATION_OBJECT_WITH_NO_INSTANCES, observe_location(), sol_lwm2m_client_info_get_name(), SOL_LWM2M_REGISTRATION_EVENT_TIMEOUT, SOL_LWM2M_REGISTRATION_EVENT_UNREGISTER, and SOL_LWM2M_REGISTRATION_EVENT_UPDATE.
Referenced by main().
|
static |
|
static |