*/
/**
+ * @MOBILE_ONLY
* @brief The rpc port parcel handle.
* @since_tizen 4.0
*/
typedef void *rpc_port_parcel_h;
/**
+ * @MOBILE_ONLY
* @brief The interface for converting data to/from a parcel.
* @since_tizen 4.0
*/
} rpc_port_parcelable_t;
/**
+ * @MOBILE_ONLY
* @brief Creates a rpc port parcel handle.
* @since_tizen 4.0
* @remarks You must release @a h using rpc_port_parcel_destroy().
int rpc_port_parcel_create(rpc_port_parcel_h *h);
/**
+ * @MOBILE_ONLY
* @brief Creates a rpc port parcel handle from port.
* @details Creates a rpc port parcel handle using read data from the port.
* It calls rpc_port_read() internally.
int rpc_port_parcel_create_from_port(rpc_port_parcel_h *h, rpc_port_h port);
/**
+ * @MOBILE_ONLY
* @brief Sends parcel data through the port.
* @details Sends parcel data through the port. It calls rpc_port_write()
* internally.
int rpc_port_parcel_send(rpc_port_parcel_h h, rpc_port_h port);
/**
+ * @MOBILE_ONLY
* @brief Destroys a rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_destroy(rpc_port_parcel_h h);
/**
+ * @MOBILE_ONLY
* @brief Writes a byte value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_byte(rpc_port_parcel_h h, char b);
/**
+ * @MOBILE_ONLY
* @brief Writes a short value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_int16(rpc_port_parcel_h h, short i);
/**
+ * @MOBILE_ONLY
* @brief Writes a integer value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_int32(rpc_port_parcel_h h, int i);
/**
+ * @MOBILE_ONLY
* @brief Writes a long long integer value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_int64(rpc_port_parcel_h h, long long i);
/**
+ * @MOBILE_ONLY
* @brief Writes a floating point value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_float(rpc_port_parcel_h h, float f);
/**
+ * @MOBILE_ONLY
* @brief Writes a double precision floating point value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_double(rpc_port_parcel_h h, double d);
/**
+ * @MOBILE_ONLY
* @brief Writes a string value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_string(rpc_port_parcel_h h, const char *str);
/**
+ * @MOBILE_ONLY
* @brief Writes a boolean value into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_bool(rpc_port_parcel_h h, bool b);
/**
+ * @MOBILE_ONLY
* @brief Writes a bundle data into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_bundle(rpc_port_parcel_h h, bundle *b);
/**
+ * @MOBILE_ONLY
* @brief Writes a count for array into rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write_array_count(rpc_port_parcel_h h, int count);
/**
+ * @MOBILE_ONLY
* @brief Writes the data into parcel handle using @a parcelable.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_write(rpc_port_parcel_h h, rpc_port_parcelable_t *parcelable, void *data);
/**
+ * @MOBILE_ONLY
* @brief Reads a byte value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_byte(rpc_port_parcel_h h, char *b);
/**
+ * @MOBILE_ONLY
* @brief Reads a short value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_int16(rpc_port_parcel_h h, short *i);
/**
+ * @MOBILE_ONLY
* @brief Reads a integer value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_int32(rpc_port_parcel_h h, int *i);
/**
+ * @MOBILE_ONLY
* @brief Reads a long long integer value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_int64(rpc_port_parcel_h h, long long *i);
/**
+ * @MOBILE_ONLY
* @brief Reads a floating point value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_float(rpc_port_parcel_h h, float *f);
/**
+ * @MOBILE_ONLY
* @brief Reads a double precision floating point value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_double(rpc_port_parcel_h h, double *d);
/**
+ * @MOBILE_ONLY
* @brief Reads a string value from rpc port parcel handle.
* @since_tizen 4.0
* @remarks The @a str should be released using free().
int rpc_port_parcel_read_string(rpc_port_parcel_h h, char **str);
/**
+ * @MOBILE_ONLY
* @brief Reads a boolean value from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_bool(rpc_port_parcel_h h, bool *b);
/**
+ * @MOBILE_ONLY
* @brief Reads a bundle data from rpc port parcel handle.
* @since_tizen 4.0
* @remarks The @a b should be released using bundle_free().
int rpc_port_parcel_read_bundle(rpc_port_parcel_h h, bundle **b);
/**
+ * @MOBILE_ONLY
* @brief Reads a count for array from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_read_array_count(rpc_port_parcel_h h, int *count);
/**
+ * @MOBILE_ONLY
* @brief Reads a parcel from the data using @a parcelable.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
/**
+ * @MOBILE_ONLY
* @brief Reads bytes from rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
int rpc_port_parcel_burst_read(rpc_port_parcel_h h, unsigned char *buf, unsigned int size);
/**
+ * @MOBILE_ONLY
* @brief Write bytes to rpc port parcel handle.
* @since_tizen 4.0
* @param[in] h The rpc port parcel handle
/**
+ * @MOBILE_ONLY
* @brief Enumeration for error codes of a rpc port.
* @since_tizen 4.0
*/
} rpc_port_error_e;
/**
+ * @MOBILE_ONLY
* @brief Enumeration for types of communication channels.
* @since_tizen 4.0
*/
/* Common */
/**
+ * @MOBILE_ONLY
* @brief The rpc port handle.
* @since_tizen 4.0
*/
typedef void *rpc_port_h;
/**
+ * @MOBILE_ONLY
* @brief Reads data from an RPC port.
* @since_tizen 4.0
*
int rpc_port_read(rpc_port_h h, void *buf, unsigned int size);
/**
+ * @MOBILE_ONLY
* @brief Writes data to an RPC port.
* @since_tizen 4.0
*
/* Proxy */
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy is connected.
* @details The function is called when the proxy is connected with stub by port.
* @since_tizen 4.0
const char *port_name, rpc_port_h port, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy is disconnected.
* @details The function is called when the proxy is disconnected from stub.
* @since_tizen 4.0
const char *port_name, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy is rejected.
* @details The function is called when the proxy is rejected to connect stub.
* @since_tizen 4.0
const char *port_name, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy received data.
* @details The function is called when the proxy received data from stub.
* @since_tizen 4.0
const char *port_name, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief The rpc port proxy handle.
* @since_tizen 4.0
*/
typedef void *rpc_port_proxy_h;
/**
+ * @MOBILE_ONLY
* @brief Creates a rpc port proxy handle.
* @since_tizen 4.0
* @remarks You must release @a h using rpc_port_proxy_destroy().
int rpc_port_proxy_create(rpc_port_proxy_h *h);
/**
+ * @MOBILE_ONLY
* @brief Destroys a rpc port proxy handle.
* @since_tizen 4.0
* @param[in] h The rpc port proxy handle
int rpc_port_proxy_destroy(rpc_port_proxy_h h);
/**
+ * @MOBILE_ONLY
* @brief Connects to @a port of @a appid.
* @details To send and receive data, the proxy should connect to port of stub
* @since_tizen 4.0
const char *port);
/**
+ * @MOBILE_ONLY
* @brief Adds a proxy connected callback.
* @since_tizen 4.0
* @param[in] h The rpc port proxy handle
rpc_port_proxy_connected_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Adds a proxy disconnected callback.
* @since_tizen 4.0
* @param[in] h The rpc port proxy handle
rpc_port_proxy_disconnected_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Adds a proxy rejected callback.
* @since_tizen 4.0
* @param[in] h The rpc port proxy handle
rpc_port_proxy_rejected_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Adds a proxy received callback.
* @since_tizen 4.0
* @param[in] h The rpc port proxy handle
rpc_port_proxy_received_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Gets a port from proxy handle.
* @since_tizen 4.0
* @remarks This handle @a port will not be valid if the proxy was disconnected or destroyed.
/* Stub */
/**
+ * @MOBILE_ONLY
* @brief The rpc port stub handle.
* @since_tizen 4.0
*/
typedef void *rpc_port_stub_h;
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy is connected with stub.
* @details The function is called when the proxy is connected with stub.
* When a proxy connects to stub several times with new port,
const char *instance, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Called when the proxy is disconnected from stub.
* @details The function is called when the proxy is disconnected from stub.
* When a proxy is disconnected, you can check the request
const char *instance, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Called when the stub received data from proxy.
* @details The function is called when the stub received data from stub.
* When a stub received data from several ports, you can handle
const char *instance, rpc_port_h port, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Creates a rpc port stub handle.
* @since_tizen 4.0
* @remarks You must release @a h using rpc_port_stub_destroy().
int rpc_port_stub_create(rpc_port_stub_h *h, const char *port_name);
/**
+ * @MOBILE_ONLY
* @brief Destroys a rpc port stub handle.
* @since_tizen 4.0
* @param[in] h The rpc port stub handle
int rpc_port_stub_destroy(rpc_port_stub_h h);
/**
+ * @MOBILE_ONLY
* @brief Listens to the requests for connections.
* @details The stub listens requests to connect by port
* @since_tizen 4.0
int rpc_port_stub_listen(rpc_port_stub_h h);
/**
+ * @MOBILE_ONLY
* @brief Adds a privilege to the stub.
* @details The stub can control access to the port using tizen privilege.
* It allows connections only if the proxy which have the privileges.
int rpc_port_stub_add_privilege(rpc_port_stub_h h, const char *privilege);
/**
+ * @MOBILE_ONLY
* @brief Sets trusted to the stub.
* @details The stub can control access to the port using tizen certificate.
* It allows connections only if the proxy is signed with the same
int rpc_port_stub_set_trusted(rpc_port_stub_h h, const bool trusted);
/**
+ * @MOBILE_ONLY
* @brief Adds a stub connected callback.
* @since_tizen 4.0
* @param[in] h The rpc stub stub handle
rpc_port_stub_connected_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Adds a stub disconnected callback.
* @since_tizen 4.0
* @param[in] h The rpc port stub handle
rpc_port_stub_disconnected_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Adds a stub received callback.
* @since_tizen 4.0
* @param[in] h The rpc port stub handle
rpc_port_stub_received_event_cb cb, void *user_data);
/**
+ * @MOBILE_ONLY
* @brief Gets a port from stub handle.
* @since_tizen 4.0
* @remarks This handle @a port will not be valid if the instance of the stub was disconnected or destroyed.