---
name: "mtp_LIBMTP_mtpdevice_struct"
section: "3"
platform: "linux"
package: "libmtp-doc"
version: "1.1.22-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mtp_LIBMTP_mtpdevice_struct"
---

# mtp\_LIBMTP\_mtpdevice\_struct(3)

## NAME

libmtp -

## SYNOPSIS

`#include <libmtp.h>`

### Data Fields

uint8\_t **object\_bitsize**\
 void \* **params**\
 void \* **usbinfo**\
 **LIBMTP\_devicestorage\_t** \* **storage**\
 **LIBMTP\_error\_t** \* **errorstack**\
 uint8\_t **maximum\_battery\_level**\
 uint32\_t **default\_music\_folder**\
 uint32\_t **default\_playlist\_folder**\
 uint32\_t **default\_picture\_folder**\
 uint32\_t **default\_video\_folder**\
 uint32\_t **default\_organizer\_folder**\
 uint32\_t **default\_zencast\_folder**\
 uint32\_t **default\_album\_folder**\
 uint32\_t **default\_text\_folder**\
 void \* **cd**\
 **LIBMTP\_device\_extension\_t** \* **extensions**\
 int **cached**\
 **LIBMTP\_mtpdevice\_t** \* **next**\

## Detailed Description

Main MTP device object struct

**Examples** **delfile.c**, **detect.c**, **files.c**, **folders.c**, **getfile.c**, **getplaylist.c**, **newfolder.c**, **playlists.c**, **sendfile.c**, **sendtr.c**, **tracks.c**, and **trexist.c**.

## Field Documentation

### int LIBMTP\_mtpdevice\_struct::cached

Whether the device uses caching, only used internally

Referenced by **LIBMTP\_Get\_Children()**, **LIBMTP\_Get\_Filemetadata()**, **LIBMTP\_Get\_Files\_And\_Folders()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### void\* LIBMTP\_mtpdevice\_struct::cd

Per device iconv() converters, only used internally

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_album\_folder

Default Album folder

Referenced by **LIBMTP\_Create\_New\_Album()**, **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_music\_folder

Default music folder

Referenced by **LIBMTP\_Create\_New\_Album()**, **LIBMTP\_Create\_New\_Playlist()**, **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_organizer\_folder

Default organizer folder

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_picture\_folder

Default picture folder

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_playlist\_folder

Default playlist folder

Referenced by **LIBMTP\_Create\_New\_Playlist()**, **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_text\_folder

Default Text folder

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_video\_folder

Default video folder

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### uint32\_t LIBMTP\_mtpdevice\_struct::default\_zencast\_folder

Default ZENcast folder (only Creative devices...)

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### LIBMTP\_error\_t\* LIBMTP\_mtpdevice\_struct::errorstack

The error stack. This shall be handled using the error getting and clearing functions, not by dereferencing this list.

Referenced by **LIBMTP\_Clear\_Errorstack()**, **LIBMTP\_Dump\_Errorstack()**, **LIBMTP\_Get\_Errorstack()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### LIBMTP\_device\_extension\_t\* LIBMTP\_mtpdevice\_struct::extensions

Extension list

Referenced by **LIBMTP\_Dump\_Device\_Info()**, **LIBMTP\_Open\_Raw\_Device\_Uncached()**, and **LIBMTP\_Release\_Device()**.

### uint8\_t LIBMTP\_mtpdevice\_struct::maximum\_battery\_level

The maximum battery level for this device

Referenced by **LIBMTP\_Get\_Batterylevel()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### LIBMTP\_mtpdevice\_t\* LIBMTP\_mtpdevice\_struct::next

Pointer to next device in linked list; NULL if this is the last device

Referenced by **LIBMTP\_Number\_Devices\_In\_List()**, and **LIBMTP\_Release\_Device\_List()**.

### uint8\_t LIBMTP\_mtpdevice\_struct::object\_bitsize

Object bitsize, typically 32 or 64.

Referenced by **LIBMTP\_Dump\_Device\_Info()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### void\* LIBMTP\_mtpdevice\_struct::params

Parameters for this device, must be cast into (PTPParams\*) before internal use.

