From: Donghyun Lee Date: Tue, 28 Jul 2015 05:43:34 +0000 (+0900) Subject: Delete Service Adaptor from web API references because serviceadaptor is native X-Git-Tag: tizen_3.0/TD_SYNC/20161201~669 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0071c0fa0ef0c6ac3bd294a225ee878a101a8987;p=sdk%2Fonline-doc.git Delete Service Adaptor from web API references because serviceadaptor is native --- diff --git a/org.tizen.web.apireference/html/device_api/mobile/index.html b/org.tizen.web.apireference/html/device_api/mobile/index.html index cb8b3f1..ddd29cb 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/index.html +++ b/org.tizen.web.apireference/html/device_api/mobile/index.html @@ -232,13 +232,6 @@ Optional No - - Service Adaptor - This API provides methods to communicate with cloud storage systems or other storage systems. - 2.4 - Mandatory - Yes -

System

APIDescriptionVersion (Since)MobileSupported on
Mobile Emulator
diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/serviceadaptor.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/serviceadaptor.html deleted file mode 100644 index dc67573..0000000 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/serviceadaptor.html +++ /dev/null @@ -1,3725 +0,0 @@ - - - - - - Account API - - -
-
-

Service Adaptor Client API

-
- The Service Adaptor Client API provides developer with common interfaces like using local service to communicate with remote storage systems. - Service Adaptor Client provides functions kind of Authorization, Storage ones. -
-
-

- Since: - 2.4 -

- - - - -
-

Summary of Interfaces and Methods

- - - - - - - - - - - - - - - - - - -
InterfaceMethod
Service Adaptor API - int service_adaptor_create (service_adaptor_h *service_adaptor)
- int service_adaptor_destroy (service_adaptor_h service_adaptor)
- int service_adaptor_foreach_plugin (service_adaptor_h service_adaptor, service_adaptor_plugin_cb callback, void * user_data)
- int service_adaptor_query_plugin_by_file (service_adaptor_h service_adaptor, const char *file_path, char **plugin_uri)
- int service_adaptor_get_last_error_message (char **message)
- int service_adaptor_get_last_result (int *err) -
Service Plugin API - int service_adaptor_create_plugin (service_adaptor_h service_adaptor, const char *plugin_uri, service_plugin_h *plugin)
- int service_plugin_add_property (service_plugin_h plugin, const char *key, const char *value)
- int service_plugin_get_property (service_plugin_h plugin, const char *key, char **value)
- int service_plugin_remove_property (service_plugin_h plugin, const char *key)
- int service_plugin_start (service_plugin_h plugin, int service_mask)
- int service_plugin_stop (service_plugin_h plugin)
- int service_plugin_destroy (service_plugin_h plugin)
-
Storage API - int service_storage_create_download_task (service_plugin_h plugin, const char *storage_path, const char *download_path, service_storage_task_h *task)
- int service_storage_create_download_thumbnail_task (service_plugin_h plugin, const char *storage_path, const char *download_path, int thumbnail_size, service_storage_task_h *task)
- int service_storage_create_upload_task (service_plugin_h plugin, const char *file_path, const char *upload_path, service_storage_task_h *task)
- int service_storage_set_task_progress_cb (service_storage_task_h task, service_storage_task_progress_cb callback, void *user_data)
- int service_storage_set_task_state_changed_cb (service_storage_task_h task, service_storage_task_state_cb callback, void *user_data)
- int service_storage_unset_task_progress_cb (service_storage_task_h task)
- int service_storage_unset_task_state_changed_cb (service_storage_task_h task)
- int service_storage_start_task (service_storage_task_h task)
- int service_storage_cancel_task (service_storage_task_h task)
- int service_storage_destroy_task (service_storage_task_h task)
- int service_storage_get_file_list (service_plugin_h plugin, const char *dir_path, service_storage_file_list_cb callback, void *user_data)
- int service_storage_file_list_get_length (service_storage_file_list_h list, int *length)
- int service_storage_file_list_foreach_file (service_storage_file_list_h list, service_storage_file_cb callback, void *user_data)
- int service_storage_file_list_clone (service_storage_file_list_h src_list, service_storage_file_list_h *dst_list)
- int service_storage_file_list_destroy (service_storage_file_list_h list)
- int service_storage_file_clone (service_storage_file_h src_file, service_storage_file_h *dst_file)
- int service_storage_file_get_logical_path (service_storage_file_h file, char **path)
- int service_storage_file_get_physical_path (service_storage_file_h file, char **path)
- int service_storage_file_get_size (service_storage_file_h file, unsigned long long *size)
- int service_storage_file_is_dir (service_storage_file_h file, bool *is_dir)
- int service_storage_file_destroy (service_storage_file_h file)
- int service_storage_remove (service_plugin_h plugin, const char *remove_path, service_storage_result_cb callback, void *user_data)
-
-
- -
-

1. Global Type Definitions

-
- -

1.1 Service Error Codes

-
- Specify error codes returned by API functionality. -
-
    enum service_adaptor_error_e {"SERVICE_ADAPTOR_ERROR_NONE", "SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED",
-                                "SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER", "SERVICE_ADAPTOR_ERROR_TIMED_OUT", "SERVICE_ADAPTOR_ERROR_NO_DATA",
-                                "SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED", "SERVICE_ADAPTOR_ERROR_UNKNOWN", "SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE",
-                                "SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED", "SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED", "SERVICE_ADAPTOR_ERROR_INVALID_STATE"
-                                                    };  
-

- Since: - 2.4 -

-
-
    -
  • - 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 Autholization
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle state is invalid for processing API
  • - -
-
-
-
- - -
-

2. Service Adaptor API

-
- The Service Adaptor API provides functions to manage service adaptor handle and creation of service plugin -
- - -
- -

2.1. Service Adaptor API Types Definition

-
-

