USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
MTP - Media Transfer Protocol
+ Collaboration diagram for MTP - Media Transfer Protocol:

Files

file  mtp.h
 USB MTP (Media Transfer Protocol) v1.1 device class.
 

Data Structures

struct  mtp_opts
 MTP configuration: device identity + one or more storage backends. More...
 

Macros

#define MTP_MAX_STORAGES
 Maximum number of storages a device may expose.
 

Typedefs

typedef struct mtp_func mtp_func
 One MTP function: a single instance of the class on a device.
 
typedef void(* mtp_emit) (void *ctx, const char *name)
 Callback used by mtp_opts::listdir to report one directory entry.
 

Functions

mtp_funcmtp_add (usbip_device *dev, const mtp_opts *opts)
 Add an MTP interface to a device.
 

Variables

const usbip_device_class usbip_device_mtp
 The MTP class, for usbip_device_add_class()
 

Detailed Description

Macro Definition Documentation

◆ MTP_MAX_STORAGES

#define MTP_MAX_STORAGES

Maximum number of storages a device may expose.

Typedef Documentation

◆ mtp_func

typedef struct mtp_func mtp_func

One MTP function: a single instance of the class on a device.

Opaque - create one with mtp_add() and use the functions below. Distinct from the other classes' handles, so mixing them up is a compile error rather than a misread state block.

◆ mtp_emit

typedef void(* mtp_emit) (void *ctx, const char *name)

Callback used by mtp_opts::listdir to report one directory entry.

Parameters
ctxthe opaque pointer that listdir() was handed.
namethe entry's name (a single path component, not a full path).

Function Documentation

◆ mtp_add()

mtp_func * mtp_add ( usbip_device dev,
const mtp_opts opts 
)

Add an MTP interface to a device.

Parameters
devthe device.
optsdevice identity + one or more storage backends (see mtp_opts).
Returns
the new function, or NULL on error.

Variable Documentation

◆ usbip_device_mtp

const usbip_device_class usbip_device_mtp
extern

The MTP class, for usbip_device_add_class()