Soletta™ Framework
|
Routines to create Bootstrap Servers talking the LWM2M protocol. More...
Typedefs | |
typedef struct sol_lwm2m_bootstrap_client_info | sol_lwm2m_bootstrap_client_info |
A handle that contains information about a bootstrapping LWM2M client. More... | |
typedef struct sol_lwm2m_bootstrap_server | sol_lwm2m_bootstrap_server |
A handle to a LWM2M bootstrap server. More... | |
Functions | |
const struct sol_network_link_addr * | sol_lwm2m_bootstrap_client_info_get_address (const struct sol_lwm2m_bootstrap_client_info *client) |
Gets the bootstrap client address. More... | |
const char * | sol_lwm2m_bootstrap_client_info_get_name (const struct sol_lwm2m_bootstrap_client_info *client) |
Gets the name of bootstrap client. More... | |
int | sol_lwm2m_bootstrap_server_add_request_monitor (struct sol_lwm2m_bootstrap_server *server, void(*sol_lwm2m_bootstrap_server_request_cb)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *bs_cinfo), const void *data) |
Adds a bootstrap request monitor to the server. More... | |
void | sol_lwm2m_bootstrap_server_del (struct sol_lwm2m_bootstrap_server *server) |
Deletes a bootstrap server instance. More... | |
int | sol_lwm2m_bootstrap_server_del_request_monitor (struct sol_lwm2m_bootstrap_server *server, void(*sol_lwm2m_bootstrap_server_request_cb)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *bs_cinfo), const void *data) |
Removes a bootstrap request monitor from the server. More... | |
int | sol_lwm2m_bootstrap_server_delete_object_instance (struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, void(*sol_lwm2m_bootstrap_server_status_response_cb)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code), const void *data) |
Deletes an object instance on a client through the Bootstrap Interface. More... | |
struct sol_lwm2m_bootstrap_server * | sol_lwm2m_bootstrap_server_new (uint16_t port, const char **known_clients, uint16_t num_sec_modes,...) |
Creates a new LWM2M bootstrap server. More... | |
int | sol_lwm2m_bootstrap_server_send_finish (struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client) |
Signals the end of the Bootstrap Process. More... | |
int | sol_lwm2m_bootstrap_server_write (struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, struct sol_lwm2m_resource *resources, size_t len, void(*sol_lwm2m_bootstrap_server_status_response_cb)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code), const void *data) |
Writes an object instance or resource through the Bootstrap Interface. More... | |
int | sol_lwm2m_bootstrap_server_write_object (struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, struct sol_lwm2m_resource **instances, size_t *instances_len, uint16_t *instances_ids, size_t len, void(*sol_lwm2m_bootstrap_server_status_response_cb)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code), const void *data) |
Writes a full object through the Bootstrap Interface. More... | |
Routines to create Bootstrap Servers talking the LWM2M protocol.
A handle that contains information about a bootstrapping LWM2M client.
A handle to a LWM2M bootstrap server.
const struct sol_network_link_addr* sol_lwm2m_bootstrap_client_info_get_address | ( | const struct sol_lwm2m_bootstrap_client_info * | client | ) |
Gets the bootstrap client address.
client | The LWM2M bootstrap client info. |
client
address or NULL
on error. const char* sol_lwm2m_bootstrap_client_info_get_name | ( | const struct sol_lwm2m_bootstrap_client_info * | client | ) |
Gets the name of bootstrap client.
client | The LWM2M bootstrap client info. |
client
name or NULL
on error. Referenced by bootstrap_cb(), delete_all_cb(), write_resource_cb(), write_sec_one_cb(), write_server_one_cb(), and write_servers_cb().
int sol_lwm2m_bootstrap_server_add_request_monitor | ( | struct sol_lwm2m_bootstrap_server * | server, |
void(*)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *bs_cinfo) | sol_lwm2m_bootstrap_server_request_cb, | ||
const void * | data | ||
) |
Adds a bootstrap request monitor to the server.
This function register a bootstrap request monitor. This means that every time a LWM2M client performs a Bootstrap Request sol_lwm2m_bootstrap_server_request_cb
will be called.
server | The LWM2M bootstrap server. |
sol_lwm2m_bootstrap_server_request_cb | A callback that is used to inform a LWM2M client bootstrap request - data User data; server The LWM2M bootstrap server; bs_cinfo The client that initiated the bootstrap request. |
data | The user data to sol_lwm2m_bootstrap_server_request_cb . |
Referenced by main().
void sol_lwm2m_bootstrap_server_del | ( | struct sol_lwm2m_bootstrap_server * | server | ) |
Deletes a bootstrap server instance.
Use this function to stop the LWM2M bootstrap server and release its resources.
server | The LWM2M bootstrap server to be deleted. |
Referenced by main().
int sol_lwm2m_bootstrap_server_del_request_monitor | ( | struct sol_lwm2m_bootstrap_server * | server, |
void(*)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *bs_cinfo) | sol_lwm2m_bootstrap_server_request_cb, | ||
const void * | data | ||
) |
Removes a bootstrap request monitor from the server.
server | The LWM2M bootstrap server. |
sol_lwm2m_bootstrap_server_request_cb | The previous registered callback. - data User data; server The LWM2M bootstrap server; bs_cinfo The client that initiated the bootstrap request. |
data | The user data to sol_lwm2m_bootstrap_server_request_cb . |
int sol_lwm2m_bootstrap_server_delete_object_instance | ( | struct sol_lwm2m_bootstrap_server * | server, |
struct sol_lwm2m_bootstrap_client_info * | client, | ||
const char * | path, | ||
void(*)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code) | sol_lwm2m_bootstrap_server_status_response_cb, | ||
const void * | data | ||
) |
Deletes an object instance on a client through the Bootstrap Interface.
server | The LWM2M bootstrap server. |
client | The LWM2M bootstrap client info to delete an object |
path | The object path to be deleted (Example /1/1). |
sol_lwm2m_bootstrap_server_status_response_cb | A callback to be called when the delete operation is completed. - server The LW2M bootstrap server; client The LWM2M client; path The client's path; response_code The operation's response_code ; data User data. |
data | User data to sol_lwm2m_bootstrap_server_status_response_cb |
Referenced by bootstrap_cb().
struct sol_lwm2m_bootstrap_server* sol_lwm2m_bootstrap_server_new | ( | uint16_t | port, |
const char ** | known_clients, | ||
uint16_t | num_sec_modes, | ||
... | |||
) |
Creates a new LWM2M bootstrap server.
The server will be immediately operational and waiting for connections.
port | The UDP port to be used. |
known_clients | A NULL-terminated array with the name of all clients this server has Bootstrap Information for. |
num_sec_modes | The number of DTLS Security Modes this Bootstrap Server will support. |
... | At least one sol_lwm2m_security_mode followed by its relevant parameters, as per the table below: |
Security Mode | Follow-up arguments | Description |
---|---|---|
SOL_LWM2M_SECURITY_MODE_PRE_SHARED_KEY | struct sol_lwm2m_security_psk **known_psks | known_psks The Clients' Pre-Shared Keys this Bootstrap Server has previous knowledge of. It MUST be a NULL-terminated array. |
SOL_LWM2M_SECURITY_MODE_RAW_PUBLIC_KEY | struct sol_lwm2m_security_rpk *rpk, struct sol_blob **known_pub_keys | rpk This Bootstrap Server's Key Pair - known_pub_keys The Clients' Public Keys this Bootstrap Server has previous knowledge of. It MUST be a NULL-terminated array. |
NULL
on error. Referenced by main().
int sol_lwm2m_bootstrap_server_send_finish | ( | struct sol_lwm2m_bootstrap_server * | server, |
struct sol_lwm2m_bootstrap_client_info * | client | ||
) |
Signals the end of the Bootstrap Process.
Use this function to tell the LWM2M Client that this LWM2M Bootstrap Server has finished sending the available Bootstrap Information.
server | The LWM2M Bootstrap Server. |
client | The LWM2M Bootstrap Client info object. |
sol_lwm2m_bootstrap_client_info
handle will be invalid! Referenced by write_resource_cb().
int sol_lwm2m_bootstrap_server_write | ( | struct sol_lwm2m_bootstrap_server * | server, |
struct sol_lwm2m_bootstrap_client_info * | client, | ||
const char * | path, | ||
struct sol_lwm2m_resource * | resources, | ||
size_t | len, | ||
void(*)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code) | sol_lwm2m_bootstrap_server_status_response_cb, | ||
const void * | data | ||
) |
Writes an object instance or resource through the Bootstrap Interface.
server | The LWM2M bootstrap server. |
client | The LWM2M bootstrap client info to write. |
path | The object path to be written (Example /2/1). |
resources | An array of sol_lwm2m_resource |
len | The length of resources |
sol_lwm2m_bootstrap_server_status_response_cb | A callback to be called when the write operation is completed. - server The LW2M bootstrap server; client The LWM2M client; path The client's path; response_code The operation's response_code ; data User data. |
data | User data to sol_lwm2m_bootstrap_server_status_response_cb |
Referenced by delete_all_cb(), write_sec_one_cb(), and write_servers_cb().
int sol_lwm2m_bootstrap_server_write_object | ( | struct sol_lwm2m_bootstrap_server * | server, |
struct sol_lwm2m_bootstrap_client_info * | client, | ||
const char * | path, | ||
struct sol_lwm2m_resource ** | instances, | ||
size_t * | instances_len, | ||
uint16_t * | instances_ids, | ||
size_t | len, | ||
void(*)(void *data, struct sol_lwm2m_bootstrap_server *server, struct sol_lwm2m_bootstrap_client_info *client, const char *path, enum sol_coap_response_code response_code) | sol_lwm2m_bootstrap_server_status_response_cb, | ||
const void * | data | ||
) |
Writes a full object through the Bootstrap Interface.
server | The LWM2M bootstrap server. |
client | The LWM2M bootstrap client info to write. |
path | The object path to be written (Example /2). |
instances | An array of sol_lwm2m_resource arrays |
instances_len | An array with the length of each element from instances |
instances_ids | An array with the desired instance_id of each element from instances |
len | The length of instances |
sol_lwm2m_bootstrap_server_status_response_cb | A callback to be called when the write operation is completed. - server The LW2M bootstrap server; client The LWM2M client; path The client's path; response_code The operation's response_code ; data User data. |
data | User data to sol_lwm2m_bootstrap_server_status_response_cb |
Referenced by write_server_one_cb().