From: Jihoon Jung Date: Wed, 27 Jan 2016 09:00:48 +0000 (+0900) Subject: Apply 3.0 ACR comment X-Git-Tag: submit/tizen/20160201.043003~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f73fb6610dd0d59fb0123ec41d8038f8e45fa81f;p=platform%2Fcore%2Fapi%2Fmtp.git Apply 3.0 ACR comment Signed-off-by: Jihoon Jung Change-Id: Ie7814420df1f6aacc1c34d5d9be6294a21f216c9 --- diff --git a/doc/mtp_doc.h b/doc/mtp_doc.h index 0e1f9c5..81ac6a7 100755 --- a/doc/mtp_doc.h +++ b/doc/mtp_doc.h @@ -163,7 +163,7 @@ * \#include * @section CAPI_NETWORK_MTP_OBJECTINFO_MODULE_OVERVIEW Overview * The MTP Object Information api provides following functions :\n - * - Get object format\n + * - Get object file type\n * - Get object name\n * - Get object size\n * - and, more object information\n diff --git a/include/mtp.h b/include/mtp.h index 3f7e2c7..4b5dc95 100755 --- a/include/mtp.h +++ b/include/mtp.h @@ -36,12 +36,6 @@ extern "C" { * @{ */ -/** - * @brief The handle to the mtp raw device - * @since_tizen 3.0 - */ -typedef struct mtp_raw_device *mtp_raw_device_h; - /** * @brief The handle to the mtp device * @since_tizen 3.0 @@ -68,23 +62,22 @@ typedef enum { MTP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ MTP_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */ MTP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ - MTP_ERROR_NO_DEVICE = TIZEN_ERROR_MTP | 0x01, /**< MTP have not any device */ MTP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ - MTP_ERROR_PLUGIN_FAIL = TIZEN_ERROR_MTP | 0x02, /**< Plugin failed */ MTP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ - MTP_ERROR_COMM_ERROR = TIZEN_ERROR_MTP | 0x03, /**< MTP communication error */ - MTP_ERROR_CONTROLLER = TIZEN_ERROR_MTP | 0x04, /**< MTP controller error */ - MTP_ERROR_NOT_INITIALIZED = TIZEN_ERROR_MTP | 0x05, /**< MTP is not initialized */ - MTP_ERROR_NOT_ACTIVATED = TIZEN_ERROR_MTP | 0x06, /**< MTP is not activated */ - MTP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< MTP is not supported */ - MTP_ERROR_NOT_COMM_INITIALIZED = TIZEN_ERROR_MTP | 0x07, /**< MTP communication is not initialized */ + MTP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */ + MTP_ERROR_COMM_ERROR = TIZEN_ERROR_MTP | 0x01, /**< MTP communication error */ + MTP_ERROR_CONTROLLER = TIZEN_ERROR_MTP | 0x02, /**< MTP controller error */ + MTP_ERROR_NO_DEVICE = TIZEN_ERROR_MTP | 0x03, /**< MTP have not any device */ + MTP_ERROR_NOT_INITIALIZED = TIZEN_ERROR_MTP | 0x04, /**< MTP is not initialized */ + MTP_ERROR_NOT_ACTIVATED = TIZEN_ERROR_MTP | 0x05, /**< MTP is not activated */ + MTP_ERROR_NOT_COMM_INITIALIZED = TIZEN_ERROR_MTP | 0x06, /**< MTP communication is not initialized */ + MTP_ERROR_PLUGIN_FAIL = TIZEN_ERROR_MTP | 0x07, /**< MTP Plugin failed */ } mtp_error_e; /** * @brief Enumerations for MTP Storage type * @since_tizen 3.0 */ - typedef enum { MTP_STORAGE_TYPE_UNDEFINED, /**< Storage type is undefined */ MTP_STORAGE_TYPE_FIXED_ROM, /**< Storage type is fixed ROM */ @@ -164,7 +157,7 @@ typedef enum { } mtp_event_e; /** - * @brief Called after mtp_set_mtp_event_cb() has completed. + * @brief Called when mtp event is occured. * @since_tizen 3.0 * @remarks Depending on the type of event, the meaning of event parameter is different. * - If event is device event, then event_parameter type is mtp_device_h. @@ -199,115 +192,10 @@ typedef void (* mtp_event_cb)(mtp_event_e event, int event_parameter, void *user int mtp_initialize(void); /** - * @brief Gets device list. - * @since_tizen 3.0 - * @remarks The @a raw_devices should be freed using mtp_destroy_raw_devices(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [out] raw_devices All current connected device list - * @param [out] device_count The count of device - * - * @return 0 on success, otherwise a negative error value. - * @retval #MTP_ERROR_NONE Successful - * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported - * @retval #MTP_ERROR_NOT_INITIALIZED MTP is not initialized - * @retval #MTP_ERROR_NOT_ACTIVATED MTP is not activated - * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized - * - * @see mtp_destroy_raw_devices() - */ -int mtp_get_raw_devices(mtp_raw_device_h **raw_devices, int *device_count); - -/** - * @brief Gets bus location from raw device. - * @since_tizen 3.0 - * @remarks The @a raw_device can get using mtp_get_raw_devices(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [in] raw_device The raw device - * @param [out] bus_location The bus location - * - * @return 0 on success, otherwise a negative error value. - * @retval #MTP_ERROR_NONE Successful - * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported - * @retval #MTP_ERROR_NOT_INITIALIZED MTP is not initialized - * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see mtp_get_raw_devices() - */ -int mtp_get_bus_location(mtp_raw_device_h raw_device, int *bus_location); - -/** - * @brief Gets device number from raw device. - * @since_tizen 3.0 - * @remarks The @a raw_device can get using mtp_get_raw_devices(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [in] raw_device The raw device - * @param [out] device_number The device number - * - * @return 0 on success, otherwise a negative error value. - * @retval #MTP_ERROR_NONE Successful - * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported - * @retval #MTP_ERROR_NOT_INITIALIZED MTP is not initialized - * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see mtp_get_raw_devices() - */ -int mtp_get_device_number(mtp_raw_device_h raw_device, int *device_number); - -/** - * @brief Gets device name from raw device. - * @since_tizen 3.0 - * @remarks The @a raw_device can get using mtp_get_raw_devices(). - * @remarks The @a model_name should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [in] raw_device The raw device - * @param [out] model_name The model name - * - * @return 0 on success, otherwise a negative error value. - * @retval #MTP_ERROR_NONE Successful - * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported - * @retval #MTP_ERROR_NOT_INITIALIZED MTP is not initialized - * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see mtp_get_raw_devices() - */ -int mtp_get_device_name(mtp_raw_device_h raw_device, char **model_name); - -/** - * @brief Destroys the raw devices handler. - * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [in] raw_devices The raw devices handler - * - * @return 0 on success, otherwise a negative error value. - * @retval #MTP_ERROR_NONE Successful - * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported - * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see mtp_get_raw_devices() - */ -int mtp_destroy_raw_devices(mtp_raw_device_h *raw_devices); - -/** - * @brief Gets device handler from bus location. + * @brief Gets the mtp devices. * @since_tizen 3.0 - * @remarks For using this api, you should get bus location and device number from raw device. - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * - * @param [in] bus_location The bus location - * @param [in] device_number The device number - * @param [out] mtp_device The MTP device + * @param [out] mtp_devices The MTP device list + * @param [out] device_count Length of device list * * @return 0 on success, otherwise a negative error value. * @retval #MTP_ERROR_NONE Successful @@ -318,21 +206,18 @@ int mtp_destroy_raw_devices(mtp_raw_device_h *raw_devices); * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized * @retval #MTP_ERROR_COMM_ERROR MTP communication error * - * @pre mtp_get_bus_location(), mtp_get_device_number() * @see mtp_initialize() */ -int mtp_get_device(int bus_location, int device_number, mtp_device_h *mtp_device); +int mtp_get_devices(mtp_device_h **mtp_devices, int *device_count); /** - * @brief Gets mtp storages from device. + * @brief Gets mtp storages from the given device. * @since_tizen 3.0 * @remarks The @a mtp_storages should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [out] mtp_storages Current mtp storage list - * @param [out] storage_num Length of storage list + * @param [out] storage_count Length of storage list * * @return 0 on success, otherwise a negative error value. * @retval #MTP_ERROR_NONE Successful @@ -343,24 +228,22 @@ int mtp_get_device(int bus_location, int device_number, mtp_device_h *mtp_device * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized * @retval #MTP_ERROR_COMM_ERROR MTP communication error * - * @see mtp_get_device() + * @see mtp_get_devices() */ -int mtp_get_storages(mtp_device_h mtp_device, mtp_storage_h **mtp_storages, int* storage_num); +int mtp_get_storages(mtp_device_h mtp_device, mtp_storage_h **mtp_storages, int* storage_count); /** * @brief Gets object handles from the given device and storage. * @since_tizen 3.0 * @remarks The @a object_handles should be freed using free(). * @remarks If the @a parent is 0, it means "root folder" of mtp storage. - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage * @param [in] file_type The file type what you want * @param [in] parent The parent object handle * @param [out] object_handles The object handle list - * @param [out] object_num Length of object handle list + * @param [out] object_count Length of object handle list * * @return 0 on success, otherwise a negative error value. * @retval #MTP_ERROR_NONE Successful @@ -371,15 +254,16 @@ int mtp_get_storages(mtp_device_h mtp_device, mtp_storage_h **mtp_storages, int* * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized * @retval #MTP_ERROR_COMM_ERROR MTP communication error * - * @see mtp_get_device() + * @see mtp_get_devices() * @see mtp_get_storages() */ int mtp_get_object_handles(mtp_device_h mtp_device, mtp_storage_h mtp_storage, mtp_filetype_e file_type, - mtp_object_h parent, mtp_object_h **object_handles, int* object_num); + mtp_object_h parent, mtp_object_h **object_handles, int* object_count); /** * @brief Gets object for a given path from object handle. * @since_tizen 3.0 + * @remarks The @a dest_path is host storage path. * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * @@ -396,15 +280,17 @@ int mtp_get_object_handles(mtp_device_h mtp_device, mtp_storage_h mtp_storage, m * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized * @retval #MTP_ERROR_COMM_ERROR MTP communication error * @retval #MTP_ERROR_IO_ERROR I/O error + * @retval #MTP_ERROR_PERMISSION_DENIED Permission denied * - * @see mtp_get_device() + * @see mtp_get_devices() * @see mtp_get_object_handles() */ int mtp_get_object(mtp_device_h mtp_device, mtp_object_h object_handle, char *dest_path); /** - * @brief Gets thumbnail from object handle. + * @brief Gets thumbnail from the given object handle. * @since_tizen 3.0 + * @remarks The @a dest_path is host storage path. * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. * @@ -421,22 +307,22 @@ int mtp_get_object(mtp_device_h mtp_device, mtp_object_h object_handle, char *de * @retval #MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized * @retval #MTP_ERROR_COMM_ERROR MTP communication error * @retval #MTP_ERROR_IO_ERROR I/O error + * @retval #MTP_ERROR_PERMISSION_DENIED Permission denied * - * @see mtp_get_device() + * @see mtp_get_devices() * @see mtp_get_object_handles() */ int mtp_get_thumbnail(mtp_device_h mtp_device, mtp_object_h object_handle, char *dest_path); /** - * @brief Registers a callback function for receiving MTP event. + * @brief Adds a callback function for receiving MTP event. * @since_tizen 3.0 - * + * @remarks You can register multiple callback. \n + * If you don't want to receive the event, then using the mtp_remove_mtp_event_cb() function to unregister a callback. * @remarks If device state is changed, #MTP_EVENT_DEVICE_ADDED or #MTP_EVENT_DEVICE_REMOVED event is occur. \n * If storage state is changed, #MTP_EVENT_STORAGE_ADDED or #MTP_EVENT_STORAGE_REMOVED event is occur. \n * If object state is changed, #MTP_EVENT_OBJECT_ADDED or #MTP_EVENT_OBJECT_REMOVED event is occur. \n * If mtp service is turned off, #MTP_EVENT_TURNED_OFF event is occur. \n - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] event_cb The callback * @param [in] user_data The user data @@ -446,16 +332,16 @@ int mtp_get_thumbnail(mtp_device_h mtp_device, mtp_object_h object_handle, char * @retval #MTP_ERROR_NOT_SUPPORTED MTP is not supported * @retval #MTP_ERROR_NOT_INITIALIZED MTP is not initialized * @retval #MTP_ERROR_INVALID_PARAMETER Invalid parameter - - * @see mtp_unset_mtp_event_cb() + * + * @see mtp_remove_mtp_event_cb() */ -int mtp_set_mtp_event_cb(mtp_event_cb event_cb, void *user_data); +int mtp_add_mtp_event_cb(mtp_event_cb event_cb, void *user_data); /** - * @brief Unregisters the callback function. + * @brief Removes the callback function. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n + * + * @param [in] event_cb The callback * * @return 0 on success, otherwise a negative error value. * @retval #MTP_ERROR_NONE Successful @@ -464,7 +350,7 @@ int mtp_set_mtp_event_cb(mtp_event_cb event_cb, void *user_data); * * @see mtp_set_mtp_event_cb() */ -int mtp_unset_mtp_event_cb(void); +int mtp_remove_mtp_event_cb(mtp_event_cb event_cb); /** * @brief Deinitializes MTP operation. @@ -494,8 +380,6 @@ int mtp_deinitialize(void); * @brief Gets the manufacturer name of the device information. * @since_tizen 3.0 * @remarks The @a manufacturer_name should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [out] manufacturer_name The manufacturer name of Device information @@ -512,7 +396,7 @@ int mtp_deinitialize(void); * @retval #MTP_ERROR_OUT_OF_MEMORY Memory Allocation failed * @retval #MTP_ERROR_NO_DEVICE MTP have not any device * - * @see mtp_get_device() + * @see mtp_get_devices() */ int mtp_deviceinfo_get_manufacturer_name(mtp_device_h mtp_device, char **manufacturer_name); @@ -520,8 +404,6 @@ int mtp_deviceinfo_get_manufacturer_name(mtp_device_h mtp_device, char **manufac * @brief Gets the model name of the device information. * @since_tizen 3.0 * @remarks The @a model_name should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [out] model_name The model name of Device information @@ -538,7 +420,7 @@ int mtp_deviceinfo_get_manufacturer_name(mtp_device_h mtp_device, char **manufac * @retval #MTP_ERROR_OUT_OF_MEMORY Out of memory * @retval #MTP_ERROR_NO_DEVICE MTP have not any device * - * @see mtp_get_device() + * @see mtp_get_devices() */ int mtp_deviceinfo_get_model_name(mtp_device_h mtp_device, char **model_name); @@ -546,8 +428,6 @@ int mtp_deviceinfo_get_model_name(mtp_device_h mtp_device, char **model_name); * @brief Gets the serial number of the device information. * @since_tizen 3.0 * @remarks The @a serial_number should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [out] serial_number The serial number of Device information @@ -564,7 +444,7 @@ int mtp_deviceinfo_get_model_name(mtp_device_h mtp_device, char **model_name); * @retval #MTP_ERROR_OUT_OF_MEMORY Out of memory * @retval #MTP_ERROR_NO_DEVICE MTP have not any device * - * @see mtp_get_device() + * @see mtp_get_devices() */ int mtp_deviceinfo_get_serial_number(mtp_device_h mtp_device, char **serial_number); @@ -572,8 +452,6 @@ int mtp_deviceinfo_get_serial_number(mtp_device_h mtp_device, char **serial_numb * @brief Gets the device version of the device information. * @since_tizen 3.0 * @remarks The @a device_version should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [out] device_version The device version of Device information @@ -590,7 +468,7 @@ int mtp_deviceinfo_get_serial_number(mtp_device_h mtp_device, char **serial_numb * @retval #MTP_ERROR_OUT_OF_MEMORY Out of memory * @retval #MTP_ERROR_NO_DEVICE MTP have not any device * - * @see mtp_get_device() + * @see mtp_get_devices() */ int mtp_deviceinfo_get_device_version(mtp_device_h mtp_device, char **device_version); @@ -607,8 +485,6 @@ int mtp_deviceinfo_get_device_version(mtp_device_h mtp_device, char **device_ver * @brief Gets the description of the storage information. * @since_tizen 3.0 * @remarks The @a description should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage @@ -633,8 +509,6 @@ int mtp_storageinfo_get_description(mtp_device_h mtp_device, mtp_storage_h mtp_s /** * @brief Gets the free space of the storage information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage @@ -659,8 +533,6 @@ int mtp_storageinfo_get_free_space(mtp_device_h mtp_device, mtp_storage_h mtp_st /** * @brief Gets the max capacity of the storage information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage @@ -685,8 +557,6 @@ int mtp_storageinfo_get_max_capacity(mtp_device_h mtp_device, mtp_storage_h mtp_ /** * @brief Gets the storage type of the storage information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage @@ -712,8 +582,6 @@ int mtp_storageinfo_get_storage_type(mtp_device_h mtp_device, mtp_storage_h mtp_ * @brief Gets the volume identifier of the storage information. * @since_tizen 3.0 * @remarks The @a volume_identifier should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] mtp_storage The MTP storage @@ -748,8 +616,6 @@ int mtp_storageinfo_get_volume_identifier(mtp_device_h mtp_device, mtp_storage_h * @brief Gets the filename of the object information. * @since_tizen 3.0 * @remarks The @a file_name should be freed using free(). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -777,8 +643,6 @@ int mtp_objectinfo_get_file_name(mtp_device_h mtp_device, mtp_object_h object_ha * @since_tizen 3.0 * @remarks The @a keywords should be freed using free(). * @remarks The keywords are separated by comma. - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -804,8 +668,6 @@ int mtp_objectinfo_get_keywords(mtp_device_h mtp_device, mtp_object_h object_han /** * @brief Gets the association desc of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -831,8 +693,6 @@ int mtp_objectinfo_get_association_desc(mtp_device_h mtp_device, mtp_object_h ob /** * @brief Gets the association type of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -858,8 +718,6 @@ int mtp_objectinfo_get_association_type(mtp_device_h mtp_device, mtp_object_h ob /** * @brief Gets the size of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -885,8 +743,6 @@ int mtp_objectinfo_get_size(mtp_device_h mtp_device, mtp_object_h object_handle, /** * @brief Gets the parent object handle of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -912,8 +768,6 @@ int mtp_objectinfo_get_parent_object_handle(mtp_device_h mtp_device, mtp_object_ /** * @brief Gets the mtp storage of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -941,8 +795,6 @@ int mtp_objectinfo_get_storage(mtp_device_h mtp_device, mtp_object_h object_hand * @since_tizen 3.0 * @remarks When interpreted as an absolute time value, \n * @a data_created represents the number of seconds elapsed since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -970,8 +822,6 @@ int mtp_objectinfo_get_date_created(mtp_device_h mtp_device, mtp_object_h object * @since_tizen 3.0 * @remarks When interpreted as an absolute time value, \n * @a data_modified represents the number of seconds elapsed since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -997,8 +847,6 @@ int mtp_objectinfo_get_date_modified(mtp_device_h mtp_device, mtp_object_h objec /** * @brief Gets the file type of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1024,8 +872,6 @@ int mtp_objectinfo_get_file_type(mtp_device_h mtp_device, mtp_object_h object_ha /** * @brief Gets the image bit depth of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1051,8 +897,6 @@ int mtp_objectinfo_get_image_bit_depth(mtp_device_h mtp_device, mtp_object_h obj /** * @brief Gets the image pixel width of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1078,8 +922,6 @@ int mtp_objectinfo_get_image_pix_width(mtp_device_h mtp_device, mtp_object_h obj /** * @brief Gets the image pixel height of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1105,8 +947,6 @@ int mtp_objectinfo_get_image_pix_height(mtp_device_h mtp_device, mtp_object_h ob /** * @brief Gets the thumbnail size of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1132,8 +972,6 @@ int mtp_objectinfo_get_thumbnail_size(mtp_device_h mtp_device, mtp_object_h obje /** * @brief Gets the thumbnail file type of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1159,8 +997,6 @@ int mtp_objectinfo_get_thumbnail_file_type(mtp_device_h mtp_device, mtp_object_h /** * @brief Gets the thumbnail pixel height of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle @@ -1186,8 +1022,6 @@ int mtp_objectinfo_get_thumbnail_pix_height(mtp_device_h mtp_device, mtp_object_ /** * @brief Gets the thumbnail pixel width of the object information. * @since_tizen 3.0 - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.\n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * * @param [in] mtp_device The MTP device * @param [in] object_handle The object handle diff --git a/include/mtp_gdbus_deviceinfo.h b/include/mtp_gdbus_deviceinfo.h index 69f2c92..d3fa84d 100755 --- a/include/mtp_gdbus_deviceinfo.h +++ b/include/mtp_gdbus_deviceinfo.h @@ -22,9 +22,11 @@ void mtp_gdbus_deviceinfo_proxy_init(void); void mtp_gdbus_deviceinfo_proxy_deinit(void); -mtp_error_e mtp_gdbus_deviceinfo_get_manufacturername(int mtp_handle, char **manufacturername); -mtp_error_e mtp_gdbus_deviceinfo_get_modelname(int mtp_handle, char **modelname); -mtp_error_e mtp_gdbus_deviceinfo_get_serialnumber(int mtp_handle, char **serialnumber); -mtp_error_e mtp_gdbus_deviceinfo_get_deviceversion(int mtp_handle, char **deviceversion); +mtp_error_e mtp_gdbus_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturername); +mtp_error_e mtp_gdbus_deviceinfo_get_model_name(int mtp_device, char **modelname); +mtp_error_e mtp_gdbus_deviceinfo_get_serial_number(int mtp_device, char **serialnumber); +mtp_error_e mtp_gdbus_deviceinfo_get_device_version(int mtp_device, char **deviceversion); +mtp_error_e mtp_gdbus_deviceinfo_get_bus_location(int mtp_device, int *bus_location); +mtp_error_e mtp_gdbus_deviceinfo_get_device_number(int mtp_device, int *device_number); #endif diff --git a/include/mtp_gdbus_manager.h b/include/mtp_gdbus_manager.h index ea2eaf4..70e4cbf 100755 --- a/include/mtp_gdbus_manager.h +++ b/include/mtp_gdbus_manager.h @@ -20,9 +20,7 @@ #include "mtp_gdbus.h" mtp_error_e mtp_gdbus_manager_initialize(void); -mtp_error_e mtp_gdbus_manager_get_raw_devices(mtp_raw_device ***raw_devices, int *device_count); -mtp_error_e mtp_gdbus_manager_get_device(int bus_location, int device_number, - int *mtp_device); +mtp_error_e mtp_gdbus_manager_get_devices(int **mtp_devices, int *device_num); mtp_error_e mtp_gdbus_manager_get_storages(int mtp_device, int **mtp_storages, int *storage_num); mtp_error_e mtp_gdbus_manager_get_object_handles(int mtp_device, @@ -32,8 +30,9 @@ mtp_error_e mtp_gdbus_manager_get_object(int mtp_device, int object_handle, char *dest_path); mtp_error_e mtp_gdbus_manager_get_thumbnail(int mtp_device, int object_handle, char *dest_path); -mtp_error_e mtp_gdbus_manager_set_event_cb(mtp_event_cb callback, void *user_data); -mtp_error_e mtp_gdbus_manager_unset_event_cb(); +mtp_error_e mtp_gdbus_manager_add_event_cb(mtp_event_cb callback, void *user_data); +mtp_error_e mtp_gdbus_manager_remove_event_cb(mtp_event_cb callback); +mtp_error_e mtp_gdbus_manager_remove_all_event_cb(void); mtp_error_e mtp_gdbus_manager_deinitialize(void); #endif diff --git a/include/mtp_gdbus_storageinfo.h b/include/mtp_gdbus_storageinfo.h index f335e1f..d975ca8 100755 --- a/include/mtp_gdbus_storageinfo.h +++ b/include/mtp_gdbus_storageinfo.h @@ -24,13 +24,13 @@ void mtp_gdbus_storageinfo_proxy_deinit(void); mtp_error_e mtp_gdbus_storageinfo_get_description(int mtp_device, int mtp_storage, char **description); -mtp_error_e mtp_gdbus_storageinfo_get_freespace(int mtp_device, - int mtp_storage, guint64 *freespace); -mtp_error_e mtp_gdbus_storageinfo_get_maxcapacity(int mtp_device, - int mtp_storage, guint64 *maxcapacity); -mtp_error_e mtp_gdbus_storageinfo_get_storagetype(int mtp_device, - int mtp_storage, int *storagetype); -mtp_error_e mtp_gdbus_storageinfo_get_volumeidentifier(int mtp_device, - int mtp_storage, char **volumeidentifier); +mtp_error_e mtp_gdbus_storageinfo_get_free_space(int mtp_device, + int mtp_storage, guint64 *free_space); +mtp_error_e mtp_gdbus_storageinfo_get_max_capacity(int mtp_device, + int mtp_storage, guint64 *max_capacity); +mtp_error_e mtp_gdbus_storageinfo_get_storage_type(int mtp_device, + int mtp_storage, int *storage_type); +mtp_error_e mtp_gdbus_storageinfo_get_volume_identifier(int mtp_device, + int mtp_storage, char **volume_identifier); #endif diff --git a/include/mtp_internal.h b/include/mtp_internal.h index 71a0d1d..655513b 100755 --- a/include/mtp_internal.h +++ b/include/mtp_internal.h @@ -50,8 +50,9 @@ typedef struct _mtp_object_info { /* internal api */ int mtp_objectinfo_get_object_info(int mtp_device, int object_handle, mtp_object_info **object_info); - int mtp_delete_object(mtp_device_h mtp_device, mtp_object_h object_handle); +int mtp_deviceinfo_get_bus_location(mtp_device_h mtp_device, int *bus_locaton); +int mtp_deviceinfo_get_device_number(mtp_device_h mtp_device, int *device_number); #ifdef __cplusplus } diff --git a/include/mtp_private.h b/include/mtp_private.h index db7e651..c4e2569 100755 --- a/include/mtp_private.h +++ b/include/mtp_private.h @@ -17,13 +17,6 @@ #ifndef __MTP_PRIVATE_H__ #define __MTP_PRIVATE_H__ -typedef struct _mtp_raw_device { - int bus_location; - int device_number; - char *model_name; - int dev_count; -} mtp_raw_device; - #define CHECK_SUPPORTED() \ do { \ { \ @@ -48,14 +41,14 @@ typedef enum { MTP_PROPERTY_SIZE, MTP_PROPERTY_DATE_CREATED, MTP_PROPERTY_DATE_MODIFIED, - MTP_PROPERTY_FORMAT, + MTP_PROPERTY_FILE_TYPE, MTP_PROPERTY_IMAGE_BIT_DEPTH, MTP_PROPERTY_IMAGE_PIX_WIDTH, MTP_PROPERTY_IMAGE_PIX_HEIGHT, MTP_PROPERTY_PARENT_OBJECT_HANDLE, MTP_PROPERTY_STORAGE, MTP_PROPERTY_THUMBNAIL_SIZE, - MTP_PROPERTY_THUMBNAIL_FORMAT, + MTP_PROPERTY_THUMBNAIL_FILE_TYPE, MTP_PROPERTY_THUMBNAIL_WIDTH, MTP_PROPERTY_THUMBNAIL_HEIGHT, MTP_PROPERTY_FILENAME, diff --git a/src/mtp.c b/src/mtp.c index 2801220..e1bd189 100755 --- a/src/mtp.c +++ b/src/mtp.c @@ -70,7 +70,7 @@ static bool __is_mtp_activated() return true; } -/* Device Manager */ +/* Manager */ int mtp_initialize(void) { int ret = MTP_ERROR_NONE; @@ -99,7 +99,7 @@ int mtp_initialize(void) return ret; } -int mtp_get_raw_devices(mtp_raw_device_h **raw_devices, int *device_count) +int mtp_get_devices(int **mtp_devices, int *device_count) { int ret = MTP_ERROR_NONE; @@ -110,141 +110,21 @@ int mtp_get_raw_devices(mtp_raw_device_h **raw_devices, int *device_count) CHECK_SUPPORTED(); CHECK_INIT(); CHECK_ACTIVATED(); + cond_expr_ret(mtp_devices == NULL, MTP_ERROR_INVALID_PARAMETER); cond_expr_ret(device_count == NULL, MTP_ERROR_INVALID_PARAMETER); /* precondition check end */ - *device_count = 0; - ret = mtp_gdbus_manager_get_raw_devices((mtp_raw_device ***)raw_devices, device_count); + ret = mtp_gdbus_manager_get_devices(mtp_devices, device_count); - _END(); - - return ret; -} - -int mtp_get_bus_location(mtp_raw_device_h raw_device, int *bus_location) -{ - int ret = MTP_ERROR_NONE; - - _BEGIN(); - - /* precondition check start */ - - CHECK_SUPPORTED(); - CHECK_INIT(); - cond_expr_ret(raw_device == NULL, MTP_ERROR_INVALID_PARAMETER); - cond_expr_ret(bus_location == NULL, MTP_ERROR_INVALID_PARAMETER); - - /* precondition check end */ - - *bus_location = ((mtp_raw_device *)raw_device)->bus_location; + TC_PRT("device count %d", *device_count); _END(); return ret; } -int mtp_get_device_number(mtp_raw_device_h raw_device, int *device_number) -{ - int ret = MTP_ERROR_NONE; - - _BEGIN(); - - /* precondition check start */ - - CHECK_SUPPORTED(); - CHECK_INIT(); - cond_expr_ret(raw_device == NULL, MTP_ERROR_INVALID_PARAMETER); - cond_expr_ret(device_number == NULL, MTP_ERROR_INVALID_PARAMETER); - - /* precondition check end */ - - *device_number = ((mtp_raw_device *)raw_device)->device_number; - - _END(); - - return ret; -} - -int mtp_get_device_name(mtp_raw_device_h raw_device, char **model_name) -{ - int ret = MTP_ERROR_NONE; - - /* precondition check start */ - - CHECK_SUPPORTED(); - CHECK_INIT(); - cond_expr_ret(raw_device == NULL, MTP_ERROR_INVALID_PARAMETER); - cond_expr_ret(model_name == NULL, MTP_ERROR_INVALID_PARAMETER); - - /* precondition check end */ - - *model_name = g_strdup(((mtp_raw_device *)raw_device)->model_name); - - return ret; -} - -int mtp_destroy_raw_devices(mtp_raw_device_h *raw_devices) -{ - int i; - int ret = MTP_ERROR_NONE; - int dev_count; - mtp_raw_device *first_device = (mtp_raw_device *)raw_devices[0]; - - _BEGIN(); - - /* precondition check start */ - - CHECK_SUPPORTED(); - cond_expr_ret(raw_devices == NULL, MTP_ERROR_INVALID_PARAMETER); - cond_expr_ret(first_device == NULL, MTP_ERROR_INVALID_PARAMETER); - - /* precondition check end */ - dev_count = first_device->dev_count; - if (dev_count <= 0 || dev_count > 6) - return MTP_ERROR_INVALID_PARAMETER; - - for (i = 0; i < dev_count; i++) { - mtp_raw_device *r_device = (mtp_raw_device *)raw_devices[i]; - - if (r_device != NULL && r_device->model_name != NULL) { - free(r_device->model_name); - free(r_device); - } - } - - free(raw_devices); - - _END(); - - return ret; -} - -int mtp_get_device(int bus_location, int device_number, int *mtp_device) -{ - int ret = MTP_ERROR_NONE; - - _BEGIN(); - - /* precondition check start */ - - CHECK_SUPPORTED(); - CHECK_INIT(); - CHECK_ACTIVATED(); - cond_expr_ret(bus_location == 0, MTP_ERROR_INVALID_PARAMETER); - - /* precondition check end */ - - ret = mtp_gdbus_manager_get_device(bus_location, device_number, mtp_device); - - TC_PRT("mtp_device %d", *mtp_device); - - _END(); - - return ret; -} - -int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_num) +int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_count) { int ret = MTP_ERROR_NONE; @@ -256,12 +136,14 @@ int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_num) CHECK_INIT(); CHECK_ACTIVATED(); cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(mtp_storages == NULL, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(storage_count == NULL, MTP_ERROR_INVALID_PARAMETER); /* precondition check end */ - ret = mtp_gdbus_manager_get_storages(mtp_device, mtp_storages, storage_num); + ret = mtp_gdbus_manager_get_storages(mtp_device, mtp_storages, storage_count); - TC_PRT("storage number %d", *storage_num); + TC_PRT("storage count %d", *storage_count); _END(); @@ -269,7 +151,7 @@ int mtp_get_storages(int mtp_device, int **mtp_storages, int* storage_num) } int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_type, - int parent, int **object_handles, int* object_num) + int parent, int **object_handles, int* object_count) { int ret = MTP_ERROR_NONE; @@ -282,11 +164,13 @@ int mtp_get_object_handles(int mtp_device, int mtp_storage, mtp_filetype_e file_ CHECK_ACTIVATED(); cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER); cond_expr_ret(mtp_storage == 0, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(object_handles == NULL, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(object_count == NULL, MTP_ERROR_INVALID_PARAMETER); /* precondition check end */ ret = mtp_gdbus_manager_get_object_handles(mtp_device, - mtp_storage, file_type, parent, object_handles, object_num); + mtp_storage, file_type, parent, object_handles, object_count); _END(); @@ -362,7 +246,7 @@ int mtp_get_thumbnail(int mtp_device, int object_handle, char *dest_path) return ret; } -int mtp_set_mtp_event_cb(mtp_event_cb callback, void *user_data) +int mtp_add_mtp_event_cb(mtp_event_cb callback, void *user_data) { int ret = MTP_ERROR_NONE; @@ -376,14 +260,14 @@ int mtp_set_mtp_event_cb(mtp_event_cb callback, void *user_data) /* precondition check end */ - ret = mtp_gdbus_manager_set_event_cb(callback, user_data); + ret = mtp_gdbus_manager_add_event_cb(callback, user_data); _END(); return ret; } -int mtp_unset_mtp_event_cb(void) +int mtp_remove_mtp_event_cb(mtp_event_cb callback) { int ret = MTP_ERROR_NONE; @@ -396,7 +280,7 @@ int mtp_unset_mtp_event_cb(void) /* precondition check end */ - ret = mtp_gdbus_manager_unset_event_cb(); + ret = mtp_gdbus_manager_remove_event_cb(callback); _END(); @@ -449,7 +333,7 @@ int mtp_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_nam /* precondition check end */ - ret = mtp_gdbus_deviceinfo_get_manufacturername(mtp_device, manufacturer_name); + ret = mtp_gdbus_deviceinfo_get_manufacturer_name(mtp_device, manufacturer_name); TC_PRT("manufacturername %s", *manufacturer_name); @@ -473,7 +357,7 @@ int mtp_deviceinfo_get_model_name(int mtp_device, char **model_name) /* precondition check end */ - ret = mtp_gdbus_deviceinfo_get_modelname(mtp_device, model_name); + ret = mtp_gdbus_deviceinfo_get_model_name(mtp_device, model_name); TC_PRT("modelname %s", *model_name); @@ -497,9 +381,9 @@ int mtp_deviceinfo_get_serial_number(int mtp_device, char **serial_number) /* precondition check end */ - ret = mtp_gdbus_deviceinfo_get_serialnumber(mtp_device, serial_number); + ret = mtp_gdbus_deviceinfo_get_serial_number(mtp_device, serial_number); - TC_PRT("serialnumber %s", *serial_number); + TC_PRT("serial number %s", *serial_number); _END(); @@ -521,9 +405,59 @@ int mtp_deviceinfo_get_device_version(int mtp_device, char **device_version) /* precondition check end */ - ret = mtp_gdbus_deviceinfo_get_deviceversion(mtp_device, device_version); + ret = mtp_gdbus_deviceinfo_get_device_version(mtp_device, device_version); + + TC_PRT("device version %s", *device_version); + + _END(); + + return ret; +} + +int mtp_deviceinfo_get_bus_location(int mtp_device, int *bus_location) +{ + int ret = MTP_ERROR_NONE; + + _BEGIN(); + + /* precondition check start */ + + CHECK_SUPPORTED(); + CHECK_INIT(); + CHECK_ACTIVATED(); + cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(bus_location == NULL, MTP_ERROR_INVALID_PARAMETER); + + /* precondition check end */ + + ret = mtp_gdbus_deviceinfo_get_bus_location(mtp_device, bus_location); + + TC_PRT("bus location %d", *bus_location); + + _END(); + + return ret; +} + +int mtp_deviceinfo_get_device_number(int mtp_device, int *device_number) +{ + int ret = MTP_ERROR_NONE; + + _BEGIN(); + + /* precondition check start */ + + CHECK_SUPPORTED(); + CHECK_INIT(); + CHECK_ACTIVATED(); + cond_expr_ret(mtp_device == 0, MTP_ERROR_INVALID_PARAMETER); + cond_expr_ret(device_number == NULL, MTP_ERROR_INVALID_PARAMETER); + + /* precondition check end */ + + ret = mtp_gdbus_deviceinfo_get_device_number(mtp_device, device_number); - TC_PRT("deviceversion %s", *device_version); + TC_PRT("device number %d", *device_number); _END(); @@ -572,7 +506,7 @@ int mtp_storageinfo_get_free_space(int mtp_device, int mtp_storage, unsigned lon /* precondition check end */ - ret = mtp_gdbus_storageinfo_get_freespace(mtp_device, mtp_storage, (guint64 *)free_space); + ret = mtp_gdbus_storageinfo_get_free_space(mtp_device, mtp_storage, (guint64 *)free_space); TC_PRT("freespace %llu", *free_space); @@ -597,7 +531,7 @@ int mtp_storageinfo_get_max_capacity(int mtp_device, int mtp_storage, unsigned l /* precondition check end */ - ret = mtp_gdbus_storageinfo_get_maxcapacity(mtp_device, mtp_storage, (guint64 *)max_capacity); + ret = mtp_gdbus_storageinfo_get_max_capacity(mtp_device, mtp_storage, (guint64 *)max_capacity); TC_PRT("maxcapacity %llu", *max_capacity); @@ -622,7 +556,7 @@ int mtp_storageinfo_get_storage_type(int mtp_device, int mtp_storage, mtp_storag /* precondition check end */ - ret = mtp_gdbus_storageinfo_get_storagetype(mtp_device, mtp_storage, (int *)storage_type); + ret = mtp_gdbus_storageinfo_get_storage_type(mtp_device, mtp_storage, (int *)storage_type); TC_PRT("storagetype %d", *storage_type); @@ -647,7 +581,7 @@ int mtp_storageinfo_get_volume_identifier(int mtp_device, int mtp_storage, char /* precondition check end */ - ret = mtp_gdbus_storageinfo_get_volumeidentifier(mtp_device, mtp_storage, volume_identifier); + ret = mtp_gdbus_storageinfo_get_volume_identifier(mtp_device, mtp_storage, volume_identifier); TC_PRT("volumeidentifier %s", *volume_identifier); @@ -842,7 +776,7 @@ int mtp_objectinfo_get_file_type(int mtp_device, int object_handle, mtp_filetype /* precondition check end */ ret = mtp_gdbus_objectinfo_get_property(mtp_device, - object_handle, MTP_PROPERTY_FORMAT, (int*)file_type); + object_handle, MTP_PROPERTY_FILE_TYPE, (int*)file_type); _END(); @@ -962,7 +896,7 @@ int mtp_objectinfo_get_thumbnail_file_type(int mtp_device, /* precondition check end */ ret = mtp_gdbus_objectinfo_get_property(mtp_device, - object_handle, MTP_PROPERTY_THUMBNAIL_FORMAT, (int*)file_type); + object_handle, MTP_PROPERTY_THUMBNAIL_FILE_TYPE, (int*)file_type); _END(); diff --git a/src/mtp_gdbus_deviceinfo.c b/src/mtp_gdbus_deviceinfo.c index f6e0da4..8f16d56 100755 --- a/src/mtp_gdbus_deviceinfo.c +++ b/src/mtp_gdbus_deviceinfo.c @@ -34,7 +34,7 @@ void mtp_gdbus_deviceinfo_proxy_deinit(void) deviceinfo_proxy = NULL; } -mtp_error_e mtp_gdbus_deviceinfo_get_manufacturername(int mtp_device, char **manufacturername) +mtp_error_e mtp_gdbus_deviceinfo_get_manufacturer_name(int mtp_device, char **manufacturer_name) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -42,10 +42,10 @@ mtp_error_e mtp_gdbus_deviceinfo_get_manufacturername(int mtp_device, char **man if (deviceinfo_proxy == NULL) return MTP_ERROR_NOT_COMM_INITIALIZED; - if (mtp_gdbuslib_deviceinfo_call_get_manufacturername_sync( + if (mtp_gdbuslib_deviceinfo_call_get_manufacturer_name_sync( deviceinfo_proxy, mtp_device, - manufacturername, + manufacturer_name, &result, NULL, &error) == FALSE) { @@ -56,7 +56,7 @@ mtp_error_e mtp_gdbus_deviceinfo_get_manufacturername(int mtp_device, char **man return result; } -mtp_error_e mtp_gdbus_deviceinfo_get_modelname(int mtp_device, char **modelname) +mtp_error_e mtp_gdbus_deviceinfo_get_model_name(int mtp_device, char **model_name) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -64,10 +64,10 @@ mtp_error_e mtp_gdbus_deviceinfo_get_modelname(int mtp_device, char **modelname) if (deviceinfo_proxy == NULL) return MTP_ERROR_NOT_COMM_INITIALIZED; - if (mtp_gdbuslib_deviceinfo_call_get_modelname_sync( + if (mtp_gdbuslib_deviceinfo_call_get_model_name_sync( deviceinfo_proxy, mtp_device, - modelname, + model_name, &result, NULL, &error) == FALSE) { @@ -78,7 +78,7 @@ mtp_error_e mtp_gdbus_deviceinfo_get_modelname(int mtp_device, char **modelname) return result; } -mtp_error_e mtp_gdbus_deviceinfo_get_serialnumber(int mtp_device, char **serialnumber) +mtp_error_e mtp_gdbus_deviceinfo_get_serial_number(int mtp_device, char **serial_number) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -86,10 +86,10 @@ mtp_error_e mtp_gdbus_deviceinfo_get_serialnumber(int mtp_device, char **serialn if (deviceinfo_proxy == NULL) return MTP_ERROR_NOT_COMM_INITIALIZED; - if (mtp_gdbuslib_deviceinfo_call_get_serialnumber_sync( + if (mtp_gdbuslib_deviceinfo_call_get_serial_number_sync( deviceinfo_proxy, mtp_device, - serialnumber, + serial_number, &result, NULL, &error) == FALSE) { @@ -100,7 +100,7 @@ mtp_error_e mtp_gdbus_deviceinfo_get_serialnumber(int mtp_device, char **serialn return result; } -mtp_error_e mtp_gdbus_deviceinfo_get_deviceversion(int mtp_device, char **deviceversion) +mtp_error_e mtp_gdbus_deviceinfo_get_device_version(int mtp_device, char **device_version) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -108,10 +108,54 @@ mtp_error_e mtp_gdbus_deviceinfo_get_deviceversion(int mtp_device, char **device if (deviceinfo_proxy == NULL) return MTP_ERROR_NOT_COMM_INITIALIZED; - if (mtp_gdbuslib_deviceinfo_call_get_deviceversion_sync( + if (mtp_gdbuslib_deviceinfo_call_get_device_version_sync( deviceinfo_proxy, mtp_device, - deviceversion, + device_version, + &result, + NULL, + &error) == FALSE) { + result = MTP_ERROR_COMM_ERROR; + g_error_free(error); + } + + return result; +} + +mtp_error_e mtp_gdbus_deviceinfo_get_bus_location(int mtp_device, int *bus_location) +{ + mtp_error_e result = MTP_ERROR_NONE; + GError *error = NULL; + + if (deviceinfo_proxy == NULL) + return MTP_ERROR_NOT_COMM_INITIALIZED; + + if (mtp_gdbuslib_deviceinfo_call_get_bus_location_sync( + deviceinfo_proxy, + mtp_device, + bus_location, + &result, + NULL, + &error) == FALSE) { + result = MTP_ERROR_COMM_ERROR; + g_error_free(error); + } + + return result; +} + +mtp_error_e mtp_gdbus_deviceinfo_get_device_number(int mtp_device, int *device_number) +{ + mtp_error_e result = MTP_ERROR_NONE; + GError *error = NULL; + + if (deviceinfo_proxy == NULL) + return MTP_ERROR_NOT_COMM_INITIALIZED; + + if (mtp_gdbuslib_deviceinfo_call_get_device_number_sync( + deviceinfo_proxy, + mtp_device, + device_number, &result, NULL, &error) == FALSE) { diff --git a/src/mtp_gdbus_manager.c b/src/mtp_gdbus_manager.c index 63be494..447e430 100755 --- a/src/mtp_gdbus_manager.c +++ b/src/mtp_gdbus_manager.c @@ -25,15 +25,25 @@ #include "mtp_gdbus_deviceinfo.h" #include "mtp_gdbus_storageinfo.h" +typedef struct _event_cb_s { + mtp_event_cb cb; + void *user_data; +} event_cb_s; + mtpgdbuslibManager *manager_proxy = NULL; -mtp_event_cb event_callback; -void *event_user_data; +static __thread GSList *event_cb_list = NULL; static void __mtp_event_cb(mtpgdbuslibManager *object, gint event, gint arg1, gpointer user_data) { - if (event_callback) - event_callback(event, arg1, event_user_data); + GSList *l; + event_cb_s *event_s; + + for (l = event_cb_list; l != NULL; l = l->next) + { + event_s = (event_cb_s *)l->data; + event_s->cb(event, arg1, event_s->user_data); + } } static void __manager_proxy_init(void) @@ -56,18 +66,33 @@ static void __manager_proxy_deinit(void) manager_proxy = NULL; } -mtp_error_e mtp_gdbus_manager_set_event_cb(mtp_event_cb callback, void *user_data) +mtp_error_e mtp_gdbus_manager_add_event_cb(mtp_event_cb callback, void *user_data) { - event_callback = callback; - event_user_data = user_data; + event_cb_s *event_s; + + event_s = g_try_new0(event_cb_s, 1); + if (event_s == NULL) + return MTP_ERROR_OUT_OF_MEMORY; + + event_s->cb = callback; + event_s->user_data = user_data; + + event_cb_list = g_slist_prepend(event_cb_list, event_s); return MTP_ERROR_NONE; } -mtp_error_e mtp_gdbus_manager_unset_event_cb(void) +mtp_error_e mtp_gdbus_manager_remove_event_cb(mtp_event_cb callback) { - event_callback = NULL; - event_user_data = NULL; + GSList *l; + event_cb_s *event_s; + + for (l = event_cb_list; l != NULL; l = l->next) + { + event_s = (event_cb_s *)l->data; + if (callback == event_s->cb) + event_cb_list = g_slist_delete_link (event_cb_list, l); + } return MTP_ERROR_NONE; } @@ -87,19 +112,18 @@ mtp_error_e mtp_gdbus_manager_initialize(void) return result; } -mtp_error_e mtp_gdbus_manager_get_raw_devices(mtp_raw_device ***raw_devices, int *device_count) +mtp_error_e mtp_gdbus_manager_get_devices(int **mtp_devices, int *device_num) { - int dev_count; GVariant *va = NULL; mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; if (manager_proxy == NULL) - return MTP_ERROR_NOT_COMM_INITIALIZED; + return MTP_ERROR_NOT_COMM_INITIALIZED; - if (mtp_gdbuslib_manager_call_get_raw_devices_sync( + if (mtp_gdbuslib_manager_call_get_devices_sync( manager_proxy, - &dev_count, + device_num, &va, &result, NULL, @@ -110,36 +134,24 @@ mtp_error_e mtp_gdbus_manager_get_raw_devices(mtp_raw_device ***raw_devices, int return result; } - *device_count = dev_count; - - if (dev_count != 0 && (g_variant_n_children(va) == dev_count)) { + if (*device_num != 0 && (g_variant_n_children(va) == *device_num)) { GVariantIter *iter = NULL, *iter_row = NULL; GVariant *key_value; const gchar *key; guint i = 0; - *raw_devices = (mtp_raw_device **)malloc(sizeof(mtp_raw_device*) * 1); - **raw_devices = (mtp_raw_device *)malloc(sizeof(mtp_raw_device) * *device_count); + *mtp_devices = g_new(int, *device_num); g_variant_get(va, "aa{sv}", &iter); while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { while (g_variant_iter_loop(iter_row, "{sv}", &key, &key_value)) { - if (g_strcmp0(key, "model_name") == 0) { - (**raw_devices)[i].model_name = - g_strdup(g_variant_get_string(key_value, NULL)); - } else if (g_strcmp0(key, "bus_location") == 0) { - (**raw_devices)[i].bus_location = g_variant_get_int32(key_value); - } else if (g_strcmp0(key, "device_number") == 0) { - (**raw_devices)[i].device_number = g_variant_get_int32(key_value); - } + if (g_strcmp0(key, "mtp_device") == 0) + (*mtp_devices)[i] = g_variant_get_int32(key_value); } - (**raw_devices)[i].dev_count = dev_count; i++; g_variant_iter_free(iter_row); } g_variant_iter_free(iter); - } else { - result = MTP_ERROR_NO_DEVICE; } g_variant_unref(va); @@ -147,30 +159,6 @@ mtp_error_e mtp_gdbus_manager_get_raw_devices(mtp_raw_device ***raw_devices, int return result; } -mtp_error_e mtp_gdbus_manager_get_device(int bus_location, int device_number, int *mtp_device) -{ - mtp_error_e result = MTP_ERROR_NONE; - GError *error = NULL; - - if (manager_proxy == NULL) - return MTP_ERROR_NOT_COMM_INITIALIZED; - - if (mtp_gdbuslib_manager_call_get_device_sync( - manager_proxy, - bus_location, - device_number, - mtp_device, - &result, - NULL, - &error) == FALSE) { - result = MTP_ERROR_COMM_ERROR; - - g_error_free(error); - } - - return result; -} - mtp_error_e mtp_gdbus_manager_get_storages(int mtp_device, int **mtp_storages, int *storage_num) { @@ -221,7 +209,7 @@ mtp_error_e mtp_gdbus_manager_get_storages(int mtp_device, } mtp_error_e mtp_gdbus_manager_get_object_handles(int mtp_device, - int mtp_storage, int format, int parent_object_handle, int **object_handles, int *object_num) + int mtp_storage, int file_type, int parent_object_handle, int **object_handles, int *object_num) { GVariant *va = NULL; mtp_error_e result = MTP_ERROR_NONE; @@ -234,7 +222,7 @@ mtp_error_e mtp_gdbus_manager_get_object_handles(int mtp_device, manager_proxy, mtp_device, mtp_storage, - format, + file_type, parent_object_handle, object_num, &va, diff --git a/src/mtp_gdbus_storageinfo.c b/src/mtp_gdbus_storageinfo.c index db5f020..2698bb2 100755 --- a/src/mtp_gdbus_storageinfo.c +++ b/src/mtp_gdbus_storageinfo.c @@ -58,8 +58,8 @@ mtp_error_e mtp_gdbus_storageinfo_get_description(int mtp_device, return result; } -mtp_error_e mtp_gdbus_storageinfo_get_freespace(int mtp_device, - int mtp_storage, guint64 *freespace) +mtp_error_e mtp_gdbus_storageinfo_get_free_space(int mtp_device, + int mtp_storage, guint64 *free_space) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -71,7 +71,7 @@ mtp_error_e mtp_gdbus_storageinfo_get_freespace(int mtp_device, storageinfo_proxy, mtp_device, mtp_storage, - freespace, + free_space, &result, NULL, &error) == FALSE) { @@ -82,8 +82,8 @@ mtp_error_e mtp_gdbus_storageinfo_get_freespace(int mtp_device, return result; } -mtp_error_e mtp_gdbus_storageinfo_get_maxcapacity(int mtp_device, - int mtp_storage, guint64 *maxcapacity) +mtp_error_e mtp_gdbus_storageinfo_get_max_capacity(int mtp_device, + int mtp_storage, guint64 *max_capacity) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -95,7 +95,7 @@ mtp_error_e mtp_gdbus_storageinfo_get_maxcapacity(int mtp_device, storageinfo_proxy, mtp_device, mtp_storage, - maxcapacity, + max_capacity, &result, NULL, &error) == FALSE) { @@ -106,8 +106,8 @@ mtp_error_e mtp_gdbus_storageinfo_get_maxcapacity(int mtp_device, return result; } -mtp_error_e mtp_gdbus_storageinfo_get_storagetype(int mtp_device, - int mtp_storage, int *storagetype) +mtp_error_e mtp_gdbus_storageinfo_get_storage_type(int mtp_device, + int mtp_storage, int *storage_type) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -119,7 +119,7 @@ mtp_error_e mtp_gdbus_storageinfo_get_storagetype(int mtp_device, storageinfo_proxy, mtp_device, mtp_storage, - storagetype, + storage_type, &result, NULL, &error) == FALSE) { @@ -130,8 +130,8 @@ mtp_error_e mtp_gdbus_storageinfo_get_storagetype(int mtp_device, return result; } -mtp_error_e mtp_gdbus_storageinfo_get_volumeidentifier(int mtp_device, - int mtp_storage, char **volumeidentifier) +mtp_error_e mtp_gdbus_storageinfo_get_volume_identifier(int mtp_device, + int mtp_storage, char **volume_identifier) { mtp_error_e result = MTP_ERROR_NONE; GError *error = NULL; @@ -143,7 +143,7 @@ mtp_error_e mtp_gdbus_storageinfo_get_volumeidentifier(int mtp_device, storageinfo_proxy, mtp_device, mtp_storage, - volumeidentifier, + volume_identifier, &result, NULL, &error) == FALSE) { diff --git a/src/mtp_gdbuslib.xml b/src/mtp_gdbuslib.xml index aaca563..03998e3 100755 --- a/src/mtp_gdbuslib.xml +++ b/src/mtp_gdbuslib.xml @@ -4,22 +4,15 @@ - + - - - - - - - - + - + @@ -27,9 +20,9 @@ - + - + @@ -60,29 +53,41 @@ - + - + - + - + + + + + + + + + + + + + diff --git a/test/mtp_unit_test.c b/test/mtp_unit_test.c index 47b7d0c..f8ed1f2 100755 --- a/test/mtp_unit_test.c +++ b/test/mtp_unit_test.c @@ -9,7 +9,7 @@ #include #define BUFFER_LEN 100 -#define TEST_CASE_MAX 39 +#define TEST_CASE_MAX 40 #define TEST_LIST_MAX 20 #define PRT(format, args...) printf("%s:%d() "format, __FUNCTION__, __LINE__, ##args) @@ -140,74 +140,6 @@ int manager_test_initialize(void) return ret; } -int manager_test_get_raw_devices(void) -{ - int ret = 0; - int i; - mtp_raw_device_h *raw_devices = NULL; - int device_count; - - BEGIN(); - - ret = mtp_get_raw_devices(&raw_devices, &device_count); - TC_PRT("ret[%d]: device_num[%d]", ret, device_count); - - if (ret == MTP_ERROR_NONE) { - for (i = 0; i < device_count; i++) { - int bus_location; - int device_number; - char *device_name = NULL; - mtp_get_bus_location(raw_devices[i], &bus_location); - mtp_get_device_number(raw_devices[i], &device_number); - mtp_get_device_name(raw_devices[i], &device_name); - TC_PRT("device bus_location[%d], dev_no [%d], model_name[%s]", - bus_location, device_number, device_name); - } - } else { - TC_PRT("get device list failed, ret[%d]", ret); - } - - END(); - return ret; -} - -int manager_test_get_device(void) -{ - int ret = 0; - int bus_location = 0; - int device_number = 0; - int device_count; - mtp_raw_device_h *raw_devices = NULL; - - BEGIN(); - - ret = mtp_get_raw_devices(&raw_devices, &device_count); - - if (ret != MTP_ERROR_NONE) { - TC_PRT("mtp_get_raw_devices is failed!!!"); - return -1; - } - - if (device_count == 0) { - TC_PRT("device is not exist!!!"); - END(); - return -1; - } - - TC_PRT("Select first device"); - - mtp_get_bus_location(raw_devices[0], &bus_location); - mtp_get_device_number(raw_devices[0], &device_number); - - TC_PRT("bus location : %d, device_number : %d", bus_location, device_number); - - ret = mtp_get_device(bus_location, device_number, &mtp_device); - TC_PRT("ret[%d]: 1st mtp device [%d]", ret, mtp_device); - - END(); - return ret; -} - int manager_test_get_storages(void) { int i; @@ -216,10 +148,10 @@ int manager_test_get_storages(void) int device_number = 0; int device_count; int storage_count; - mtp_raw_device_h *raw_devices = NULL; + mtp_device_h *mtp_devices = NULL; mtp_storage_h *mtp_storages = NULL; - ret = mtp_get_raw_devices(&raw_devices, &device_count); + ret = mtp_get_devices(&mtp_devices, &device_count); if (ret != MTP_ERROR_NONE) { TC_PRT("mtp_get_raw_devices is failed!!!"); @@ -234,15 +166,14 @@ int manager_test_get_storages(void) TC_PRT("Select first device"); - mtp_get_bus_location(raw_devices[0], &bus_location); - mtp_get_device_number(raw_devices[0], &device_number); + mtp_deviceinfo_get_bus_location(mtp_devices[0], &bus_location); + mtp_deviceinfo_get_device_number(mtp_devices[0], &device_number); TC_PRT("bus location : %d, device_number : %d", bus_location, device_number); - ret = mtp_get_device(bus_location, device_number, &mtp_device); - TC_PRT("ret[%d]: 1st mtp device [%d]", ret, mtp_device); + TC_PRT("ret[%d]: 1st mtp device [%d]", ret, mtp_devices[0]); - ret = mtp_get_storages(mtp_device, &mtp_storages, &storage_count); + ret = mtp_get_storages(mtp_devices[0], &mtp_storages, &storage_count); TC_PRT("ret[%d]: storage_count[%d]", ret, storage_count); if (storage_count == 0) { @@ -251,10 +182,6 @@ int manager_test_get_storages(void) return -1; } - ret = mtp_destroy_raw_devices(raw_devices); - TC_PRT("ret[%d]: mtp_destroy_raw_devices", ret); - - for (i = 0; i < storage_count; i++) TC_PRT("mtp storage %d [%d]", i, mtp_storages[i]); @@ -829,7 +756,7 @@ int objectinfo_test_get_thumbnail_file_type(void) for (i = 0; i < list_max; i++) { ret = mtp_objectinfo_get_thumbnail_file_type(mtp_device, mtp_objects[i], &value); - TC_PRT("ret[%d]: object id[%d] thumbnail_format[%d]", ret, mtp_objects[i], value); + TC_PRT("ret[%d]: object id[%d] thumbnail_file_type[%d]", ret, mtp_objects[i], value); } END(); @@ -1045,10 +972,24 @@ int application_test_get_object_handle_using_all_image(void) return ret; } -void __test_mtp_event_cb(mtp_event_e state, int arg, void *user_data) +void __test_mtp_event_cb1(mtp_event_e state, int arg, void *user_data) +{ + int ret = 0; + + TC_PRT("test mtp event cb 1 is called"); + TC_PRT("state [%d] : %d", state, arg); + + if (state == MTP_EVENT_TURNED_OFF) { + ret = mtp_deinitialize(); + TC_PRT("ret[%d] : Terminated daemon", ret); + } +} + +void __test_mtp_event_cb2(mtp_event_e state, int arg, void *user_data) { int ret = 0; + TC_PRT("test mtp event cb 2 is called"); TC_PRT("state [%d] : %d", state, arg); if (state == MTP_EVENT_TURNED_OFF) { @@ -1057,13 +998,27 @@ void __test_mtp_event_cb(mtp_event_e state, int arg, void *user_data) } } -int application_test_event_callback(void) +int application_test_add_event_callback(void) +{ + int ret; + + BEGIN(); + + ret = mtp_add_mtp_event_cb(__test_mtp_event_cb1, NULL); + ret = mtp_add_mtp_event_cb(__test_mtp_event_cb2, NULL); + + END(); + + return ret; +} + +int application_test_remove_event_callback(void) { int ret; BEGIN(); - ret = mtp_set_mtp_event_cb(__test_mtp_event_cb, NULL); + ret = mtp_remove_mtp_event_cb(__test_mtp_event_cb1); END(); @@ -1073,8 +1028,6 @@ int application_test_event_callback(void) tc_table_t tc_table[] = { /* manager api */ {"mtp_initialize", 1, manager_test_initialize}, - {"mtp_get_raw_devices", 2, manager_test_get_raw_devices}, - {"mtp_get_device", 3, manager_test_get_device}, {"mtp_get_storages", 4, manager_test_get_storages}, {"mtp_get_object_handles", 5, manager_test_get_object_handles}, {"mtp_delete_object", 6, manager_test_delete_object}, @@ -1106,7 +1059,7 @@ tc_table_t tc_table[] = { {"mtp_objectinfo_get_image_pix_width", 26, objectinfo_test_get_image_pix_width}, {"mtp_objectinfo_get_image_pix_height", 27, objectinfo_test_get_image_pix_height}, {"mtp_objectinfo_get_thumbnail_size", 28, objectinfo_test_get_thumbnail_size}, - {"mtp_objectinfo_get_thumbnail_format", 29, objectinfo_test_get_thumbnail_file_type}, + {"mtp_objectinfo_get_thumbnail_file_type", 29, objectinfo_test_get_thumbnail_file_type}, {"mtp_objectinfo_get_thumbnail_pix_height", 30, objectinfo_test_get_thumbnail_pix_height}, {"mtp_objectinfo_get_thumbnail_pix_width", 31, objectinfo_test_get_thumbnail_pix_width}, {"mtp_objectinfo_get_filename", 32, objectinfo_test_get_filename}, @@ -1116,7 +1069,8 @@ tc_table_t tc_table[] = { {"get Jpeg image from /DCIM folder", 34, application_test_get_image_from_DCIM}, {"get object handle using ALL file type", 35, application_test_get_object_handle_using_all}, {"get object handle using ALL Image file type", 36, application_test_get_object_handle_using_all_image}, - {"test callback function", 37, application_test_event_callback}, + {"test add callback function", 37, application_test_add_event_callback}, + {"test remove callback function", 38, application_test_remove_event_callback}, {"get object and get thumbnail test", TEST_CASE_MAX, NULL}, /*-----------*/