Tizen Native API
7.0
|
The Cion API provides functions to communicate between devices.
Required Header
#include <cion.h>
Overview
The Cion is a module to communicate between devices.
Functions | |
int | cion_connection_result_get_status (const cion_connection_result_h result, cion_connection_status_e *status) |
Gets the connection result status. | |
int | cion_connection_result_get_reason (const cion_connection_result_h result, char **reason) |
Gets the connection result reason. | |
int | cion_payload_create (cion_payload_h *payload, cion_payload_type_e type) |
Creates a payload handle. | |
int | cion_payload_destroy (cion_payload_h payload) |
Destroys the payload handle. | |
int | cion_payload_get_type (cion_payload_h payload, cion_payload_type_e *type) |
Gets the type of payload. | |
int | cion_payload_get_data (cion_payload_h payload, unsigned char **data, unsigned int *data_size) |
Gets the data from payload. | |
int | cion_payload_set_data (cion_payload_h payload, const unsigned char *data, unsigned int data_size) |
Sets the data to payload. | |
int | cion_payload_save_as_file (cion_payload_h payload, const char *path) |
Saves the payload as a file. | |
int | cion_payload_get_received_file_name (cion_payload_h payload, char **file_name) |
Gets the name of received file from the payload. | |
int | cion_payload_get_received_bytes (cion_payload_h payload, uint64_t *bytes) |
Gets the size of currently received file from the payload. | |
int | cion_payload_get_total_bytes (cion_payload_h payload, uint64_t *bytes) |
Gets the total size of file from the payload. | |
int | cion_payload_set_file_path (cion_payload_h payload, const char *path) |
Sets the file path to send payload. | |
int | cion_payload_get_payload_id (cion_payload_h payload, char **payload_id) |
Gets the ID of payload. | |
int | cion_payload_async_result_clone (const cion_payload_async_result_h result, cion_payload_async_result_h *result_clone) |
Creates a clone of payload async result. | |
int | cion_payload_async_result_destroy (cion_payload_async_result_h result) |
Destroys the payload async result. | |
int | cion_payload_async_result_get_result (const cion_payload_async_result_h result, cion_payload_async_result_e *code) |
Gets the result status from payload async result handle. | |
int | cion_payload_async_result_get_peer_info (const cion_payload_async_result_h result, cion_peer_info_h *peer_info) |
Gets the peer information from async result. | |
int | cion_payload_async_result_get_payload_id (const cion_payload_async_result_h result, char **payload_id) |
Gets the payload ID. | |
int | cion_peer_info_clone (const cion_peer_info_h peer_info, cion_peer_info_h *peer_info_clone) |
Creates a clone of peer info handle. | |
int | cion_peer_info_destroy (cion_peer_info_h peer_info) |
Destroys the peer info handle and releases all its resources. | |
int | cion_peer_info_get_device_id (cion_peer_info_h peer_info, char **device_id) |
Gets the device ID. | |
int | cion_peer_info_get_device_name (cion_peer_info_h peer_info, char **device_name) |
Gets the device name. | |
int | cion_peer_info_get_device_platform (cion_peer_info_h peer_info, char **device_platform) |
Gets the device's platform. | |
int | cion_peer_info_get_device_platform_version (cion_peer_info_h peer_info, char **device_platform_version) |
Gets the device's platform version. | |
int | cion_peer_info_get_device_type (cion_peer_info_h peer_info, char **device_type) |
Gets the device's type. | |
int | cion_peer_info_get_app_id (cion_peer_info_h peer_info, char **app_id) |
Gets application ID of peer. | |
int | cion_peer_info_get_app_version (cion_peer_info_h peer_info, char **app_version) |
Gets application version of peer. | |
int | cion_peer_info_get_uuid (cion_peer_info_h peer_info, char **uuid) |
Gets UUID of peer. | |
int | cion_peer_info_get_display_name (cion_peer_info_h peer_info, char **display_name) |
Gets display name of peer. | |
int | cion_security_create (cion_security_h *security) |
Creates the Cion security handle. | |
int | cion_security_destroy (cion_security_h security) |
Destroys the Cion security handle. | |
int | cion_security_set_ca_path (cion_security_h security, const char *ca_path) |
Sets the path of certificate authority certificates. | |
int | cion_security_set_cert_path (cion_security_h security, const char *cert_path) |
Sets the path of certificate. | |
int | cion_security_set_private_key_path (cion_security_h security, const char *key_path) |
Sets the path of private key. | |
int | cion_security_get_ca_path (cion_security_h security, char **ca_path) |
Gets the path of certificate authority certificates. | |
int | cion_security_get_cert_path (cion_security_h security, char **cert_path) |
Gets the path of certificate. | |
int | cion_security_get_private_key_path (cion_security_h security, char **key_path) |
Gets the path of private key. | |
Typedefs | |
typedef void * | cion_connection_result_h |
The Cion connection result handle. | |
typedef enum _connection_status_e | cion_connection_status_e |
Enumeration for Cion connection status types. | |
typedef enum _cion_error | cion_error_e |
Enumeration for Cion errors. | |
typedef void * | cion_payload_h |
The Cion payload handle. | |
typedef enum _payload_type_e | cion_payload_type_e |
Enumeration for payload types. | |
typedef enum _payload_transfer_status_e | cion_payload_transfer_status_e |
Enumeration for payload transfer status types. | |
typedef void * | cion_payload_async_result_h |
The Cion payload async result handle. | |
typedef enum _payload_async_result_e | cion_payload_async_result_e |
Enumeration for payload async result types. | |
typedef void * | cion_peer_info_h |
The Cion peer info handle. | |
typedef void * | cion_security_h |
The Cion security handle. |
Typedef Documentation
typedef void* cion_connection_result_h |
The Cion connection result handle.
- Since :
- 6.5
typedef enum _connection_status_e cion_connection_status_e |
Enumeration for Cion connection status types.
- Since :
- 6.5
typedef enum _cion_error cion_error_e |
Enumeration for Cion errors.
- Since :
- 6.5
typedef enum _payload_async_result_e cion_payload_async_result_e |
Enumeration for payload async result types.
- Since :
- 6.5
typedef void* cion_payload_async_result_h |
The Cion payload async result handle.
- Since :
- 6.5
typedef void* cion_payload_h |
The Cion payload handle.
- Since :
- 6.5
typedef enum _payload_transfer_status_e cion_payload_transfer_status_e |
Enumeration for payload transfer status types.
- Since :
- 6.5
typedef enum _payload_type_e cion_payload_type_e |
Enumeration for payload types.
- Since :
- 6.5
typedef void* cion_peer_info_h |
The Cion peer info handle.
- Since :
- 6.5
typedef void* cion_security_h |
The Cion security handle.
- Since :
- 6.5
Enumeration Type Documentation
enum _cion_error |
Enumeration for Cion errors.
- Since :
- 6.5
- Enumerator:
enum _connection_status_e |
enum _payload_type_e |
Function Documentation
int cion_connection_result_get_reason | ( | const cion_connection_result_h | result, |
char ** | reason | ||
) |
Gets the connection result reason.
- Since :
- 6.5
- Remarks:
- reason must be released using free().
- Parameters:
-
[in] result The connection result handle [out] reason Connection result reason, should be freed after use
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *reason = NULL; ret = cion_connection_result_get_reason(result, &reason); }
int cion_connection_result_get_status | ( | const cion_connection_result_h | result, |
cion_connection_status_e * | status | ||
) |
Gets the connection result status.
- Since :
- 6.5
- Parameters:
-
[in] result The connection result handle [out] status Connection result status
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample code:
#include <cion.h> { int ret; cion_connection_status_e status; ret = cion_connection_result_get_status(result, &status); }
int cion_payload_async_result_clone | ( | const cion_payload_async_result_h | result, |
cion_payload_async_result_h * | result_clone | ||
) |
Creates a clone of payload async result.
- Since :
- 6.5
- Remarks:
- result_clone must be released using cion_payload_async_result_destroy()
- Parameters:
-
[in] result The payload async result handle [out] result_clone The cloned handle of payload async result
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_payload_async_result_destroy()
- Sample code:
#include <cion.h> { int ret; cion_payload_async_result_h result_clone; ret = cion_payload_async_result_clone(result, &result_clone); }
int cion_payload_async_result_destroy | ( | cion_payload_async_result_h | result | ) |
Destroys the payload async result.
- Since :
- 6.5
- Parameters:
-
[in] result The payload async result handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_payload_async_result_clone()
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_async_result_destroy(result); }
int cion_payload_async_result_get_payload_id | ( | const cion_payload_async_result_h | result, |
char ** | payload_id | ||
) |
Gets the payload ID.
- Since :
- 6.5
- Remarks:
- payload_id must be released using free().
- Parameters:
-
[in] result The result of payload async [out] payload_id The ID of payload
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample code:
#include <cion.h> { int ret; char *payload_id = NULL; ret = cion_payload_async_result_get_payload_id(result, &payload_id); }
int cion_payload_async_result_get_peer_info | ( | const cion_payload_async_result_h | result, |
cion_peer_info_h * | peer_info | ||
) |
Gets the peer information from async result.
- Since :
- 6.5
- Remarks:
- peer_info must be released using cion_peer_info_destroy().
- Parameters:
-
[in] result The result of payload async [out] peer_info The Cion peer information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory CION_ERROR_IO_ERROR IO error
- See also:
- cion_peer_info_destroy()
- Sample code:
#include <cion.h> { int ret; cion_peer_info_h peer_info; ret = cion_payload_async_result_get_peer_info(result, &peer_info); }
int cion_payload_async_result_get_result | ( | const cion_payload_async_result_h | result, |
cion_payload_async_result_e * | code | ||
) |
Gets the result status from payload async result handle.
- Since :
- 6.5
- Parameters:
-
[in] result The payload async result handle [out] code The result state of payload async result
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_payload_async_result_e
- Sample code:
#include <cion.h> { int ret; cion_payload_async_result_e code; ret = cion_payload_async_result_get_result(result, &code); }
int cion_payload_create | ( | cion_payload_h * | payload, |
cion_payload_type_e | type | ||
) |
Creates a payload handle.
- Since :
- 6.5
- Remarks:
- payload must be released using cion_payload_destroy().
- Parameters:
-
[out] payload The payload handle [in] type The type of payload
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_payload_destroy()
- Sample code:
#include <cion.h> { int ret; cion_payload_h payload; ret = cion_payload_create(&payload, CION_PAYLOAD_TYPE_DATA); }
int cion_payload_destroy | ( | cion_payload_h | payload | ) |
Destroys the payload handle.
- Since :
- 6.5
- Parameters:
-
[in] payload The payload handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_payload_create()
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_destroy(payload); }
int cion_payload_get_data | ( | cion_payload_h | payload, |
unsigned char ** | data, | ||
unsigned int * | data_size | ||
) |
Gets the data from payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_DATA.
- data must be released using free().
- Parameters:
-
[in] payload The payload handle [out] data The data [out] data_size The size of data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- CION_PAYLOAD_TYPE_DATA
- Sample code:
#include <cion.h> { int ret; unsigned char *data = NULL; unsigned int data_size; ret = cion_payload_get_data(payload, &data, &data_size); }
int cion_payload_get_payload_id | ( | cion_payload_h | payload, |
char ** | payload_id | ||
) |
Gets the ID of payload.
- Since :
- 6.5
- Remarks:
- payload_id must be released using free().
- Parameters:
-
[in] payload The payload handle [out] payload_id The ID of payload
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_get_payload_id(payload, &payload_id); }
int cion_payload_get_received_bytes | ( | cion_payload_h | payload, |
uint64_t * | bytes | ||
) |
Gets the size of currently received file from the payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_FILE.
- Parameters:
-
[in] payload The payload handle [out] bytes The size of file
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- CION_PAYLOAD_TYPE_FILE
- Sample code:
#include <cion.h> { int ret; uint64_t bytes; ret = cion_payload_get_received_bytes(payload, &bytes); }
int cion_payload_get_received_file_name | ( | cion_payload_h | payload, |
char ** | file_name | ||
) |
Gets the name of received file from the payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_FILE.
- file_name must be released using free().
- Parameters:
-
[in] payload The payload handle [out] file_name The name of file
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- CION_PAYLOAD_TYPE_FILE
- Sample code:
#include <cion.h> { int ret; char *file_name = NULL; ret = cion_payload_get_received_file_name(payload, &file_name); }
int cion_payload_get_total_bytes | ( | cion_payload_h | payload, |
uint64_t * | bytes | ||
) |
Gets the total size of file from the payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_FILE.
- Parameters:
-
[in] payload The payload handle [out] bytes The size of file
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- CION_PAYLOAD_TYPE_FILE
- Sample code:
#include <cion.h> { int ret; uint64_t bytes; ret = cion_payload_get_total_bytes(payload, &bytes); }
int cion_payload_get_type | ( | cion_payload_h | payload, |
cion_payload_type_e * | type | ||
) |
Gets the type of payload.
- Since :
- 6.5
- Parameters:
-
[in] payload The payload handle [out] type The type of payload
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_payload_type_e
- Sample code:
#include <cion.h> { int ret; cion_payload_type_e type; ret = cion_payload_get_type(payload, &type); }
int cion_payload_save_as_file | ( | cion_payload_h | payload, |
const char * | path | ||
) |
Saves the payload as a file.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_FILE.
- The path is absolute path.
-
If the media storage is used, http://tizen.org/privilege/mediastorage privilege is necessary.
If the external storage is used, http://tizen.org/privilege/externalstorage privilege is necessary.
- Parameters:
-
[in] payload The payload handle [in] path The path of file
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_PERMISSION_DENIED Permission denied CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OPERATION_FAILED Operation failed
- See also:
- CION_PAYLOAD_TYPE_FILE
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_save_as_file(payload, "filepath"); }
int cion_payload_set_data | ( | cion_payload_h | payload, |
const unsigned char * | data, | ||
unsigned int | data_size | ||
) |
Sets the data to payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_DATA.
- Parameters:
-
[in] payload The payload handle [in] data The data [in] data_size The size of data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- CION_PAYLOAD_TYPE_DATA
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_set_data(payload, "mydata", 6); }
int cion_payload_set_file_path | ( | cion_payload_h | payload, |
const char * | path | ||
) |
Sets the file path to send payload.
- Since :
- 6.5
- Remarks:
- This can be used when the payload type is CION_PAYLOAD_TYPE_FILE.
-
If media storage is used, http://tizen.org/privilege/mediastorage privilege is necessary.
If external storage is used, http://tizen.org/privilege/externalstorage privilege is necessary.
- Parameters:
-
[in] payload The payload handle [in] path The path of file
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_PERMISSION_DENIED Permission denied CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- CION_PAYLOAD_TYPE_FILE
- Sample code:
#include <cion.h> { int ret; ret = cion_payload_set_file_path(payload, "filepath"); }
int cion_peer_info_clone | ( | const cion_peer_info_h | peer_info, |
cion_peer_info_h * | peer_info_clone | ||
) |
Creates a clone of peer info handle.
- Since :
- 6.5
- Remarks:
- peer_info_clone must be released using cion_peer_info_destroy().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] peer_info_clone The cloned peer information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory CION_ERROR_IO_ERROR IO error
- See also:
- cion_peer_info_destroy()
- Sample code:
#include <cion.h> { int ret; cion_peer_info_h peer_info_cloned; ret = cion_peer_info_clone(peer_info, &peer_info_cloned); }
int cion_peer_info_destroy | ( | cion_peer_info_h | peer_info | ) |
Destroys the peer info handle and releases all its resources.
- Since :
- 6.5
- Parameters:
-
[in] peer_info The Cion peer information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_peer_info_clone()
- Sample code:
#include <cion.h> { int ret; ret = cion_peer_info_destroy(peer_info); }
int cion_peer_info_get_app_id | ( | cion_peer_info_h | peer_info, |
char ** | app_id | ||
) |
Gets application ID of peer.
- Since :
- 6.5
- Remarks:
- app_id must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] app_id The application ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *app_id = NULL; ret = cion_peer_info_get_app_id(peer_info, &app_id); }
int cion_peer_info_get_app_version | ( | cion_peer_info_h | peer_info, |
char ** | app_version | ||
) |
Gets application version of peer.
- Since :
- 6.5
- Remarks:
- app_version must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] app_version The application version
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *app_version = NULL; ret = cion_peer_info_get_app_version(peer_info, &app_version); }
int cion_peer_info_get_device_id | ( | cion_peer_info_h | peer_info, |
char ** | device_id | ||
) |
Gets the device ID.
- Since :
- 6.5
- Remarks:
- device_id must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] device_id The device ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *device_id = NULL; ret = cion_peer_info_get_device_id(peer_info, &device_id); }
int cion_peer_info_get_device_name | ( | cion_peer_info_h | peer_info, |
char ** | device_name | ||
) |
Gets the device name.
- Since :
- 6.5
- Remarks:
- device_name must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] device_name The device name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *device_name = NULL; ret = cion_peer_info_get_device_name(peer_info, &device_name); }
int cion_peer_info_get_device_platform | ( | cion_peer_info_h | peer_info, |
char ** | device_platform | ||
) |
Gets the device's platform.
- Since :
- 6.5
- Remarks:
- device_platform must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] device_platform The platform name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *device_platform = NULL; ret = cion_peer_info_get_device_platform(peer_info, &device_platform); }
int cion_peer_info_get_device_platform_version | ( | cion_peer_info_h | peer_info, |
char ** | device_platform_version | ||
) |
Gets the device's platform version.
- Since :
- 6.5
- Remarks:
- device_platform_version must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] device_platform_version The platform version
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *device_type = NULL; ret = cion_peer_info_get_device_platform_version(peer_info, &device_type); }
int cion_peer_info_get_device_type | ( | cion_peer_info_h | peer_info, |
char ** | device_type | ||
) |
Gets the device's type.
- Since :
- 6.5
- Remarks:
- device_type must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] device_type Device type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *device_type = NULL; ret = cion_peer_info_get_device_type(peer_info, &device_type); }
int cion_peer_info_get_display_name | ( | cion_peer_info_h | peer_info, |
char ** | display_name | ||
) |
Gets display name of peer.
The custom name for service name.
It is possible that display_name does not exist.
- Since :
- 6.5
- Remarks:
- display_name must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] display_name The display name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_security_set_ca_path()
- Sample code:
#include <cion.h> { int ret; char *display_name = NULL; ret = cion_peer_info_get_display_name(peer_info, &display_name); }
int cion_peer_info_get_uuid | ( | cion_peer_info_h | peer_info, |
char ** | uuid | ||
) |
Gets UUID of peer.
- Since :
- 6.5
- Remarks:
- uuid must be released using free().
- Parameters:
-
[in] peer_info The Cion peer information handle [out] uuid The UUID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- Sample code:
#include <cion.h> { int ret; char *uuid = NULL; ret = cion_peer_info_get_uuid(peer_info, &uuid); }
int cion_security_create | ( | cion_security_h * | security | ) |
Creates the Cion security handle.
- Since :
- 6.5
- Remarks:
- security must be released using cion_security_destroy().
- Parameters:
-
[out] security The Cion security handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_security_destroy()
- Sample code:
#include <cion.h> { int ret; cion_security_h security = NULL; ret = cion_security_create(&security); }
int cion_security_destroy | ( | cion_security_h | security | ) |
Destroys the Cion security handle.
- Since :
- 6.5
- Parameters:
-
[in] security The Cion security handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- cion_security_create();
- Sample code:
#include <cion.h> { int ret; ret = cion_security_destroy(security); }
int cion_security_get_ca_path | ( | cion_security_h | security, |
char ** | ca_path | ||
) |
Gets the path of certificate authority certificates.
- Since :
- 6.5
- Remarks:
- ca_path must be released using free().
- Parameters:
-
[in] security The Cion security handle [out] ca_path The path of certificate authority certificates
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_security_set_ca_path()
- Sample code:
#include <cion.h> { int ret; char *ca_path = NULL; ret = cion_security_get_ca_path(security, &ca_path); }
int cion_security_get_cert_path | ( | cion_security_h | security, |
char ** | cert_path | ||
) |
Gets the path of certificate.
- Since :
- 6.5
- Remarks:
- cert_path must be released using free().
- Parameters:
-
[in] security The Cion security handle [out] cert_path The path of certificate
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_security_set_cert_path()
- Sample code:
#include <cion.h> { int ret; char *cert_path = NULL; ret = cion_security_get_cert_path(security, &cert_path); }
int cion_security_get_private_key_path | ( | cion_security_h | security, |
char ** | key_path | ||
) |
Gets the path of private key.
- Since :
- 6.5
- Remarks:
- key_path must be released using free().
- Parameters:
-
[in] security The Cion security handle [out] key_path The path of private key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_INVALID_PARAMETER Invalid parameter CION_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- cion_security_set_private_key_path()
- Sample code:
#include <cion.h> { int ret; char *key_path = NULL; ret = cion_security_get_private_key_path(security, &key_path); }
int cion_security_set_ca_path | ( | cion_security_h | security, |
const char * | ca_path | ||
) |
Sets the path of certificate authority certificates.
- Since :
- 6.5
- Remarks:
- If the media storage is used, http://tizen.org/privilege/mediastorage privilege is necessary.
If the external storage is used, http://tizen.org/privilege/externalstorage privilege is necessary.
- Parameters:
-
[in] security The Cion security handle [in] ca_path The path of certificate authority certificates
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_PERMISSION_DENIED Permission denied CION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample code:
#include <cion.h> { int ret; ret = cion_security_set_ca_path(security, "CaPath"); }
int cion_security_set_cert_path | ( | cion_security_h | security, |
const char * | cert_path | ||
) |
Sets the path of certificate.
- Since :
- 6.5
- Remarks:
- If the media storage is used, http://tizen.org/privilege/mediastorage privilege is necessary.
If the external storage is used, http://tizen.org/privilege/externalstorage privilege is necessary.
- Parameters:
-
[in] security The Cion security handle [in] cert_path The path of certificate
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_PERMISSION_DENIED Permission denied CION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample code:
#include <cion.h> { int ret; ret = cion_security_set_cert_path(security, "CertPath"); }
int cion_security_set_private_key_path | ( | cion_security_h | security, |
const char * | key_path | ||
) |
Sets the path of private key.
- Since :
- 6.5
- Remarks:
- If the media storage is used, http://tizen.org/privilege/mediastorage privilege is necessary.
If the external storage is used, http://tizen.org/privilege/externalstorage privilege is necessary.
- Parameters:
-
[in] security The Cion security handle [in] key_path The path of private key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CION_ERROR_NONE Successful CION_ERROR_PERMISSION_DENIED Permission denied CION_ERROR_INVALID_PARAMETER Invalid parameter
- Sample code:
#include <cion.h> { int ret; ret = cion_security_set_private_key_path(security, "KeyPath"); }