1 /* 2 * Copyright (c) 2007-2008 by Michael Lotz 3 * Heavily based on the original usb_serial driver which is: 4 * 5 * Copyright (c) 2003 by Siarzhuk Zharski <imker@gmx.li> 6 * Distributed under the terms of the MIT License. 7 */ 8 #ifndef _USB_ACM_H_ 9 #define _USB_ACM_H_ 10 11 #include "SerialDevice.h" 12 13 /* requests for CDC ACM devices */ 14 #define SEND_ENCAPSULATED_COMMAND 0x00 15 #define GET_ENCAPSULATED_RESPONSE 0x01 16 #define SET_LINE_CODING 0x20 17 #define SET_CONTROL_LINE_STATE 0x22 18 19 /* notifications for CDC ACM devices */ 20 #define NETWORK_CONNECTION 0x00 21 #define RESPONSE_AVAILABLE 0x01 22 23 class ACMDevice : public SerialDevice { 24 public: 25 ACMDevice(usb_device device, uint16 vendorID, 26 uint16 productID, const char *description); 27 28 virtual status_t AddDevice(const usb_configuration_info *config); 29 30 virtual status_t SetLineCoding(usb_serial_line_coding *coding); 31 virtual status_t SetControlLineState(uint16 state); 32 33 virtual void OnWrite(const char *buffer, size_t *numBytes, 34 size_t *packetBytes); 35 }; 36 37 #endif //_USB_ACM_H_ 38