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
Macros | Enumerations | Functions | Variables
lwm2m-server.c File Reference
#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
 

Macro Definition Documentation

#define CLIENT_PUBLIC_KEY
Value:
("D055EE14084D6E0615599DB583913E4A3E4526A2704D61F27A4CCFBA9758EF9A" \
"B418B64AFE8030DA1DDCF4F42E2F2631D043B1FB03E22F4D17DE43F9F9ADEE70")

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)
#define LOCATION_OBJ_ID   (6)
#define LONGITUDE_ID   (1)
#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")
Examples:
/src/samples/coap/lwm2m-server.c.

Referenced by main().

#define SERVER_PUBLIC_KEY
Value:
("3b88c213ca5ccfd9c5a7f73715760d7d9a5220768f2992d2628ae1389cbca4c6" \
"d1b73cc6d61ae58783135749fb03eaaa64a7a1adab8062ed5fc0d7b86ba2d5ca")

Referenced by main().

#define TIMESTAMP_ID   (5)

Enumeration Type Documentation

Enumerator
LOCATION_OBJECT_NOT_FOUND 
LOCATION_OBJECT_WITH_NO_INSTANCES 
LOCATION_OBJECT_WITH_INSTANCES 

Function Documentation

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
static void create_location_obj ( struct sol_lwm2m_server server,
struct sol_lwm2m_client_info cinfo 
)
static
static enum location_object_status get_location_object_status ( const struct sol_lwm2m_client_info cinfo)
static
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 
)
static
int main ( int  argc,
char *  argv[] 
)
static void observe_location ( struct sol_lwm2m_server server,
struct sol_lwm2m_client_info cinfo 
)
static
static void registration_cb ( void *  data,
struct sol_lwm2m_server server,
struct sol_lwm2m_client_info cinfo,
enum sol_lwm2m_registration_event  event 
)
static

Variable Documentation

struct sol_blob lat
static
Initial value:
= {
.parent = NULL,
.mem = (void *)"48.858093",
.size = sizeof("48.858093") - 1,
.refcnt = 1
}
const struct sol_blob_type SOL_BLOB_TYPE_NO_FREE
Blob type object for the nofree implementation.
Examples:
/src/samples/coap/lwm2m-server.c.
struct sol_blob longi
static
Initial value:
= {
.parent = NULL,
.mem = (void *)"2.294694",
.size = sizeof("2.294694") - 1,
.refcnt = 1
}
const struct sol_blob_type SOL_BLOB_TYPE_NO_FREE
Blob type object for the nofree implementation.
Examples:
/src/samples/coap/lwm2m-server.c.