diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2019-06-08 21:50:17 +0200 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2019-06-08 21:50:17 +0200 |
commit | b237dcc8e23abb9e79228e3a175a5286131f9f7a (patch) | |
tree | 5d76b60c7236496e8b562b7450edc58ddc0d4842 | |
parent | 7a2e1cd815266fef3012a5c9b48f88d78551f838 (diff) |
Do not claim AT-protocol in CDC interface descriptor
The CDC code presents itself as a virtual serial port. However, it also
sets the "bFunctionProtocol" value to 1, which means it supports
AT-commands, which is not actually the case. This might cause problems
with some software, such as ModemManager.
Originally, ModemManager would be very liberal with probing serial
devices, using a blacklist to prevent probing non-modems such as
Arduinos.
Since version 1.7.990, it has supported a "strict" mode where it tries to be
more restrained in what devices it probes. For CDC ACM devices, this
means it will only probe devices that claim to support AT-commands.
However, it also stopped applying the blacklist (intending to eventually
remove the blacklist), meaning it would again probe Arduinos.
This new strict policy is not the upstream default, but is enabled in
Debian (since Buster) and Ubuntu (since bionic 18.04.2).
The proper way to fix this, is to not claim AT comand support in the USB
device descriptor, which is what this commit does. The Arduino will
still show up as a virtual serial port, just not be probed by
ModemManager in strict mode.
For the commit that introduced the strict mode in ModemManager, see
https://cgit.freedesktop.org/ModemManager/ModemManager/commit/src?id=ee570d44dc117dc69f23e83313dd877f76c5e3e0
-rw-r--r-- | cores/arduino/CDC.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 142f8f6..4ff6b9b 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -41,7 +41,7 @@ static u8 wdtcsr_save; extern const CDCDescriptor _cdcInterface PROGMEM; const CDCDescriptor _cdcInterface = { - D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,1), + D_IAD(0,2,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0), // CDC communication interface D_INTERFACE(CDC_ACM_INTERFACE,1,CDC_COMMUNICATION_INTERFACE_CLASS,CDC_ABSTRACT_CONTROL_MODEL,0), |