Add EC21 (2C7C:0121) as a supported USB identity - #2
Open
aabolfazl wants to merge 1 commit into
Open
Conversation
The identity allowlist was limited to the EC25-compatible profile
(2C7C:0125) and the first-generation DJI dongle (2CA3:4006), so an EC21
series module was never opened even though it exposes the same USB
composition and an EC25-style AT interface.
- Add `ModuleUSBIdentity.ec21` (2C7C:0121) and include it in
`connectionOrder`.
- Rewrite `ModemNICMatcher.isSupportedIdentity` to iterate `allCases`
instead of comparing two hard-coded identities, so it cannot go stale
when another identity is added.
- Return `nil` from `targetIdentity` for `.ec21`: there is no defined
counterpart identity for a real EC21, and offering the switch would
write `AT+QCFG="usbcfg"` and change the module's own composition.
- Add the `moduleconfig.identity.ec21` label and mention 2C7C:0121 in
the identity help text (en, zh-Hans).
`EC25Transport` already probes for the first bulk interface that answers
`AT` rather than assuming an interface number, so no transport change is
needed.
Verified on an EC21-EUX (firmware EC21EUXGAR08A08M1G) on macOS 26.6.2.
The module reports the same composition the EC25 profile expects:
+QCFG: "usbcfg",0x2C7C,0x0121,1,1,1,1,1,0,0
which maps to diag/nmea/at_port/modem/rmnet enabled and adb/uac
disabled. `ioreg` confirms the app claims interface 2 (at_port), and
ATI, AT+CPIN?, AT+CIMI, AT+QCCID, AT+CSQ, AT+CREG? and AT+COPS? all
return correctly against a live network.
Features beyond the AT channel (voice, eUICC, VoWiFi, networking) were
not exercised on this module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The USB identity allowlist in
ModuleUSBIdentitycovers only the EC25-compatible profile (2C7C:0125) and the first-generation DJI dongle (2CA3:4006). An EC21 series module (2C7C:0121) is therefore never opened, even though it exposes the same USB composition and an EC25-style AT interface.Change
ModuleUSBIdentity.ec21(2C7C:0121) and include it inconnectionOrder.ModemNICMatcher.isSupportedIdentityto iterateallCasesinstead of comparing two hard-coded identities, so it cannot go stale when another identity is added.nilfromtargetIdentityfor.ec21. There is no defined counterpart identity for a real EC21, and offering the switch would writeAT+QCFG="usbcfg"and change the module's own composition.moduleconfig.identity.ec21label and mention2C7C:0121in the identity help text (en, zh-Hans).No transport change is needed:
EC25Transportalready opens the first bulk interface that answersATrather than assuming an interface number.Verification
Tested on an EC21-EUX, firmware
EC21EUXGAR08A08M1G, macOS 26.6.2 (arm64), module on a Mini PCIe-to-USB adapter with a live SIM and the main antenna connected.The module reports the same composition the EC25 profile expects:
Mapped through
USBInterfaceKind, that isdiag/nmea/at_port/modem/rmnetenabled andadb/uacdisabled — five interfaces, matching what the host enumerates.ioregconfirms the app binds the AT interface:AT channel against a live network:
Scope and limits
Only the AT channel was exercised on this module. Voice/
QPCMV, eUICC, VoWiFi and the networking features were not tested against an EC21 and may depend on behaviour this module does not share with the EC25.The project builds against the macOS 27 SDK; this branch contains no changes outside the identity allowlist and its localization.