Tizen Native API  6.5

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

Enumeration for Cion connection status types.

Since :
6.5
typedef enum _cion_error cion_error_e

Enumeration for Cion errors.

Since :
6.5

Enumeration for payload async result types.

Since :
6.5

The Cion payload async result handle.

Since :
6.5
typedef void* cion_payload_h

The Cion payload handle.

Since :
6.5

Enumeration for payload transfer status types.

Since :
6.5

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

Enumeration for Cion errors.

Since :
6.5
Enumerator:
CION_ERROR_NONE 

Success

CION_ERROR_IO_ERROR 

I/O error

CION_ERROR_OUT_OF_MEMORY 

Out of memory

CION_ERROR_PERMISSION_DENIED 

Permission denied

CION_ERROR_INVALID_PARAMETER 

Invalid parameter

CION_ERROR_INVALID_OPERATION 

Function not implemented

CION_ERROR_ALREADY_IN_PROGRESS 

Already in progress

CION_ERROR_NOT_SUPPORTED 

Not supported

CION_ERROR_TIMED_OUT 

Timed out

CION_ERROR_OPERATION_FAILED 

Operation failed

Enumeration for Cion connection status types.

Since :
6.5
Enumerator:
CION_CONNECTION_STATUS_OK 

Connection is ok

CION_CONNECTION_STATUS_REJECTED 

Connection is rejected

CION_CONNECTION_STATUS_ERROR 

Connection error occurs

Enumeration for payload async result types.

Since :
6.5
Enumerator:
CION_PAYLOAD_ASYNC_RESULT_PENDING 

Pending

CION_PAYLOAD_ASYNC_RESULT_SUCCESS 

Success

CION_PAYLOAD_ASYNC_RESULT_FAIL 

Fail

Enumeration for payload transfer status types.

Since :
6.5
Enumerator:
CION_PAYLOAD_TRANSFER_STATUS_SUCCESS 

Transfer is success

CION_PAYLOAD_TRANSFER_STATUS_FAILURE 

Transfer is failed

CION_PAYLOAD_TRANSFER_STATUS_IN_PROGRESS 

Transfer is in progress

Enumeration for payload types.

Since :
6.5
Enumerator:
CION_PAYLOAD_TYPE_DATA 

Data type payload

CION_PAYLOAD_TYPE_FILE 

File type payload


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]resultThe connection result handle
[out]reasonConnection result reason, should be freed after use
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut of memory
Sample code:
#include <cion.h>

{
    int ret;
    char *reason = NULL;

    ret = cion_connection_result_get_reason(result, &reason);
}

Gets the connection result status.

Since :
6.5
Parameters:
[in]resultThe connection result handle
[out]statusConnection result status
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
Sample code:
#include <cion.h>

{
    int ret;
    cion_connection_status_e status;

    ret = cion_connection_result_get_status(result, &status);
}

Creates a clone of payload async result.

Since :
6.5
Remarks:
result_clone must be released using cion_payload_async_result_destroy()
Parameters:
[in]resultThe payload async result handle
[out]result_cloneThe cloned handle of payload async result
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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);
}

Destroys the payload async result.

Since :
6.5
Parameters:
[in]resultThe payload async result handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]resultThe result of payload async
[out]payload_idThe ID of payload
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
Sample code:
#include <cion.h>

{
    int ret;
    char *payload_id = NULL;

    ret = cion_payload_async_result_get_payload_id(result, &payload_id);
}

Gets the peer information from async result.

Since :
6.5
Remarks:
peer_info must be released using cion_peer_info_destroy().
Parameters:
[in]resultThe result of payload async
[out]peer_infoThe Cion peer information handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut of memory
CION_ERROR_IO_ERRORIO 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);
}

Gets the result status from payload async result handle.

Since :
6.5
Parameters:
[in]resultThe payload async result handle
[out]codeThe result state of payload async result
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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);
}

Creates a payload handle.

Since :
6.5
Remarks:
payload must be released using cion_payload_destroy().
Parameters:
[out]payloadThe payload handle
[in]typeThe type of payload
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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);
}

Destroys the payload handle.

Since :
6.5
Parameters:
[in]payloadThe payload handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]payloadThe payload handle
[out]dataThe data
[out]data_sizeThe size of data
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]payloadThe payload handle
[out]payload_idThe ID of payload
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]payloadThe payload handle
[out]bytesThe size of file
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]payloadThe payload handle
[out]file_nameThe name of file
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]payloadThe payload handle
[out]bytesThe size of file
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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);
}

Gets the type of payload.

Since :
6.5
Parameters:
[in]payloadThe payload handle
[out]typeThe type of payload
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]payloadThe payload handle
[in]pathThe path of file
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_PERMISSION_DENIEDPermission denied
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OPERATION_FAILEDOperation 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]payloadThe payload handle
[in]dataThe data
[in]data_sizeThe size of data
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]payloadThe payload handle
[in]pathThe path of file
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_PERMISSION_DENIEDPermission denied
CION_ERROR_INVALID_PARAMETERInvalid 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_infoThe Cion peer information handle
[out]peer_info_cloneThe cloned peer information handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut of memory
CION_ERROR_IO_ERRORIO 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);
}

Destroys the peer info handle and releases all its resources.

Since :
6.5
Parameters:
[in]peer_infoThe Cion peer information handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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_infoThe Cion peer information handle
[out]app_idThe application ID
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]app_versionThe application version
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]device_idThe device ID
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]device_nameThe device name
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]device_platformThe platform name
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]device_platform_versionThe platform version
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]device_typeDevice type
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]display_nameThe display name
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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_infoThe Cion peer information handle
[out]uuidThe UUID
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut of memory
Sample code:
#include <cion.h>

{
    int ret;
    char *uuid = NULL;

    ret = cion_peer_info_get_uuid(peer_info, &uuid);
}

Creates the Cion security handle.

Since :
6.5
Remarks:
security must be released using cion_security_destroy().
Parameters:
[out]securityThe Cion security handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
See also:
cion_security_destroy()
Sample code:
#include <cion.h>

{
    int ret;

    cion_security_h security = NULL;

    ret = cion_security_create(&security);
}

Destroys the Cion security handle.

Since :
6.5
Parameters:
[in]securityThe Cion security handle
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid 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]securityThe Cion security handle
[out]ca_pathThe path of certificate authority certificates
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]securityThe Cion security handle
[out]cert_pathThe path of certificate
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]securityThe Cion security handle
[out]key_pathThe path of private key
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_INVALID_PARAMETERInvalid parameter
CION_ERROR_OUT_OF_MEMORYOut 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]securityThe Cion security handle
[in]ca_pathThe path of certificate authority certificates
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_PERMISSION_DENIEDPermission denied
CION_ERROR_INVALID_PARAMETERInvalid 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]securityThe Cion security handle
[in]cert_pathThe path of certificate
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_PERMISSION_DENIEDPermission denied
CION_ERROR_INVALID_PARAMETERInvalid 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]securityThe Cion security handle
[in]key_pathThe path of private key
Returns:
0 on success, otherwise a negative error value
Return values:
CION_ERROR_NONESuccessful
CION_ERROR_PERMISSION_DENIEDPermission denied
CION_ERROR_INVALID_PARAMETERInvalid parameter
Sample code:
#include <cion.h>

{
    int ret;
    ret = cion_security_set_private_key_path(security, "KeyPath");
}