Tizen Native API
4.0
|
The MTP Storage Information API provides functions for gets the storage information of MTP responder storage.
Required Header
#include <mtp.h>
Overview
The MTP Storage Information api provides following functions :
- Get storage free space
- Get storage description
- Get storage type
- and, more storage information
Related Features
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | mtp_storageinfo_get_description (mtp_device_h mtp_device, mtp_storage_h mtp_storage, char **description) |
Gets the description of the storage information. | |
int | mtp_storageinfo_get_free_space (mtp_device_h mtp_device, mtp_storage_h mtp_storage, unsigned long long *free_space) |
Gets the free space of the storage information in bytes. | |
int | mtp_storageinfo_get_max_capacity (mtp_device_h mtp_device, mtp_storage_h mtp_storage, unsigned long long *max_capacity) |
Gets the max capacity of the storage information in bytes. | |
int | mtp_storageinfo_get_storage_type (mtp_device_h mtp_device, mtp_storage_h mtp_storage, mtp_storage_type_e *storage_type) |
Gets the storage type of the storage information. | |
int | mtp_storageinfo_get_volume_identifier (mtp_device_h mtp_device, mtp_storage_h mtp_storage, char **volume_identifier) |
Gets the volume identifier of the storage information. |
Function Documentation
int mtp_storageinfo_get_description | ( | mtp_device_h | mtp_device, |
mtp_storage_h | mtp_storage, | ||
char ** | description | ||
) |
Gets the description of the storage information.
- Since :
- 3.0
- Remarks:
- The description should be freed using free().
- Parameters:
-
[in] mtp_device The MTP device [in] mtp_storage The MTP storage [out] description The description of Storage information
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MTP_ERROR_NONE Successful MTP_ERROR_NOT_SUPPORTED MTP is not supported MTP_ERROR_NOT_INITIALIZED MTP is not initialized MTP_ERROR_NOT_ACTIVATED MTP is not activated MTP_ERROR_INVALID_PARAMETER Invalid parameter MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized MTP_ERROR_COMM_ERROR MTP communication error MTP_ERROR_CONTROLLER MTP controller error MTP_ERROR_OUT_OF_MEMORY Out of memory MTP_ERROR_NO_DEVICE MTP have not any device
- See also:
- mtp_get_storages()
int mtp_storageinfo_get_free_space | ( | mtp_device_h | mtp_device, |
mtp_storage_h | mtp_storage, | ||
unsigned long long * | free_space | ||
) |
Gets the free space of the storage information in bytes.
- Since :
- 3.0
- Parameters:
-
[in] mtp_device The MTP device [in] mtp_storage The MTP storage [out] free_space The free space of Storage information (bytes)
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MTP_ERROR_NONE Successful MTP_ERROR_NOT_SUPPORTED MTP is not supported MTP_ERROR_NOT_INITIALIZED MTP is not initialized MTP_ERROR_NOT_ACTIVATED MTP is not activated MTP_ERROR_INVALID_PARAMETER Invalid parameter MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized MTP_ERROR_COMM_ERROR MTP communication error MTP_ERROR_CONTROLLER MTP controller error MTP_ERROR_OUT_OF_MEMORY Out of memory MTP_ERROR_NO_DEVICE MTP have not any device
- See also:
- mtp_get_storages()
int mtp_storageinfo_get_max_capacity | ( | mtp_device_h | mtp_device, |
mtp_storage_h | mtp_storage, | ||
unsigned long long * | max_capacity | ||
) |
Gets the max capacity of the storage information in bytes.
- Since :
- 3.0
- Parameters:
-
[in] mtp_device The MTP device [in] mtp_storage The MTP storage [out] max_capacity The max capacity of Storage information (bytes)
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MTP_ERROR_NONE Successful MTP_ERROR_NOT_SUPPORTED MTP is not supported MTP_ERROR_NOT_INITIALIZED MTP is not initialized MTP_ERROR_NOT_ACTIVATED MTP is not activated MTP_ERROR_INVALID_PARAMETER Invalid parameter MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized MTP_ERROR_COMM_ERROR MTP communication error MTP_ERROR_CONTROLLER MTP controller error MTP_ERROR_OUT_OF_MEMORY Out of memory MTP_ERROR_NO_DEVICE MTP have not any device
- See also:
- mtp_get_storages()
int mtp_storageinfo_get_storage_type | ( | mtp_device_h | mtp_device, |
mtp_storage_h | mtp_storage, | ||
mtp_storage_type_e * | storage_type | ||
) |
Gets the storage type of the storage information.
- Since :
- 3.0
- Parameters:
-
[in] mtp_device The MTP device [in] mtp_storage The MTP storage [out] storage_type The storage type of Storage information
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MTP_ERROR_NONE Successful MTP_ERROR_NOT_SUPPORTED MTP is not supported MTP_ERROR_NOT_INITIALIZED MTP is not initialized MTP_ERROR_NOT_ACTIVATED MTP is not activated MTP_ERROR_INVALID_PARAMETER Invalid parameter MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized MTP_ERROR_COMM_ERROR MTP communication error MTP_ERROR_CONTROLLER MTP controller error MTP_ERROR_OUT_OF_MEMORY Out of memory MTP_ERROR_NO_DEVICE MTP have not any device
- See also:
- mtp_get_storages()
int mtp_storageinfo_get_volume_identifier | ( | mtp_device_h | mtp_device, |
mtp_storage_h | mtp_storage, | ||
char ** | volume_identifier | ||
) |
Gets the volume identifier of the storage information.
- Since :
- 3.0
- Remarks:
- The volume_identifier should be freed using free().
- Parameters:
-
[in] mtp_device The MTP device [in] mtp_storage The MTP storage [out] volume_identifier The volume identifier of Storage information
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MTP_ERROR_NONE Successful MTP_ERROR_NOT_SUPPORTED MTP is not supported MTP_ERROR_NOT_INITIALIZED MTP is not initialized MTP_ERROR_NOT_ACTIVATED MTP is not activated MTP_ERROR_INVALID_PARAMETER Invalid parameter MTP_ERROR_NOT_COMM_INITIALIZED MTP communication is not initialized MTP_ERROR_COMM_ERROR MTP communication error MTP_ERROR_CONTROLLER MTP controller error MTP_ERROR_OUT_OF_MEMORY Out of memory MTP_ERROR_NO_DEVICE MTP have not any device
- See also:
- mtp_get_object_handles()