Tizen(Headed) Native API
6.5
|
IoTCon Server provides API for server side.
Required Header
#include <iotcon.h>
Overview
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. |
Function Documentation
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().
- Since :
- 3.0
- Remarks:
- device_name may not be an empty string.
- Parameters:
-
[in] device_name The device name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Remarks:
- If time_to_live is 0, server will set default value as 60 seconds.
If time_to_live is very big, server will set maximum value as (60 * 60 * 24) seconds (24 hours).
- Parameters:
-
[in] time_to_live The interval of announcing presence in seconds
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
IOTCON_ERROR_NONE Successful IOTCON_ERROR_NOT_SUPPORTED Not supported IOTCON_ERROR_SYSTEM System error IOTCON_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- iotcon_initialize() should be called to initialize.
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.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/internet
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
IOTCON_ERROR_NONE Successful IOTCON_ERROR_NOT_SUPPORTED Not supported IOTCON_ERROR_SYSTEM System error IOTCON_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- iotcon_initialize() should be called to initialize.