Tizen Native API  8.0
MTP Device Information

The MTP Device Information API provides functions for gets the device information of MTP responder device.

Required Header

#include <mtp.h>

Overview

The MTP Device Information api provides following functions :

  • Get device manufacturer name
  • Get device model name
  • Get device serial number
  • Get device version

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_deviceinfo_get_manufacturer_name (mtp_device_h mtp_device, char **manufacturer_name)
 Gets the manufacturer name of the device information.
int mtp_deviceinfo_get_model_name (mtp_device_h mtp_device, char **model_name)
 Gets the model name of the device information.
int mtp_deviceinfo_get_serial_number (mtp_device_h mtp_device, char **serial_number)
 Gets the serial number of the device information.
int mtp_deviceinfo_get_device_version (mtp_device_h mtp_device, char **device_version)
 Gets the device version of the device information.

Function Documentation

int mtp_deviceinfo_get_device_version ( mtp_device_h  mtp_device,
char **  device_version 
)

Gets the device version of the device information.

Since :
3.0
Remarks:
The device_version should be freed using free().
Parameters:
[in]mtp_deviceThe MTP device
[out]device_versionThe device version of Device 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_devices()
int mtp_deviceinfo_get_manufacturer_name ( mtp_device_h  mtp_device,
char **  manufacturer_name 
)

Gets the manufacturer name of the device information.

Since :
3.0
Remarks:
The manufacturer_name should be freed using free().
Parameters:
[in]mtp_deviceThe MTP device
[out]manufacturer_nameThe manufacturer name of Device 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_MEMORYMemory Allocation failed
MTP_ERROR_NO_DEVICEMTP have not any device
See also:
mtp_get_devices()
int mtp_deviceinfo_get_model_name ( mtp_device_h  mtp_device,
char **  model_name 
)

Gets the model name of the device information.

Since :
3.0
Remarks:
The model_name should be freed using free().
Parameters:
[in]mtp_deviceThe MTP device
[out]model_nameThe model name of Device 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_devices()
int mtp_deviceinfo_get_serial_number ( mtp_device_h  mtp_device,
char **  serial_number 
)

Gets the serial number of the device information.

Since :
3.0
Remarks:
The serial_number should be freed using free().
Parameters:
[in]mtp_deviceThe MTP device
[out]serial_numberThe serial number of Device 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_devices()