Allow self-blacklisting of devices with serial and Ethernet port
Embedded development boards running RIOT-OS have recently gained support for CDC-ACM and CDC-ECM devices. When both are present, this triggers the "port allowed: device also exports a net interface" heuristics exception to a serial port that would otherwise not be probed under the strict policy.
Given that a RIOT board uses its serial console for a command prompt and will usually not respond to AT commands (and if it did, it'd set the bInterfaceProtocol(?) to indicate that), this is an annoyance that needlessly prolongs development times, confuses users and makes them angry with RIOT and/or ModemManager, neither of which is desirable.
I'd like to suggest three possible ways to counteract this, in descending order of preference:
- Sharpen the "it has both so let's probe it" heuristic to not match RIOT devices. (I don't know which devices that heuristic is for, so can't elaborate much. Maybe this could be limited to known vendors?)
- Allow devices to explicitly opt out of that heuristic. Maybe there's a bInterfaceProtocol that indicates "telnet style command prompt"? I've tried setting it to 254/255, but that caused "bad CDC descriptors" errors and 255 said something something RNDIS – so quite possibly Linux won't accept those, but something along those lines could be set that's within the specs, recognized by all wide-spread OSes and tells ModemManager to leave its probes off. Maybe this can also go into the association descriptor we're providing for things to work on Windows (indicating "yes this is just a standalone CDC, just create the com for it"). Possibly, the presence of this indicator (AFAICT used only on recent devices that should really set an explicit AT bInterfaceProtocol if they want it) could be used to suspend the "also exports a net interface" heuristic.
- Blacklising the generic RIOT IDs.
What would work from a ModemManager point of view? Can we find a solution that works for embedded projects in general as guidance for how to keep ModemManager from interfering with them?