Explorar o código

Merge pull request #39 from nickray/no-modem-signaling

Avoid ModemManager blocking the virtual serial port
Dmitry Filimonchuk %!s(int64=7) %!d(string=hai) anos
pai
achega
d47340612f
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  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 CDC_LOOPBACK
 #define ENABLE_HID_COMBO
 #define ENABLE_HID_COMBO
 
 
+//#define SIGNAL_MODEM  /* uncomment to signal modem capabilities */
 //#define CDC_USE_IRQ   /* uncomment to build interrupt-based demo */
 //#define CDC_USE_IRQ   /* uncomment to build interrupt-based demo */
 
 
 /* Declaration of the report descriptor */
 /* Declaration of the report descriptor */
@@ -124,7 +125,11 @@ static const struct cdc_config config_desc = {
         .bNumEndpoints          = 1,
         .bNumEndpoints          = 1,
         .bInterfaceClass        = USB_CLASS_CDC,
         .bInterfaceClass        = USB_CLASS_CDC,
         .bInterfaceSubClass     = USB_CDC_SUBCLASS_ACM,
         .bInterfaceSubClass     = USB_CDC_SUBCLASS_ACM,
+        #ifdef SIGNAL_MODEM
         .bInterfaceProtocol     = USB_CDC_PROTO_V25TER,
         .bInterfaceProtocol     = USB_CDC_PROTO_V25TER,
+        #else
+        .bInterfaceProtocol     = USB_CDC_PROTO_NONE,
+        #endif
         .iInterface             = NO_DESCRIPTOR,
         .iInterface             = NO_DESCRIPTOR,
     },
     },
     .cdc_hdr = {
     .cdc_hdr = {

+ 1 - 0
inc/usb_cdc.h

@@ -39,6 +39,7 @@
 
 
 /**\name Communications Class Protocol Codes
 /**\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.*/
 #define USB_CDC_PROTO_V25TER            0x01    /**<\brief AT Commands: V.250 etc.*/
  /** @} */
  /** @} */