17 #if !defined(__CDCACM_H__)
22 #define bmREQ_CDCOUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
23 #define bmREQ_CDCIN USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
26 #define CDC_SUBCLASS_DLCM 0x01
27 #define CDC_SUBCLASS_ACM 0x02
28 #define CDC_SUBCLASS_TCM 0x03
29 #define CDC_SUBCLASS_MCCM 0x04
30 #define CDC_SUBCLASS_CAPI 0x05
31 #define CDC_SUBCLASS_ETHERNET 0x06
32 #define CDC_SUBCLASS_ATM 0x07
33 #define CDC_SUBCLASS_WIRELESS_HANDSET 0x08
34 #define CDC_SUBCLASS_DEVICE_MANAGEMENT 0x09
35 #define CDC_SUBCLASS_MOBILE_DIRECT_LINE 0x0A
36 #define CDC_SUBCLASS_OBEX 0x0B
37 #define CDC_SUBCLASS_ETHERNET_EMU 0x0C
40 #define CDC_PROTOCOL_ITU_T_V_250 0x01
41 #define CDC_PROTOCOL_PCCA_101 0x02
42 #define CDC_PROTOCOL_PCCA_101_O 0x03
43 #define CDC_PROTOCOL_GSM_7_07 0x04
44 #define CDC_PROTOCOL_3GPP_27_07 0x05
45 #define CDC_PROTOCOL_C_S0017_0 0x06
46 #define CDC_PROTOCOL_USB_EEM 0x07
49 #define CDC_SEND_ENCAPSULATED_COMMAND 0x00
50 #define CDC_GET_ENCAPSULATED_RESPONSE 0x01
53 #define CDC_SET_COMM_FEATURE 0x02
54 #define CDC_GET_COMM_FEATURE 0x03
55 #define CDC_CLEAR_COMM_FEATURE 0x04
56 #define CDC_SET_AUX_LINE_STATE 0x10
57 #define CDC_SET_HOOK_STATE 0x11
58 #define CDC_PULSE_SETUP 0x12
59 #define CDC_SEND_PULSE 0x13
60 #define CDC_SET_PULSE_TIME 0x14
61 #define CDC_RING_AUX_JACK 0x15
62 #define CDC_SET_LINE_CODING 0x20
63 #define CDC_GET_LINE_CODING 0x21
64 #define CDC_SET_CONTROL_LINE_STATE 0x22
65 #define CDC_SEND_BREAK 0x23
66 #define CDC_SET_RINGER_PARMS 0x30
67 #define CDC_GET_RINGER_PARMS 0x31
68 #define CDC_SET_OPERATION_PARMS 0x32
69 #define CDC_GET_OPERATION_PARMS 0x33
70 #define CDC_SET_LINE_PARMS 0x34
71 #define CDC_GET_LINE_PARMS 0x35
72 #define CDC_DIAL_DIGITS 0x36
75 #define NETWORK_CONNECTION 0x00
76 #define RESPONSE_AVAILABLE 0x01
77 #define AUX_JACK_HOOK_STATE 0x08
78 #define RING_DETECT 0x09
79 #define SERIAL_STATE 0x20
80 #define CALL_STATE_CHANGE 0x28
81 #define LINE_STATE_CHANGE 0x29
82 #define CONNECTION_SPEED_CHANGE 0x2a
131 virtual uint8_t
OnInit(
ACM *pacm __attribute__((unused))) {
157 } __attribute__((packed));
161 #define ACM_MAX_ENDPOINTS 4
187 uint8_t
SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
188 uint8_t
GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr);
194 uint8_t
GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr);
197 uint8_t
RcvData(uint16_t *nbytesptr, uint8_t *dataptr);
198 uint8_t
SndData(uint16_t nbytes, uint8_t *dataptr);
201 uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
244 virtual void wide(
bool s __attribute__((unused))) {
struct ACM_FUNC_DESCR TEL_OPER_MODES_FUNC_DESCR
struct ACM_FUNC_DESCR TEL_CALL_STATE_REP_CPBL_FUNC_DESCR
#define ACM_MAX_ENDPOINTS
struct ACM_FUNC_DESCR DLM_FUNC_DESCR
static const uint8_t epDataOutIndex
uint8_t GetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
uint8_t SendBreak(uint16_t duration)
virtual tty_features enhanced_features(void)
virtual tty_features enhanced_status(void)
uint8_t GetNotif(uint16_t *bytes_rcvd, uint8_t *dataptr)
static const uint8_t epDataInIndex
virtual void autoflowRTS(bool s)
EpInfo epInfo[ACM_MAX_ENDPOINTS]
uint8_t SetCommFeature(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)
uint8_t ClearCommFeature(uint16_t fid)
volatile bool bPollEnable
uint8_t SetLineCoding(const LINE_CODING *dataptr)
virtual uint8_t GetAddress()
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
virtual void autoflowXON(bool s)
tty_features _enhanced_status
static const uint8_t epInterruptInIndex
uint8_t GetLineCoding(LINE_CODING *dataptr)
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
ACM(USB *pusb, CDCAsyncOper *pasync)
virtual void wide(bool s)
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
virtual void autoflowDSR(bool s)
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
virtual void half_duplex(bool s)
uint8_t SetControlLineState(uint8_t state)
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
virtual uint8_t OnInit(ACM *pacm)
uint8_t bDescriptorSubtype
uint8_t bDescriptorSubtype
uint8_t bNumRingerPatterns
uint8_t bDescriptorSubtype