Referenced by **LIBMTP\_Check\_Capability()**, **LIBMTP\_Copy\_Object()**, **LIBMTP\_Create\_Folder()**, **LIBMTP\_Custom\_Operation()**, **LIBMTP\_Delete\_Object()**, **LIBMTP\_Dump\_Device\_Info()**, **LIBMTP\_Format\_Storage()**, **LIBMTP\_Get\_Album()**, **LIBMTP\_Get\_Album\_List\_For\_Storage()**, **LIBMTP\_Get\_Allowed\_Property\_Values()**, **LIBMTP\_Get\_Batterylevel()**, **LIBMTP\_Get\_Children()**, **LIBMTP\_Get\_Device\_By\_SerialNumber()**, **LIBMTP\_Get\_Deviceversion()**, **LIBMTP\_Get\_File\_To\_File\_Descriptor()**, **LIBMTP\_Get\_File\_To\_Handler()**, **LIBMTP\_Get\_Filelisting\_With\_Callback()**, **LIBMTP\_Get\_Filemetadata()**, **LIBMTP\_Get\_Files\_And\_Folders()**, **LIBMTP\_Get\_Folder\_List\_For\_Storage()**, **LIBMTP\_Get\_Friendlyname()**, **LIBMTP\_Get\_Manufacturername()**, **LIBMTP\_Get\_Modelname()**, **LIBMTP\_Get\_Playlist()**, **LIBMTP\_Get\_Playlist\_List()**, **LIBMTP\_Get\_Representative\_Sample()**, **LIBMTP\_Get\_Representative\_Sample\_Format()**, **LIBMTP\_Get\_Serialnumber()**, **LIBMTP\_Get\_Storage()**, **LIBMTP\_Get\_Supported\_Filetypes()**, **LIBMTP\_Get\_Syncpartner()**, **LIBMTP\_Get\_Thumbnail()**, **LIBMTP\_Get\_Tracklisting\_With\_Callback\_For\_Storage()**, **LIBMTP\_Get\_Trackmetadata()**, **LIBMTP\_Is\_Property\_Supported()**, **LIBMTP\_Move\_Object()**, **LIBMTP\_Open\_Raw\_Device\_Uncached()**, **LIBMTP\_Read\_Event()**, **LIBMTP\_Read\_Event\_Async()**, **LIBMTP\_Release\_Device()**, **LIBMTP\_Reset\_Device()**, **LIBMTP\_Send\_File\_From\_File\_Descriptor()**, **LIBMTP\_Send\_File\_From\_Handler()**, **LIBMTP\_Send\_Representative\_Sample()**, **LIBMTP\_Send\_Track\_From\_File\_Descriptor()**, **LIBMTP\_Send\_Track\_From\_Handler()**, **LIBMTP\_Set\_Friendlyname()**, **LIBMTP\_Set\_Syncpartner()**, **LIBMTP\_Track\_Exists()**, **LIBMTP\_Update\_Track\_Metadata()**, **utf16\_to\_utf8()**, and **utf8\_to\_utf16()**.

### LIBMTP\_devicestorage\_t\* LIBMTP\_mtpdevice\_struct::storage

The storage for this device, do not use strings in here without copying them first, and beware that this list may be rebuilt at any time.

**See also**

**LIBMTP\_Get\_Storage()**

**Examples** **detect.c**, **files.c**, **folders.c**, **sendtr.c**, and **tracks.c**.

Referenced by **LIBMTP\_Dump\_Device\_Info()**, **LIBMTP\_Get\_Storage()**, and **LIBMTP\_Open\_Raw\_Device\_Uncached()**.

### void\* LIBMTP\_mtpdevice\_struct::usbinfo

USB device for this device, must be cast into (PTP\_USB\*) before internal use.

Referenced by **LIBMTP\_Create\_Folder()**, **LIBMTP\_Create\_New\_Playlist()**, **LIBMTP\_Dump\_Device\_Info()**, **LIBMTP\_Get\_Batterylevel()**, **LIBMTP\_Get\_File\_To\_File\_Descriptor()**, **LIBMTP\_Get\_File\_To\_Handler()**, **LIBMTP\_Get\_Playlist()**, **LIBMTP\_Get\_Playlist\_List()**, **LIBMTP\_Get\_Supported\_Filetypes()**, **LIBMTP\_Get\_Tracklisting\_With\_Callback\_For\_Storage()**, **LIBMTP\_Get\_Trackmetadata()**, **LIBMTP\_Open\_Raw\_Device\_Uncached()**, **LIBMTP\_Release\_Device()**, **LIBMTP\_Send\_File\_From\_File\_Descriptor()**, **LIBMTP\_Send\_File\_From\_Handler()**, **LIBMTP\_Send\_Representative\_Sample()**, **LIBMTP\_Send\_Track\_From\_File\_Descriptor()**, **LIBMTP\_Send\_Track\_From\_Handler()**, **LIBMTP\_Update\_Playlist()**, and **LIBMTP\_Update\_Track\_Metadata()**.

## Author

Generated automatically by Doxygen for libmtp from the source code.
