diff options
author | Mike Lockwood <lockwood@android.com> | 2010-07-12 18:54:16 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-07-13 20:04:22 -0400 |
commit | 873871f3e75831bcda6c3f75bb4d53355ca5c53a (patch) | |
tree | e7fcffe64b2104cba18df6f35cf736cee63eb2d3 /media/mtp/MtpEventPacket.h | |
parent | 4714b0766ecf48f09f39b4781a5c4deafc092d49 (diff) | |
download | frameworks_av-873871f3e75831bcda6c3f75bb4d53355ca5c53a.zip frameworks_av-873871f3e75831bcda6c3f75bb4d53355ca5c53a.tar.gz frameworks_av-873871f3e75831bcda6c3f75bb4d53355ca5c53a.tar.bz2 |
MTP: Add support for sending events to the host when objects are added and removed
Change-Id: Ia1d5232b919c644c670ff9ca651eca92b3f9ad42
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/MtpEventPacket.h')
-rw-r--r-- | media/mtp/MtpEventPacket.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/media/mtp/MtpEventPacket.h b/media/mtp/MtpEventPacket.h new file mode 100644 index 0000000..30ae869 --- /dev/null +++ b/media/mtp/MtpEventPacket.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _MTP_EVENT_PACKET_H +#define _MTP_EVENT_PACKET_H + +#include "MtpPacket.h" +#include "mtp.h" + +namespace android { + +class MtpEventPacket : public MtpPacket { + +public: + MtpEventPacket(); + virtual ~MtpEventPacket(); + +#ifdef MTP_DEVICE + // write our data to the given file descriptor + int write(int fd); +#endif + +#ifdef MTP_HOST + // read our buffer from the given endpoint + int read(struct usb_endpoint *ep); +#endif + + inline MtpEventCode getEventCode() const { return getContainerCode(); } + inline void setEventCode(MtpEventCode code) + { return setContainerCode(code); } +}; + +}; // namespace android + +#endif // _MTP_EVENT_PACKET_H |