Tizen Native API
5.5
|
IoTCon Server provides API for server side.
#include <iotcon.h>
This API set consists of server side API for Resource, Lite Resource, Observers, Request.
Functions | |
int | iotcon_start_presence (unsigned int time_to_live) |
Starts presence of a server. | |
int | iotcon_stop_presence (void) |
Stops presence of a server. | |
int | iotcon_set_device_name (const char *device_name) |
Sets the device name. |
int iotcon_set_device_name | ( | const char * | device_name | ) |
Sets the device name.
The function sets the name of the local device (the device calling the function). If the device name is set, clients can get the name using iotcon_device_info_get_property() or iotcon_remote_resource_get_device_name().
[in] | device_name | The device name |
0
on success, otherwise a negative error value IOTCON_ERROR_NONE | Successful |
IOTCON_ERROR_NOT_SUPPORTED | Not supported |
IOTCON_ERROR_INVALID_PARAMETER | Invalid parameter |
IOTCON_ERROR_OUT_OF_MEMORY | Out of memory |
IOTCON_ERROR_IOTIVITY | Iotivity errors |
int iotcon_start_presence | ( | unsigned int | time_to_live | ) |
Starts presence of a server.
Use this function to send server's announcements to clients.
Server can call this function when online for the first time or come back from offline to online.
[in] | time_to_live | The interval of announcing presence in seconds |
0
on success, otherwise a negative error value IOTCON_ERROR_NONE | Successful |
IOTCON_ERROR_NOT_SUPPORTED | Not supported |
IOTCON_ERROR_SYSTEM | System error |
IOTCON_ERROR_PERMISSION_DENIED | Permission denied |
int iotcon_stop_presence | ( | void | ) |
Stops presence of a server.
Use this function to stop sending server's announcements to clients. Server can call this function when terminating, entering to offline or out of network.
0
on success, otherwise a negative error value IOTCON_ERROR_NONE | Successful |
IOTCON_ERROR_NOT_SUPPORTED | Not supported |
IOTCON_ERROR_SYSTEM | System error |
IOTCON_ERROR_PERMISSION_DENIED | Permission denied |