Skip to content

Add EC21 (2C7C:0121) as a supported USB identity - #2

Open
aabolfazl wants to merge 1 commit into
skyrocketingHong:mainfrom
aabolfazl:add-ec21-usb-identity
Open

Add EC21 (2C7C:0121) as a supported USB identity#2
aabolfazl wants to merge 1 commit into
skyrocketingHong:mainfrom
aabolfazl:add-ec21-usb-identity

Conversation

@aabolfazl

Copy link
Copy Markdown

Problem

The USB identity allowlist in ModuleUSBIdentity covers 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

  • 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).

No transport change is needed: EC25Transport already opens the first bulk interface that answers AT rather 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:

+QCFG: "usbcfg",0x2C7C,0x0121,1,1,1,1,1,0,0

Mapped through USBInterfaceKind, that is diag/nmea/at_port/modem/rmnet enabled and adb/uac disabled — five interfaces, matching what the host enumerates.

ioreg confirms the app binds the AT interface:

+-o IOUSBHostInterface@2   "bInterfaceNumber" = 2
  +-o EC25Toolbox           "IOUserClientCreator" = "pid …, EC25Toolbox"

AT channel against a live network:

ATI            -> Quectel / EC21 / Revision: EC21EUXGAR08A08M1G
AT+CPIN?       -> +CPIN: READY
AT+CIMI        -> (IMSI returned)
AT+QCCID       -> (ICCID returned)
AT+CSQ         -> +CSQ: 23,99
AT+CREG?       -> +CREG: 0,1
AT+COPS?       -> +COPS: 0,0,"<operator>",7

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant