IoTivity-Lite
|
Functions | |
oc_endpoint_address_t * | plgd_dps_add_endpoint_address (plgd_dps_context_t *ctx, const char *uri, size_t uri_len, const char *name, size_t name_len) |
Allocate and add an address to the list of DPS endpoint addresses. More... | |
bool | plgd_dps_endpoint_is_empty (const plgd_dps_context_t *ctx) |
Check if no DPS service endpoint is set. More... | |
int | plgd_dps_get_endpoint (const plgd_dps_context_t *ctx, char *buffer, size_t buffer_size) |
Copy the selected endpoint address of the DPS service to output buffer. More... | |
void | plgd_dps_iterate_server_addresses (const plgd_dps_context_t *ctx, oc_endpoint_addresses_iterate_fn_t iterate_fn, void *iterate_fn_data) |
Iterate over DPS endpoint addresses. More... | |
bool | plgd_dps_remove_endpoint_address (plgd_dps_context_t *ctx, const oc_endpoint_address_t *address) |
Remove an address from the list of DPS endpoint addresses. More... | |
bool | plgd_dps_select_endpoint_address (plgd_dps_context_t *ctx, const oc_endpoint_address_t *address) |
Select an address from the list of DPS endpoint addresses. More... | |
const oc_endpoint_address_t * | plgd_dps_selected_endpoint_address (const plgd_dps_context_t *ctx) |
Get the selected DPS endpoint address. More... | |
void | plgd_dps_set_endpoint (plgd_dps_context_t *ctx, const char *endpoint) |
Set endpoint address of the DPS service. More... | |
oc_endpoint_address_t* plgd_dps_add_endpoint_address | ( | plgd_dps_context_t * | ctx, |
const char * | uri, | ||
size_t | uri_len, | ||
const char * | name, | ||
size_t | name_len | ||
) |
Allocate and add an address to the list of DPS endpoint addresses.
ctx | dps context (cannot be NULL) |
uri | endpoint address (cannot be NULL; the uri must be at least 1 character long and less than OC_ENDPOINT_MAX_ENDPOINT_URI_LENGTH characters long, otherwise the call will fail) |
uri_len | length of uri |
name | name of the DPS endpoint |
name_len | length of name |
bool plgd_dps_endpoint_is_empty | ( | const plgd_dps_context_t * | ctx | ) |
Check if no DPS service endpoint is set.
ctx | dps context (cannot be NULL) |
int plgd_dps_get_endpoint | ( | const plgd_dps_context_t * | ctx, |
char * | buffer, | ||
size_t | buffer_size | ||
) |
Copy the selected endpoint address of the DPS service to output buffer.
ctx | dps context (cannot be NULL) | |
[out] | buffer | output buffer (cannot be NULL and must be large enough to contain the endpoint in a string format) |
buffer_size | size of output buffer |
void plgd_dps_iterate_server_addresses | ( | const plgd_dps_context_t * | ctx, |
oc_endpoint_addresses_iterate_fn_t | iterate_fn, | ||
void * | iterate_fn_data | ||
) |
Iterate over DPS endpoint addresses.
ctx | dps context (cannot be NULL) |
iterate_fn | callback function invoked for each DPS endpoint address (cannot be NULL) |
iterate_fn_data | custom user data provided to iterate_fn |
iterate_fn
must not modify the list of DPS endpoint addresses. bool plgd_dps_remove_endpoint_address | ( | plgd_dps_context_t * | ctx, |
const oc_endpoint_address_t * | address | ||
) |
Remove an address from the list of DPS endpoint addresses.
ctx | dps context (cannot be NULL) |
address | endpoint address to remove |
bool plgd_dps_select_endpoint_address | ( | plgd_dps_context_t * | ctx, |
const oc_endpoint_address_t * | address | ||
) |
Select an address from the list of DPS endpoint addresses.
ctx | dps context (cannot be NULL) |
address | DPS endpoint address to select (cannot be NULL; must be in the list of DPS endpoints) |
const oc_endpoint_address_t* plgd_dps_selected_endpoint_address | ( | const plgd_dps_context_t * | ctx | ) |
Get the selected DPS endpoint address.
ctx | dps context (cannot be NULL) |
void plgd_dps_set_endpoint | ( | plgd_dps_context_t * | ctx, |
const char * | endpoint | ||
) |
Set endpoint address of the DPS service.
Expected format of the endpoint is "coaps+tcp://${HOST}:${PORT}". For example: coaps+tcp://localhost:40030
If there are multiple endpoint addresses set then a successful call to this function will remove all other endpoint addresses and set the new endpoint address as the only one in the list of DPS endpoint addresses.
ctx | dps context (cannot be NULL) |
endpoint | endpoint of the provisioning server (cannot be NULL) |