2.1.1 Service Adaptor Handle

-
- The handle for connection and managing plugin handle of Service Adaptor.
- The handle can be created by service_adaptor_create().
- When a handle is no longer needed, use service_adaptor_destroy() - -
-
    typedef struct _service_adaptor_s* service_adaptor_h  
-

- Since: - 2.4 -

-
-
-

2.1.2 Service Adaptor Plugin Callback

-
- Callback for service_adaptor_foreach_plugin() API -
-
    typedef bool(* service_adaptor_plugin_cb) (char *plugin_uri, int service_mask, void *user_data)  
-

- Since: - 2.4 -

-
-

Parameters:

- -
-
-
- - -
-

2.2 Methods

- -
-
- - service_adaptor_create -
-
-
- Create Service Adaptor. -
-
int service_adaptor_create(service_adaptor_h *service_adaptor);
-                                
-

- Since: - 2.4 -

-
-

- Create Service Adaptor handle. The Service Adaptor is needed to use other functionality in this API. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - service_adaptor: - Handle for new Service Adaptor. -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- service_adaptor must be released memory using service_adaptor_destroy() when a program no longer needs any function of Service Adaptor -
-
-

Code example:

service_adaptor_h service_adaptor = NULL;
-service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-ret = service_adaptor_create(&service_adaptor);
-
-if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-{
-    some_operations();
-    service_adaptor_destroy(service_adaptor);
-}
-else
-{
-    log_error("Creating Service Adaptor failed", ret);
-}
-                                
-
-
-
- -
-
- - service_adaptor_destroy -
-
-
- Destroy Service Adaptor. -
-
int service_adaptor_destroy(service_adaptor_h service_adaptor);
-                                
-

- Since: - 2.4 -

-
-

- Destroy Service Adaptor. It must called after a program no longer needs any function of Service Adaptor. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - service_adaptor: - Handle to Service Adaptor. -
  • -
-
-
-

Return value:

-
    -
  • - 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() -
-
-

Code example:

service_adaptor_h service_adaptor = NULL;
-service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-ret = service_adaptor_create(&service_adaptor);
-
-if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-{
-    some_operations();
-    service_adaptor_destroy(service_adaptor);
-}
-else
-{
-    log_error("Creating Service Adaptor failed", ret);
-}
-                                
-
-
-
- -
-
- - service_adaptor_foreach_plugin -
-
-
- Foreach the list of plugins. -
-
int service_adaptor_foreach_plugin(service_adaptor_h service_adaptor, service_adaptor_plugin_cb callback, void * user_data);
-                                
-

- Since: - 2.4 -

-
-

- Foreach the list of plugins. This function will call callback function for all installed plugins. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - service_adaptor: - The handle of Service Adaptor -
  • -
  • - callback: - The callback for foreach plugin -
  • -
  • - user_data: - Passed data to callback -
  • -
-
-
-

Return value:

-
    -
  • - 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() -
-
-

Code example:

bool plugin_cb(char *plugin_uri, int service_mask, void *user_data)
-{
-    do_something_with_plugin(plugin_uri, service_mask);
-    return true;
-}
-
-void process_plugins(service_adaptor_h service_adaptor)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_adaptor_foreach_plugin(service_adaptor, plugin_cb, NULL);
-
-    switch(ret)
-    {
-        case SERVICE_ADAPTOR_ERROR_NONE: return;
-        case SERVICE_ADAPTOR_ERROR_NO_DATA: log_error("There is no installed plugin"); break;
-        default: log_error("Unknown error", ret);
-    }
-}
-                                
-
-
-
- -
-
- - service_adaptor_query_plugin_by_file -
-
-
- Retrieve an plugin URI with local file path. -
-
int service_adaptor_query_plugin_by_file(service_adaptor_h service_adaptor, const char *file_path, char **plugin_uri)
-                                
-

- Since: - 2.4 -

-
-

- For specific files that is located in cloud but be shown to such as local files (that is operated by Unified Storage System with Service Adaptor), - this API can find which plugin is used for that file (showing to likes local file). Please reference details to description for Unified Storage System. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - service_adaptor: - The handle of Service Adaptor -
  • -
  • - file_path: - The local file path -
  • -
  • - plugin_uri: - The specfic string for use plugin, this values are set by plugin -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no data (also returned if given file is just local (not storage) file) -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- plugin_uri must be released using free() -
-
-

Precondition

- service_adaptor must be issued by service_adaptor_create() -
-
-

Code example:

void process_files(service_adaptor_h service_adaptor, const char *file)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    char *plugin_uri = NULL;
-
-    ret = service_adaptor_query_plugin_by_file(service_adaptor, file, &plugin_uri);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        if (0 == strcmp("org.tizen.plugin.my_plugin", plugin_uri))
-        {
-            view_file(file);
-        }
-        else
-        {
-            log_warrning("File is not managed by my_plugin");
-        }
-    }
-    else
-    {
-        log_error("Error occurred", ret);
-    }
-    free(plugin_uri);
-}
-                                
-
-
-
- -
-
- - service_adaptor_get_last_error_message -
-
-
- Gets service specific last result error message. -
-
int service_adaptor_get_last_error_message(char **message)
-                                
-

- Since: - 2.4 -

-
-

- 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. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - message: - The error message that is defined service plugin SPEC -
  • -
-
-
-

Return value:

-
    -
  • - 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 -
  • -
-
-
-

Remarks

- message must be released using free() - Thread safe functions - The result string's detail specification is defined service plugin or provider. -
-
-

Code example:

