This change includes work in progress on a C++ library for both host and device MTP and PTP support. Currently the makefile builds two test programs: mtptest - a command line test program that implements a small subset of device side MTP. Requires a kernel driver that has not been checked in yet. ptptest - a host tool to test USB host support for detecting and communicating with digital cameras over PTP. Runs on Linux host. Later this will be reformulated as a native library that will be used in the media process. Change-Id: I81aab279975b600b59d99013ab97f9adf0b58da7 Signed-off-by: Mike Lockwood <lockwood@android.com>
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
/*
|
|
* Gadget Function Driver for MTP
|
|
*
|
|
* Copyright (C) 2010 Google, Inc.
|
|
* Author: Mike Lockwood <lockwood@android.com>
|
|
*
|
|
* This software is licensed under the terms of the GNU General Public
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
* may be copied, distributed, and modified under those terms.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#ifndef __LINUX_USB_F_MTP_H
|
|
#define __LINUX_USB_F_MTP_H
|
|
|
|
struct mtp_file_range {
|
|
/* path for file to transfer */
|
|
const char *path;
|
|
/* strlen(path) */
|
|
int path_length;
|
|
/* offset in file for start of transfer */
|
|
loff_t offset;
|
|
/* number of bytes to transfer */
|
|
size_t length;
|
|
};
|
|
|
|
/* Sends the specified file range to the host */
|
|
#define MTP_SEND_FILE _IOW('M', 0, struct mtp_file_range)
|
|
/* Receives data from the host and writes it to a file.
|
|
* The file is created if it does not exist.
|
|
*/
|
|
#define MTP_RECEIVE_FILE _IOW('M', 1, struct mtp_file_range)
|
|
|
|
#endif /* __LINUX_USB_F_MTP_H */
|