Tizen Native API
4.0
|
The Service Adaptor (Deprecated) API provides developer with common interfaces like using local service for various service infra.
Required Header
#include <service_adaptor_client.h>
Overview
Developers can use functions easily and commonly be provided from various service infra.
When you want use another service infra, you can use same interfaces if you change just initalize setting.
Service adaptor provides functions kind of Auth, Storage and it will provides more kinds of service infra.
API | Description |
---|---|
Service Plugin (Deprecated) | Provide functions for handling service plugin |
Functions | |
int | service_adaptor_create (service_adaptor_h *service_adaptor) TIZEN_DEPRECATED_API |
Create Service Adaptor. | |
int | service_adaptor_destroy (service_adaptor_h service_adaptor) TIZEN_DEPRECATED_API |
Destroy Service Adaptor. | |
int | service_adaptor_foreach_plugin (service_adaptor_h service_adaptor, service_adaptor_plugin_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Foreach the list of plugin. | |
int | service_adaptor_create_plugin (service_adaptor_h service_adaptor, const char *plugin_uri, service_plugin_h *plugin) TIZEN_DEPRECATED_API |
Create service plugin handle. | |
int | service_adaptor_get_last_result (int *err) TIZEN_DEPRECATED_API |
Gets service specfic last result. | |
int | service_adaptor_get_last_error_message (char **message) TIZEN_DEPRECATED_API |
Gets service specfic last result error message. | |
int | service_plugin_get_property (service_plugin_h plugin, const char *key, char **value) TIZEN_DEPRECATED_API |
Gets Plugin Property. | |
Typedefs | |
typedef struct _service_adaptor_s * | service_adaptor_h |
The handle for connection and managing plugin handle of Service Adaptor. | |
typedef bool(* | service_adaptor_plugin_cb )(char *plugin_uri, int service_mask, void *user_data) |
Callback for service_adaptor_foreach_plugin API. |
Typedef Documentation
typedef struct _service_adaptor_s* service_adaptor_h |
The handle for connection and managing plugin handle of Service Adaptor.
- Deprecated:
- Deprecated since 3.0
The handle can be created by service_adaptor_create()
When a handle is no longer needed, use service_adaptor_destroy()
typedef bool(* service_adaptor_plugin_cb)(char *plugin_uri, int service_mask, void *user_data) |
Callback for service_adaptor_foreach_plugin API.
- Deprecated:
- Deprecated since 3.0
- Parameters:
-
[in] plugin_uri The service plugin's unique uri, this value be set by plugin [in] service_mask Masked value for installed service plugins, this value can be masked multiple enum (service_plugin_service_type_e) [in] user_data Passed data from service_adaptor_foreach_plugin()
- Remarks:
- service_mask check using 'bit and' operation with service_plugin_service_type_e
- - for example,
- if(service_mask & SERVICE_PLUGIN_SERVICE_STORAGE)
- { USING_STORAGE_CODE }
- Do not release memory of plugin_uri
- See also:
- service_plugin_service_type_e
- Returns:
true
to continue with the next iteration of the loop, otherwisefalse
to break out of the loop
- Precondition:
- service_adaptor_foreach_plugin() will invoke this callback.
Enumeration Type Documentation
Enumerations of result code for Service Adaptor.
- Deprecated:
- Deprecated since 3.0
- Enumerator:
SERVICE_ADAPTOR_ERROR_NONE Success
SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED Service plugin does not support API
SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER The parameter is invalid
SERVICE_ADAPTOR_ERROR_TIMED_OUT API time out
SERVICE_ADAPTOR_ERROR_NO_DATA There is no data available
SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED Permission denied
SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE IPC Connection unstabled
SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED The error occured from Plugin, See detail from service_adaptor_get_last_result() and Plugin SPEC
SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED Need Authorization
SERVICE_ADAPTOR_ERROR_INVALID_STATE The handle state is invalid for processing API
Function Documentation
int service_adaptor_create | ( | service_adaptor_h * | service_adaptor | ) |
Create Service Adaptor.
- Deprecated:
- Deprecated since 3.0
- Since :
- 2.4
- Parameters:
-
[out] service_adaptor The Service Adaptor handle
- Remarks:
- service_adaptor must be released memory using service_adaptor_destroy(), when a program no longer needs any function of Service Adaptor
- See also:
- service_adaptor_destroy()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
int service_adaptor_create_plugin | ( | service_adaptor_h | service_adaptor, |
const char * | plugin_uri, | ||
service_plugin_h * | plugin | ||
) |
Create service plugin handle.
- Deprecated:
- Deprecated since 3.0
Create plugin handle using plugin_uri
- Since :
- 2.4
- Parameters:
-
[in] service_adaptor The handle of Service Adaptor [in] plugin_uri The specfic string for use plugin, this values are set by plugin [out] plugin The handle for use Plugin APIs
- Remarks:
- plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's API
- See also:
- service_plugin_destroy()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
- Precondition:
- service_adaptor must be issued by service_adaptor_create()
int service_adaptor_destroy | ( | service_adaptor_h | service_adaptor | ) |
Destroy Service Adaptor.
- Deprecated:
- Deprecated since 3.0
It must called after a program no longer needs any function of Service Adaptor
- Since :
- 2.4
- Parameters:
-
[in] service_adaptor The handle of Service Adaptor
- See also:
- service_adaptor_create()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
- Precondition:
- service_adaptor must be issued by service_adaptor_create()
int service_adaptor_foreach_plugin | ( | service_adaptor_h | service_adaptor, |
service_adaptor_plugin_cb | callback, | ||
void * | user_data | ||
) |
Foreach the list of plugin.
- Deprecated:
- Deprecated since 3.0
Iterate to all installed plugin
- Since :
- 2.4
- Parameters:
-
[in] service_adaptor The handle of Service Adaptor [in] callback The callback for foreach plugin [in] user_data Passed data to callback
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_NO_DATA There is no available plugins SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
- Precondition:
- service_adaptor must be issued by service_adaptor_create()
int service_adaptor_get_last_error_message | ( | char ** | message | ) |
Gets service specfic last result error message.
- Deprecated:
- Deprecated since 3.0
This function retrieves the last error code that be issued from plugin.
When if API function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, gets using this function.
- Since :
- 2.4
- Parameters:
-
[out] message The error message that is defined service plugin SPEC
- Remarks:
- message must be released using free()
- Thread safe functions
- The result string's detail specification is defined service plugin or provider.
- See also:
- service_adaptor_get_last_result()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_NO_DATA There is no error message SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
int service_adaptor_get_last_result | ( | int * | err | ) |
Gets service specfic last result.
- Deprecated:
- Deprecated since 3.0
This function retrieves the last error code that be issued from plugin.
When if API function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, gets using this function.
- Since :
- 2.4
- Parameters:
-
[out] err The error number that is defined service plugin SPEC
- Remarks:
- Thread safe functions
- The result number's detail specification is defined service plugin or provider.
- The detail error message can be got using service_adaptor_get_last_error_message()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_NO_DATA There is no result SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
int service_plugin_get_property | ( | service_plugin_h | plugin, |
const char * | key, | ||
char ** | value | ||
) |
Gets Plugin Property.
- Deprecated:
- Deprecated since 3.0
- Since :
- 2.4
- Parameters:
-
[in] plugin The handle for use Plugin APIs [in] key The key of plugin property [out] value The value of plugin property that matched key
- Remarks:
- Some kind of property key(Not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX)
- value must be released using free()
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
SERVICE_ADAPTOR_ERROR_NONE Successful SERVICE_ADAPTOR_ERROR_NO_DATA There is no property SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error