service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-ret = do_some_operations_on_plugin();
-
-if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-{
-    return;
-}
-else if (SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED == ret)
-{
-    char *message = NULL;
-    if (SERVICE_ADAPTOR_ERROR_NONE == service_adaptor_get_last_error_message(&message);
-    {
-        show_plugin_message(message);
-        free(message);
-    }
-}
-else
-{
-    log_error("Unknown error", ret);
-}
-                                
-
-
-
- -
-
- - service_adaptor_get_last_result -
-
-
- Gets service specific last result. -
-
int service_adaptor_get_last_result(int *err)
-                                
-

- Since: - 2.4 -

-
-

- 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. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - err: - The error number that is defined service plugin SPEC -
  • -
-
-
-

Return value:

-
    -
  • - 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 -
  • -
-
-
-

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() - -
-
-

Code example:

service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-ret = do_some_operations_on_plugin();
-
-if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-{
-    return;
-}
-else if (SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED == ret)
-{
-    int err_msg = 0;
-    if (SERVICE_ADAPTOR_ERROR_NONE == service_adaptor_get_last_result(&err_msg);
-    {
-        handle_plugin_error(err_msg);
-    }
-}
-else
-{
-    log_error("Unknown error", ret);
-}
-                                
-
-
-
-
-
- -
-

3. Service Plugin API

-
- The Service Plugin API provides functions to manage the plugin set’s property and state. -
- -
- -

3.1. Service Plugin API Types Definition

- -
-

3.1.1 Service Plugin Handle

-
- The Plugn handle for Service Adaptor.
- The handle can be created by service_adaptor_create_plugin()
- When a handle is no longer needed, use service_plugin_destroy() -
-
    struct _service_plugin_s* service_plugin_h  
-

- Since: - 2.4 -

-
- -
-

3.1.2 Service Plugin Service Type

-
- Type of service in plugin. -
-
    enum service_plugin_service_type_e {"SERVICE_PLUGIN_SERVICE_AUTH", "SERVICE_PLUGIN_SERVICE_STORAGE"}; 
-
-
    -
  • - SERVICE_PLUGIN_SERVICE_AUTH - Auth service type flag
  • -
  • - SERVICE_PLUGIN_SERVICE_STORAGE - Storage service type flag
  • -
-
-

- Since: - 2.4 -

-
- -
-

3.1.3 Service Plugin API Macros

-
-
- - SERVICE_PLUGIN_PROPERTY_APP_KEY -
-
-
- Definition for the service_plugin property Application Key -
-
#define SERVICE_PLUGIN_PROPERTY_APP_KEY "http://tizen.org/service-adaptor/plugin/property/app_key"
-                                    
-

- Since: - 2.4 -

-
-

- Definition for the service_plugin property: The application id be issued from service provider for 3rd party developer -

-
-

- Privilege level: - public -

-
-
-
-
- - SERVICE_PLUGIN_PROPERTY_APP_SECRET -
-
-
- Definition for the service_plugin property Application Secret -
-
#define SERVICE_PLUGIN_PROPERTY_APP_SECRET  "http://tizen.org/service-adaptor/plugin/property/app_secret"
-                                    
-

- Since: - 2.4 -

-
-

- Definition for the service_plugin property: The application password be issued from service provider for 3rd party developer -

-
-

- Privilege level: - public -

-
-
-
-
- - SERVICE_PLUGIN_PROPERTY_USER_ID -
-
-
- Definition for the service_plugin property User ID -
-
#define SERVICE_PLUGIN_PROPERTY_APP_SECRET  "http://tizen.org/service-adaptor/plugin/property/app_secret"
-                                    
-

- Since: - 2.4 -

-
-

- Definition for the service_plugin property: The user id for using specific service provider for 3rd party developer -

-
-

- Privilege level: - public -

-
-
-
-
-
-

3.2 Methods

- -
-
- - service_adaptor_create_plugin -
-
-
- Create service plugin handle. -
-
int service_adaptor_create_plugin(service_adaptor_h service_adaptor, const char *plugin_uri, service_plugin_h *plugin);
-                                
-

- Since: - 2.4 -

-
-

- Create service plugin handle using plugin_uri -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - service_adaptor: - The handle of Service Adaptor -
  • -
  • - plugin_uri: - The specific string for use plugin, this values are set by plugin -
  • -
  • - plugin: - The handle for use Plugin APIs. -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's -
-
-

Code example:

service_adaptor_h service_adaptor = NULL;
-service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-ret = service_adaptor_create(&service_adaptor);
-
-if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-{
-    service_plugin_h plugin = NULL;
-    const char *plugin_uri = "org.tizen.plugin.my_plugin";
-
-    ret = service_adaptor_create_plugin(service_adaptor, plugin_uri, &plugin);
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        do_something();
-        service_plugin_destroy(plugin);
-    }
-    else
-    {
-        log_error("Creating plugin failed", ret);
-    }
-    service_adaptor_destroy(service_adaptor);
-}
-else
-{
-    log_error("Creating Service Adaptor failed", ret);
-}
-                                
-
-
-
- -
-
- - service_plugin_add_property -
-
-
- Add Plugin Property. -
-
int service_plugin_add_property(service_plugin_h plugin, const char *key, const char *value)
-                                
-

- Since: - 2.4 -

-
-

- Add Plugin Property. - The plguin property is used for plugin's basic or optional requirement.
- This value is not used in Adaptor layer, but it can be uesd to important Key for plugin with service provider. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - plugin: - The handle for use Plugin APIs -
  • -
  • - key: - The key of plugin property defined in 3.1.3 Service Plugin API Macros -
  • -
  • - value: - The value of plugin property that matched key -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- Some kind of property key(Not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX)
- If the key already exists in the property its current value is replaced with the new value .
- plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's API - -
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() -
-
-

Code example:

void create_plugin(service_adaptor_h service_adaptor)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    service_plugin_h plugin = NULL;
-    const char *plugin_uri = "org.tizen.plugin.my_plugin";
-
-    ret = service_adaptor_create_plugin(service_adaptor, plugin_uri, &plugin);
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        service_plugin_add_property(plugin, SERVICE_PLUGIN_PROPERTY_USER_ID, "The King");
-        do_something();
-        service_plugin_destroy(plugin);
-    }
-    else
-    {
-        log_error("Creating plugin failed", ret);
-    }
-}
-                                
-
-
-
- -
-
- - service_plugin_get_property -
-
-
- Gets Plugin Property. -
-
int service_plugin_get_property(service_plugin_h plugin, const char *key, char **value)
-                                
-

- Since: - 2.4 -

-
-

- Add Plugin Property. - The plguin property is used for plugin's basic or optional requirement.
- This value is not used in Adaptor layer, but it can be uesd to important Key for plugin with service provider. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - plugin: - The handle for use Plugin APIs -
  • -
  • - key: - The key of plugin property defined in 3.1.3 Service Plugin API Macros -
  • -
  • - value: - The value of plugin property that matched key -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no property -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

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() -
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() -
-
-

Code example:

bool check_plugin(service_plugin_h service_plugin)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    char *value = NULL;
-
-    ret = service_plugin_get_property(plugin, SERVICE_PLUGIN_PROPERTY_USER_ID, &value);
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        bool retVal = check_user(value);
-
-        free(value);
-        return retVal;
-    }
-    else
-    {
-        log_error("Creating plugin failed", ret);
-    }
-    return false;
-}
-                                
-
-
-
- -
-
- - service_plugin_remove_property -
-
-
- Remove Plugin Property -
-
int service_plugin_remove_property(service_plugin_h plugin, const char *key)
-                                
-

- Since: - 2.4 -

-
-

- Remove property that has been added before from plugin. -

-
-

- Privilege level: - public -

-
-

Parameters:

- -
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- Some kind of property key (not mandatory) is defined in this API (That is named to SERVICE_PLUGIN_PROPERTY_XXX) -
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() - The function property already set by service_plugin_add_property -
-
-

Code example:

bool reset_plugin(service_plugin_h service_plugin)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_plugin_remove_property(plugin, SERVICE_PLUGIN_PROPERTY_USER_ID);
-    return (SERVICE_ADAPTOR_ERROR_NONE == ret);
-}
-                                
-
-
-
- -
-
- - service_plugin_start -
-
-
- Requests start initialization for service plugin. -
-
int service_plugin_start (service_plugin_h plugin, int service_mask)
-                                
-

- Since: - 2.4 -

-
-

