Proposed (batch stackra-50, STA-1097, STA-904). The vendor-SDK ADR that 0442 decision 4 and 0253
decision 3 ask for, for the
sunmi family. Certification pending: written from Sunmi’s public SDK
documents, not yet checked on a certified model.Amended by
0478
(2026-10-28): decision 2’s Kotlin moves out of the till app’s
src/native-sources/sunmi/ into the
printer, drawer and scanner module packages, split by capability, and the drivers move with it.
The rest of this page stands.Context
0442 (accepted by the owner on 2026-10-27, decision D4 of the Stackra finish plan; its page still waits to land here) gives the commerce till an Android target and asks for one ADR per vendor SDK before a family’s first build (0442 decision 4, 0253 decision 3). Sunmi’s terminals have a built-in printer, a drawer port and a built-in scanner that no Web API or LAN path reaches; only Sunmi’s SDK does (0339 open detail 2).Decision
- Driver name
sunmi.@stackra/peripheralsshipsSunmiReceiptPrinterDriver,SunmiCashDrawerDriverandSunmiBarcodeScannerDriverin its./nativeentry, behind the unchangedReceiptPrinter,CashDrawerandBarcodeScannerports, selected byperipherals.printer,.drawerand.scannerset tosunmi. - One Expo module,
StackraSunmi, a pass-through. The till app links an Expo module namedStackraSunmionly when its runway listsdevice:sunmi(0442 decision 3). It exposesprinterStatus(),printLines(lines),openDrawer()and anonScanevent carrying{ code }, each a direct call to the Sunmi printer service (woyou.aidlservice.jiuiv5, bound through Sunmi’s printer library):updatePrinterState()for the status, text printing with a line feed and the paper cut on models with a cutter, andopenDrawer()on models with a drawer port; the built-in scan head’s decoded-code broadcast for the scanner. The module maps nothing: it returns the SDK’s own status number and the decoded text. Its Kotlin lives in the till app’ssrc/native-sources/sunmi/(0345 decision 6). - Readiness in the driver.
updatePrinterState()answers 1 when the printer is normal; every other value (out of paper, overheated, cover open, no printer) refuses, with capabilityprint(ADR 0250 decision 3). The drawer is driven by the printer, so it checks the same status before each kick; the kick is one-way. - Text, not commands. Receipt lines go to the SDK as text with control characters removed; the SDK draws them. Arabic shaping is the SDK font’s and is a certification row. A raster or code-page path is not built.
- Absent means refused. In a build without
StackraSunmi(web, desktop, another family) the printer and drawer refuse withprintand the scanner withscanner; a subscription there does nothing. No call throws at the till. - The SDK stays the vendor’s. The SDK artefacts come from Sunmi’s developer portal and its Maven artefacts under Sunmi’s terms and are linked by the till app’s build only; this repository holds no Sunmi binary or source.
Consequences
- The till drives a Sunmi terminal’s printer, drawer and scanner with the same ports and settings as the desktop till.
- The status table is one line of
POS_DEVICE_FAMILIES; the tests replay transcribed SDK answers until certified models are recorded (STA-739), and a wrong code shows there first. - The Kotlin module, the config plugin that removes it from other families’ builds, and the model list are the till template’s and Runway’s work (0442 decisions 3 and 5), not this package’s.
- Card payment, the label printer and the scale on these terminals are not covered; an acquirer SDK is its own ADR
(0442 decision 6). The second screen stays the
externalcustomer display (0430).
Enforcement
packages/experience/peripherals/src/native/**/__tests__/*.test.tsreplay thesunmifixture through a stand-inStackraSunmimodule.- planned — a certification run on each certified Sunmi model (STA-739) records the fixture again; Runway refuses an
Android till build listing
device:sunmiwithout this ADR (0442 enforcement).
Supersedes and sources
Supersedes: none. Sources: owner decision D4 of 2026-10-27 (notes/handover/batches/STACKRA-FINISH.md), the 0442
draft (notes/handover/app-shells/adr/0442-native-android-till-for-pos-terminals-from-the-commerce-till-template.mdx),
Sunmi’s public SDK documents, STA-904, STA-1097.