소스 검색

Avoid ModemManager blocking serial

Nicolas Stalder 7 년 전
부모
커밋
3575729b0e
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      demo/cdc_loop.c
  2. 1 0
      inc/usb_cdc.h

+ 5 - 0
demo/cdc_loop.c

@@ -35,6 +35,7 @@
 #define CDC_LOOPBACK
 #define ENABLE_HID_COMBO
 
+//#define SIGNAL_MODEM  /* uncomment to signal modem capabilities */
 //#define CDC_USE_IRQ   /* uncomment to build interrupt-based demo */
 
 /* Declaration of the report descriptor */
@@ -124,7 +125,11 @@ static const struct cdc_config config_desc = {
         .bNumEndpoints          = 1,
         .bInterfaceClass        = USB_CLASS_CDC,
         .bInterfaceSubClass     = USB_CDC_SUBCLASS_ACM,
+        #ifdef SIGNAL_MODEM
         .bInterfaceProtocol     = USB_CDC_PROTO_V25TER,
+        #else
+        .bInterfaceProtocol     = USB_CDC_PROTO_NONE,
+        #endif
         .iInterface             = NO_DESCRIPTOR,
     },
     .cdc_hdr = {

+ 1 - 0
inc/usb_cdc.h

@@ -39,6 +39,7 @@
 
 /**\name Communications Class Protocol Codes
  * @{ */
+#define USB_CDC_PROTO_NONE              0x00    /**<\brief No class specific protocol required */
 #define USB_CDC_PROTO_V25TER            0x01    /**<\brief AT Commands: V.250 etc.*/
  /** @} */