- Requests start initialization for service plugin. After start is done plugin is operational and plugin functionality can be used. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - plugin: - The handle for use Plugin APIs -
  • -
  • - service_mask: - The flag for use service plugins, this flag can be masked multiple enum (service_plugin_service_type_e -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED - Need authorization -
  • -
  • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- service_mask must be input using 'bit or' operation with service_plugin_service_type_e - - for example,
- int service_mask |= SERVIE_PLUGIN_SERVICE_AUTH;
- service_mask |= SERVICE_PLUGIN_SERVICE_STORAGE;
- int ret = service_plugin_start(m_plugin , service_mask );
- If a program needs to stop plugin manually, use service_plugin_stop(). - But in service_plugin_destroy(), automatically stop service plugin -
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() -
-
-

Code example:

service_plugin_h service_plugin = NULL;
-
-create_service_plugin(&service_plugin);
-add_properties_to_plugin(service_plugin);
-
-int mask = SERVIE_PLUGIN_SERVICE_AUTH;
-
-service_plugin_start(service_plugin, mask);
-do_something();
-
-service_plugin_destroy(service_plugin);
-                                
-
-
-
- -
-
- - service_plugin_stop -
-
-
- Requests stop manually for service plugin. -
-
int service_plugin_stop(service_plugin_h plugin)
-                                
-

- Since: - 2.4 -

-
-

- Requests stop manually for service plugin. This operation could be perform e.g. to change plugin state and start it again. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - plugin: - The handle for use Plugin APIs -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If a program needs to stop plugin manually, use this function. - But in service_plugin_destroy(), automatically stop service plugin - plugin must be released memory using service_plugin_destroy() when you no longer needs plugin's API -
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() -
-
-

Code example:

service_plugin_h service_plugin = NULL;
-
-create_service_plugin(&service_plugin);
-add_properties_to_plugin(service_plugin);
-
-int mask = SERVIE_PLUGIN_SERVICE_AUTH;
-
-service_plugin_start(service_plugin, mask);
-
-do_something();
-
-service_plugin_stop(service_plugin);
-service_plugin_change_to_annother_user_id(service_plugin);
-service_plugin_start(service_plugin, mask);
-
-do_something();  //do the same with another user id
-
-service_plugin_destroy(service_plugin);
-                                
-
-
-
- -
-
- - service_plugin_destroy -
-
-
- Stop and destroy Service Plugin. -
-
int service_plugin_destroy(service_plugin_h plugin)
-                                
-

- Since: - 2.4 -

-
-

- Requests stop (if not already stopped) and destroy Service Plugin.
- It must called after a program no longer needs APIs of specific plugin. -

-
-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - plugin: - The handle for use Plugin APIs -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Precondition

- plugin must be issued by service_adaptor_create_plugin() -
-
-

Code example:

service_plugin_h service_plugin = NULL;
-
-create_service_plugin(&service_plugin);
-add_properties_to_plugin(service_plugin);
-
-int mask = SERVIE_PLUGIN_SERVICE_AUTH;
-
-service_plugin_start(service_plugin, mask);
-do_something();
-
-service_plugin_destroy(service_plugin);
-                                
-
-
-
-
-
- -
-

4. Storage API

-
- Storage API provide functions for access and managing storage service. -
-
- -

4.1. Storage API Types Definition

- -
-

4.1.1 Service storage file

-
- The handle of file or directory in storage. -
-
    struct _service_storage_file_s* service_storage_file_h
-

- Since: - 2.4 -

-
- -
-

4.1.2 Service storage file list

-
- The list handle of file or directory in storage. -
-
    struct _service_storage_file_list_s* service_storage_file_list_h
-

- Since: - 2.4 -

-
- -
-

4.1.3 Service storage task

-
- The handle of async task for storage service. -
-
    struct _service_storage_task_s* service_storage_task_h
-

- Since: - 2.4 -

-
- -
-

4.1.4 Service storage task state

-
- The handle of async task for storage service. -
-
    enum service_storage_task_state_e={"SERVICE_STORAGE_TASK_IN_PROGRESS", "SERVICE_STORAGE_TASK_COMPLETED",
-                                       "SERVICE_STORAGE_TASK_CANCELED", "SERVICE_STORAGE_TASK_FAILED"};
-                        
-

- Since: - 2.4 -

-
-
    -
  • - SERVICE_STORAGE_TASK_IN_PROGRESS - The task is progressing
  • -
  • - SERVICE_STORAGE_TASK_COMPLETED - The task was completed
  • -
  • - SERVICE_STORAGE_TASK_CANCELED - The task was canceled
  • -
  • - SERVICE_STORAGE_TASK_FAILED - The task was failed
  • - -
-
-
- -
-

4.1.5 Service storage file callback

- -
    typedef bool(*service_storage_file_cb)(service_storage_file_h file, void *user_data)  
-

- Since: - 2.4 -

-
-

Parameters:

- -
-
- -
-

4.1.6 Service storage file list callback

-
- Callback for service_storage_get_file_list() API -
-
    void(* service_storage_file_list_cb)(int result, service_storage_file_list_h list, void *user_data)  
-

- Since: - 2.4 -

-
-

Parameters:

- -
-
- -
-

4.1.7 Service storage result callback

-
- Callback for getting async storage operation result. -
-
    void(* service_storage_result_cb)(int result, void *user_data)  
-

- Since: - 2.4 -

-
-

Parameters:

-
    -
  • - result: - Result code for storage async operation (see service_adaptor_error_e) -

    Possible value:

    -
      -
    • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
    • -
    • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no files -
    • -
    • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
    • -
    • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal.
      - Error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
      - Error codes and messages are described in Service Plugin. -
    • -
    • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
    • -
    -
  • -
  • - user_data: - Passed data from request function -
  • -
-
-
- -
-

4.1.8 Service storage task progress callback

-
- Callback for progress of storage task -
-
    void(* service_storage_task_progress_cb)(unsigned long long progress, unsigned long long total, void *user_data)  
-

- Since: - 2.4 -

-
-

Parameters:

-
    -
  • - progress: - The progressed amount of storage task -
  • -
  • - total: - The total amount of storage task -
  • -
  • - user_data: - Passed data from service_storage_set_task_progress_cb -
  • -
-
-
- -
-

4.1.9 Service storage task state callback

-
- Callback for changing state of storage task. -
-
    void(* service_storage_task_state_cb)(service_storage_task_state_e state, void *user_data)
-

- Since: - 2.4 -

-
-

Parameters:

- -
-
-
- -
-

4.2 Methods

- -
-
- - service_storage_create_download_task -
-
-
- Creates storage task for download file from storage. -
-
int service_storage_create_download_task(service_plugin_h plugin, const char *storage_path, const char *download_path, service_storage_task_h *task)
-                                
-

- Since: - 2.4 -

-

- Privilege level:

-
    -
  • http://tizen.org/privilege/mediastorage -
  • -
  • http://tizen.org/privilege/externalstorage -
  • -
-
-

Parameters:

-
    -
  • - plugin : - The handle for use Plugin APIs -
  • -
  • - storage_path : - The source file path in storage (Physical path) -
  • -
  • - download_path : - The source file path in storage (Physical path) -
  • -
  • - task: - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED - Permission denied -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle's state is invalid -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no files -
  • -
  • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED - Not supported API in this plugin -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- task must be released memory using service_storage_destroy_task() when the task no longer run
- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
-
-
-

Code example:

bool create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-    const char *storage_path = "/my_file.txt";
-    const char *download_path = "/";
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_create_download_task(plugin, storage_path, download_path, task);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        ret = service_storage_start_task(task);
-
-        if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-        {
-            return true;
-        }
-        else
-        {
-            log_error("Cannot start task", ret);
-            service_storage_destroy_task(task);
-        }
-    }
-    else
-    {
-        log_error("Cannot create task", ret);
-    }
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_create_download_thumbnail_task -
-
-
- Creates storage task for download thumbnail from storage. -
-
int service_storage_create_download_thumbnail_task(service_plugin_h plugin, const char *storage_path, const char *download_path, int thumbnail_size, service_storage_task_h *task)
-                                
-

- Since: - 2.4 -

-

- Privilege level:

-
    -
  • http://tizen.org/privilege/mediastorage -
  • -
  • http://tizen.org/privilege/externalstorage -
  • -
-
-

Parameters:

-
    -
  • - plugin : - The handle for use Plugin APIs -
  • -
  • - storage_path : - The source file path in storage (Physical path) -
  • -
  • - download_path : - The source file path in storage (Physical path) -
  • -
  • - thumbnail_size: - The size level of thumbnail, the level is defined service plugin SPEC -
  • -
  • - task: - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED - Permission denied -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle's state is invalid -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no files -
  • -
  • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED - Not supported API in this plugin -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If thumbnail_size is 0 , gets default size thumbnail, the default size must be defined plugin SPEC
- If thumbnail_size is -1 , gets minimum size thumbnail be supported plugin
- If thumbnail_size is -2 , gets maximum size thumbnail be supported plugin
- task must be released memory using service_storage_destroy_task() when the task no longer run
- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
-
-
-

Code example:

bool download_thumbnail(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-    const char *storage_path = "/my_file.png";
-    const char *download_path = "/.thumbnails/";
-    int size = -1;
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_create_download_task(plugin, storage_path, download_path, size, task);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        ret = service_storage_start_task(task);
-
-        if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-        {
-            return true;
-        }
-        else
-        {
-            log_error("Cannot start task", ret);
-            service_storage_destroy_task(task);
-        }
-    }
-    else
-    {
-        log_error("Cannot create task", ret);
-    }
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_create_upload_task -
-
-
- Creates storage task for upload file to storage -
-
int service_storage_create_upload_task(service_plugin_h plugin, const char *file_path, const char *upload_path, service_storage_task_h *task)
-                                
-

- Since: - 2.4 -

-

- Privilege level:

-
    -
  • http://tizen.org/privilege/mediastorage -
  • -
  • http://tizen.org/privilege/externalstorage -
  • -
-
-

Parameters:

-
    -
  • - plugin : - The handle for use Plugin APIs -
  • -
  • - file_path : - The upload file path in local (Logical path) -
  • -
  • - upload_path : - The upload target path in storage (Physical path) -
  • -
  • - task: - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED - Permission denied -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle's state is invalid -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no files -
  • -
  • - SERVICE_ADAPTOR_ERROR_TIMED_OUT - Timed out -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED - Not supported API in this plugin -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- task must be released memory using service_storage_destroy_task() when the task no longer run
- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
-
-
-

Code example:

bool upload(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-    const char *upload_path = "/my_file.png";
-    const char *upload_path = "/";
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_create_upload_task (plugin, upload_path, upload_path, task);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        ret = service_storage_start_task(task);
-
-        if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-        {
-            return true;
-        }
-        else
-        {
-            log_error("Cannot start task", ret);
-            service_storage_destroy_task(task);
-        }
-    }
-    else
-    {
-        log_error("Cannot create task", ret);
-    }
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_set_task_progress_cb -
-
-
- Sets a callback function to be invoked when progress of the task running -
-
int service_storage_set_task_progress_cb(service_storage_task_h task, service_storage_task_progress_cb callback, void *user_data)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task : - The handle of storage task -
  • -
  • - callback : - The callback function to register -
  • -
  • - user_data : - The user data to be passed to the callback function -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
- Error codes and messages are described in Service Plugin. -
-
-

Code example:

void task_progress_cb(unsigned long long progress, unsigned long long total, void *user_data)
-{
-    if (progress < total)
-    {
-        update_progress_bar(progress);
-    }
-    else
-    {
-        close_progress_bar();
-    }
-}
-
-void create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-
-    create_download_task(task);
-    set_task_properties(task);
-
-    service_storage_set_task_progress_cb(task, task_progress_cb, NULL);
-
-    start_task(task);
-}
-                                
-
-
-
- -
-
- - service_storage_set_task_state_changed_cb -
-
-
- Sets a callback function to be invoked when change of the task running state -
-
int service_storage_set_task_state_changed_cb(service_storage_task_h task, service_storage_task_state_cb callback, void *user_data)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task : - The handle of storage task -
  • -
  • - callback : - The callback function to register -
  • -
  • - user_data : - The user data to be passed to the callback function -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
- Error codes and messages are described in Service Plugin. -
-
-

Code example:

void task_state_cb(service_storage_task_state_e state, void *user_data)
-{
-    if (SERVICE_STORAGE_TASK_COMPLETED == state)
-    {
-        ending_task_process();
-    }
-}
-
-void create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-
-    create_download_task(task);
-    set_task_properties(task);
-
-    service_storage_set_task_progress_cb(task, task_progress_cb, NULL);
-    service_storage_set_task_state_changed_cb(task, task_state_cb, NULL);
-
-    start_task(task);
-}
-                                
-
-
-
- -
-
- - service_storage_unset_task_progress_cb -
-
-
- Unsets the progress callback function. -
-
int service_storage_unset_task_progress_cb(service_storage_task_h task)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task : - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Remarks

- This function must be called before starting task (see service_storage_start_task()) -
-
-

Code example:

void set_state_cb_in_task(service_storage_task_h task)
-{
-    service_storage_unset_task_progress_cb(task);
-    service_storage_set_task_progress_cb(task, task_progress_cb2, NULL);
-}
-
-void create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-
-    create_download_task(task);
-    set_task_properties(task);
-    set_progress_cb_in_task(task);
-
-    start_task(task);
-}
-                                
-
-
-
- -
-
- - service_storage_unset_task_state_changed_cb -
-
-
- Unsets the state changed callback function -
-
int service_storage_unset_task_state_changed_cb(service_storage_task_h task)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task : - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Remarks

- This function must be called before starting task (see service_storage_start_task()) -
-
-

Code example:

void set_state_cb_in_task(service_storage_task_h task)
-{
-    service_storage_unset_task_progress_cb(task);
-    service_storage_set_task_state_changed_cb(task, task_state_cb, NULL);
-}
-
-void create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-
-    create_download_task(task);
-    set_task_properties(task);
-    set_state_cb_in_task(task);
-
-    start_task(task);
-}
-                                
-
-
-
- -
-
- - service_storage_start_task -
-
-
- Starts storage task, asynchronously. -
-
int service_storage_start_task(service_storage_task_h task)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task : - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
- Error codes and messages are described in Service Plugin. -
-
-

Code example:

void create_task(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-
-    create_download_task(task);
-    set_task_properties(task);
-    set_task_callbacks(task);
-
-    service_storage_start_task(task);
-}
-                                
-
-
-
- -
-
- - service_storage_cancel_task -
-
-
- Cancels storage task. -
-
int service_storage_cancel_task(service_storage_task_h task);
-                                
-

- Since: - 2.4 -

-

- Privilege level: - public -

-
-

Parameters:

-
    -
  • - task: - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- task must be released memory using service_storage_destroy_task() when the task no longer run
- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
- Error codes and messages are described in Service Plugin. -
-
-

Code example:

void cancel_task(service_storage_task_h task)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_cancel_task(task);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        service_storage_destroy_task(task);
-    }
-    else
-    {
-        log_error("Cannot cancel task", ret);
-    }
-}
-                                
-
-
-
- -
-
- - service_storage_destroy_task -
-
-
- Destroys storage task. -
-
int service_storage_destroy_task(service_storage_task_h task)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - task: - The handle of storage task -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED - Failed in Plugin internal -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
-
-
-

Code example:

bool upload(service_plugin_h plugin)
-{
-    service_storage_task_h task = NULL;
-    const char *upload_path = "/my_file.png";
-    const char *upload_path = "/";
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_create_upload_task (plugin, upload_path, upload_path, task);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        ret = service_storage_start_task(task);
-
-        if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-        {
-            return true;
-        }
-        else
-        {
-            log_error("Cannot start task", ret);
-            service_storage_destroy_task(task);
-        }
-    }
-    else
-    {
-        log_error("Cannot create task", ret);
-    }
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_get_file_list -
-
-
- Gets file list from storage, asynchronously. -
-
int service_storage_get_file_list(service_plugin_h plugin, const char *dir_path, service_storage_file_list_cb callback, void *user_data)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - plugin : - The handle for use Plugin APIs -
  • -
  • - dir_path : - The dir path (Physical path) -
  • -
  • - callback : - The callback for getting file list -
  • -
  • - user_data : - The user data to be passed to the callback function -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED - Permission denied -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle's state is invalid -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED - Not supported API in this plugin -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- For the dir_path , "/" means root path. -
-
-

Code example:

void file_list_cb(int result, service_storage_file_list_h list, void *user_data)
-{
-    if(SERVICE_ADAPTOR_ERROR_NONE != result)
-    {
-        log_error("Cannot get file list", ret);
-        return;
-    }
-
-    process_files_list(list);
-}
-
-void process_directory(service_plugin_h plugin, const char *dir_path)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_get_file_list(plugin, dir_path, file_list_cb, NULL);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE != ret)
-    {
-        log_error("Cannot process direcory", ret);
-    }
-}
-
-                                
-
-
-
- -
-
- - service_storage_file_list_get_length -
-
-
- Gets length of the file list handle. -
-
int service_storage_file_list_get_length(service_storage_file_list_h list, int *length)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - list : - The file list handle -
  • -
  • - length : - The length of the file list handle -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Code example:

void file_list_cb(int result, service_storage_file_list_h list, void *user_data)
-{
-    if(SERVICE_ADAPTOR_ERROR_NONE != result)
-    {
-        log_error("Cannot get file list", ret);
-        return;
-    }
-
-    int length;
-
-    service_storage_file_list_get_length(list, &length);
-    if (length > 0)
-    {
-        process_files_list(list);
-    }
-    else
-    {
-        log_warrning("Empty file list");
-    }
-}
-                                
-
-
-
- -
-
- - service_storage_file_list_foreach_file -
-
-
- Foreach All of the file from file list. -
-
int service_storage_file_list_foreach_file(service_storage_file_list_h list, service_storage_file_cb callback, void *user_data)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - list : - The file list handle -
  • -
  • - callback : - The callback for foreach file -
  • -
  • - user_data : - Passed data to callback -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no file -
  • -
-
-
-

Code example:

bool storage_file_cb(service_storage_file_h file, void *user_data)
-{
-    bool isDir = false;
-    service_storage_file_is_dir(file, &isDir);
-    if (!isDir)
-    {
-        service_storage_file_h copy = NULL;
-        service_storage_file_clone(file, ©);
-        do_something(copy);
-        service_storage_file_destroy(copy);
-    }
-    return true;
-}
-
-void process_file_list(service_storage_file_list_h list)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_file_list_foreach_file(list, storage_file_cb, NULL);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE != ret)
-    {
-        log_error("Foreach operation failed", ret);
-    }
-}
-
-                                
-
-
-
- -
-
- - service_storage_file_list_clone -
-
-
- Clones the file list handle. -
-
int service_storage_file_list_clone(service_storage_file_list_h src_list, service_storage_file_list_h *dst_list)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - src_list : - The source handle -
  • -
  • - dst_list : - The destination handle -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Remarks

- file must be released memory using service_storage_file_list_destroy() when you no longer needs this handle -
-
-

Code example:

void file_list_cb(int result, service_storage_file_list_h list, void *user_data)
-{
-    if(SERVICE_ADAPTOR_ERROR_NONE != result)
-    {
-        log_error("Cannot get file list", ret);
-        return;
-    }
-
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    service_storage_file_list_h list_copy = NULL:
-
-    ret = service_storage_file_list_clone(list, &list_copy);
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        process_files(list);
-        process_files_second_iteration(list_copy);
-
-        service_storage_file_list_destroy(list_copy);
-    }
-}
-                                
-
-
-
- -
-
- - service_storage_file_list_destroy -
-
-
- Destroys the file list handle. -
-
int service_storage_file_list_destroy(service_storage_file_list_h list)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - list : - The file list handle -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Remarks

- It must be used for cloned file list handle -
-
-

Code example:

void file_list_cb(int result, service_storage_file_list_h list, void *user_data)
-{
-    if(SERVICE_ADAPTOR_ERROR_NONE != result)
-    {
-        log_error("Cannot get file list", ret);
-        return;
-    }
-
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    service_storage_file_list_h list_copy = NULL:
-
-    ret = service_storage_file_list_clone(list, &list_copy);
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        process_files(list);
-        process_files_second_iteration(list_copy);
-
-        service_storage_file_list_destroy(list_copy);
-    }
-}
-                                
-
-
-
- -
-
- - service_storage_file_clone -
-
-
- Clones the file handle. -
-
int service_storage_file_clone(service_storage_file_h src_file, service_storage_file_h *dst_file)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - src_file: - The source handle -
  • -
  • - dst_file: - The destination handle -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Remarks

