Tizen Native API  7.0
MTP Storage Information

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_deviceThe MTP device
[in]mtp_storageThe MTP storage
[out]descriptionThe description of Storage information
Returns:
0 on success, otherwise a negative error value.
Return values:
MTP_ERROR_NONESuccessful
MTP_ERROR_NOT_SUPPORTEDMTP is not supported
MTP_ERROR_INVALID_PARAMETERInvalid parameter
MTP_ERROR_NOT_INITIALIZEDMTP is not initialized
MTP_ERROR_NOT_ACTIVATEDMTP is not activated
MTP_ERROR_NOT_COMM_INITIALIZEDMTP communication is not initialized
MTP_ERROR_COMM_ERRORMTP communication error
MTP_ERROR_CONTROLLERMTP controller error
MTP_ERROR_OUT_OF_MEMORYOut of memory
MTP_ERROR_NO_DEVICEMTP 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_deviceThe MTP device
[in]mtp_storageThe MTP storage
[out]free_spaceThe free space of Storage information (bytes)
Returns:
0 on success, otherwise a negative error value.
Return values:
MTP_ERROR_NONESuccessful
MTP_ERROR_NOT_SUPPORTEDMTP is not supported
MTP_ERROR_INVALID_PARAMETERInvalid parameter
MTP_ERROR_NOT_INITIALIZEDMTP is not initialized
MTP_ERROR_NOT_ACTIVATEDMTP is not activated
MTP_ERROR_NOT_COMM_INITIALIZEDMTP communication is not initialized
MTP_ERROR_COMM_ERRORMTP communication error
MTP_ERROR_CONTROLLERMTP controller error
MTP_ERROR_OUT_OF_MEMORYOut of memory
MTP_ERROR_NO_DEVICEMTP 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_deviceThe MTP device
[in]mtp_storageThe MTP storage
[out]max_capacityThe max capacity of Storage information (bytes)
Returns:
0 on success, otherwise a negative error value.
Return values:
MTP_ERROR_NONESuccessful
MTP_ERROR_NOT_SUPPORTEDMTP is not supported
MTP_ERROR_INVALID_PARAMETERInvalid parameter
MTP_ERROR_NOT_INITIALIZEDMTP is not initialized
MTP_ERROR_NOT_ACTIVATEDMTP is not activated
MTP_ERROR_NOT_COMM_INITIALIZEDMTP communication is not initialized
MTP_ERROR_COMM_ERRORMTP communication error
MTP_ERROR_CONTROLLERMTP controller error
MTP_ERROR_OUT_OF_MEMORYOut of memory
MTP_ERROR_NO_DEVICEMTP 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_deviceThe MTP device
[in]mtp_storageThe MTP storage
[out]storage_typeThe storage type of Storage information
Returns:
0 on success, otherwise a negative error value.
Return values:
MTP_ERROR_NONESuccessful
MTP_ERROR_NOT_SUPPORTEDMTP is not supported
MTP_ERROR_INVALID_PARAMETERInvalid parameter
MTP_ERROR_NOT_INITIALIZEDMTP is not initialized
MTP_ERROR_NOT_ACTIVATEDMTP is not activated
MTP_ERROR_NOT_COMM_INITIALIZEDMTP communication is not initialized
MTP_ERROR_COMM_ERRORMTP communication error
MTP_ERROR_CONTROLLERMTP controller error
MTP_ERROR_OUT_OF_MEMORYOut of memory
MTP_ERROR_NO_DEVICEMTP 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_deviceThe MTP device
[in]mtp_storageThe MTP storage
[out]volume_identifierThe volume identifier of Storage information
Returns:
0 on success, otherwise a negative error value.
Return values:
MTP_ERROR_NONESuccessful
MTP_ERROR_NOT_SUPPORTEDMTP is not supported
MTP_ERROR_INVALID_PARAMETERInvalid parameter
MTP_ERROR_NOT_INITIALIZEDMTP is not initialized
MTP_ERROR_NOT_ACTIVATEDMTP is not activated
MTP_ERROR_NOT_COMM_INITIALIZEDMTP communication is not initialized
MTP_ERROR_COMM_ERRORMTP communication error
MTP_ERROR_CONTROLLERMTP controller error
MTP_ERROR_OUT_OF_MEMORYOut of memory
MTP_ERROR_NO_DEVICEMTP have not any device
See also:
mtp_get_object_handles()