- file must be released memory using service_storage_file_destroy() when you no longer needs this handle -
-
-

Code example:

bool storage_file_cb(service_storage_file_h file, void *user_data)
-{
-    bool isDir = false;
-    service_storage_file_is_dir(file, &isDir);
-    if (!isDir)
-    {
-        service_storage_file_h file_copy = NULL;
-        service_storage_file_clone(file, &file_copy);
-        do_something(file_copy);
-        service_storage_file_destroy(file_copy);
-    }
-    return true;
-}
-                                
-
-
-
- -
-
- - service_storage_file_get_logical_path -
-
-
- Gets logical path from file handle. -
-
int service_storage_file_get_logical_path(service_storage_file_h file, char **path)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - file: - The source handle -
  • -
  • - path: - The logical path of file -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no data -
  • -
-
-
-

Remarks

- path must be released with free() function -
-
-

Code example:

bool get_file_path(service_storage_file_h file, char **path)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    char *_path = NULL;
-
-    ret = service_storage_file_get_logical_path(file, &_path);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        *path = _path;
-        return true;
-    }
-    else
-    {
-        log_error("Cannot get logical path", ret);
-    }
-
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_file_get_physical_path -
-
-
- Gets physical path from file handle. -
-
int service_storage_file_get_physical_path(service_storage_file_h file, char **path)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - file: - The source handle -
  • -
  • - path: - The physical path of file -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_NO_DATA - There is no data -
  • -
-
-
-

Remarks

- path must be released with free() function -
-
-

Code example:

bool get_file_physical_path(service_storage_file_h file, char **path)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    char *_path = NULL;
-
-    ret = service_storage_file_get_physical_path(file, &_path);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        *path = _path;
-        return true;
-    }
-    else
-    {
-        log_error("Cannot get logical path", ret);
-    }
-
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_file_get_size -
-
-
- Gets size of a file. -
-
int service_storage_file_get_size(service_storage_file_h file, unsigned long long *size)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - file: - The source handle -
  • -
  • - size: - The size of file (byte) -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Code example:

bool get_file_size(service_storage_file_h file, unsigned long long **size)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-    unsigned long long _size = -1;
-
-    ret = service_storage_file_get_size(file, &_size);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE == ret)
-    {
-        *size = _size;
-        return true;
-    }
-    else
-    {
-        log_error("Cannot get file size", ret);
-    }
-
-    return false;
-}
-                                
-
-
-
- -
-
- - service_storage_file_is_dir -
-
-
- Gets information if file handle is directory or not. -
-
int service_storage_file_is_dir(service_storage_file_h file, bool *is_dir)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - file: - The source handle -
  • -
  • - is_dir: - true on directory, false on file -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Code example:

bool storage_file_cb(service_storage_file_h file, void *user_data)
-{
-    bool isDir = false;
-
-    service_storage_file_is_dir(file, &isDir);
-
-
-    if (!isDir)
-    {
-        do_some_file_operations(file);
-    }
-
-    return true;
-}
-                                
-
-
-
- -
-
- - service_storage_file_destroy -
-
-
- Clones the file handle. -
-
int service_storage_file_destroy(service_storage_file_h file)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - file: - The handle of file or directory in storage -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
-
-
-

Code example:

bool storage_file_cb(service_storage_file_h file, void *user_data)
-{
-    bool isDir = false;
-    service_storage_file_is_dir(file, &isDir);
-    if (!isDir)
-    {
-        service_storage_file_h file_copy = NULL;
-        service_storage_file_clone(file, &file_copy);
-        do_something(file_copy);
-        service_storage_file_destroy(file_copy);
-    }
-    return true;
-}
-                                
-
-
-
- -
-
- - service_storage_remove -
-
-
- Removes file or directory in storage. -
-
int service_storage_remove(service_plugin_h plugin, const char *remove_path, service_storage_result_cb callback, void *user_data)
-                                
-

- Since: - 2.4 -

-

- Privilege level: - Public -

-
-

Parameters:

-
    -
  • - plugin : - The handle for use Plugin APIs -
  • -
  • - remove_path : - The target file or directory for remove (Physical path) -
  • -
  • - callback : - The callback for getting file list -
  • -
  • - user_data : - The user data to be passed to the callback function -
  • -
-
-
-

Return value:

-
    -
  • - SERVICE_ADAPTOR_ERROR_NONE - Successful -
  • -
  • - SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED - Permission denied -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_STATE - The handle's state is invalid -
  • -
  • - SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER - Invalid parameter -
  • -
  • - SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE - IPC failed with Service Adaptor Daemon -
  • -
  • - SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED - Not supported API in this plugin -
  • -
  • - SERVICE_ADAPTOR_ERROR_UNKNOWN - Unknown error -
  • -
-
-
-

Remarks

- If the function returns SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED, error code and error message can be obtained using - service_adaptor_get_last_result() and service_adaptor_get_last_error_message() method.
- Error codes and messages are described in Service Plugin. -
-
-

Code example:

void file_list_cb(int result, service_storage_file_list_h list, void *user_data)
-{
-    if(SERVICE_ADAPTOR_ERROR_NONE != result)
-    {
-        log_error("Cannot get file list", ret);
-        return;
-    }
-
-    process_files_list(list);
-}
-
-void process_directory(service_plugin_h plugin, const char *dir_path)
-{
-    service_adaptor_error_e ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
-
-    ret = service_storage_get_file_list(plugin, dir_path, file_list_cb, NULL);
-
-    if (SERVICE_ADAPTOR_ERROR_NONE != ret)
-    {
-        log_error("Cannot process direcory", ret);
-    }
-}
-
-                                
-
-
-
-
-
-
- - -