Errors and test vectors
Processing categories
Command result codes describe device behavior. The categories below describe where the server parser or workflow stopped.
| Category | Meaning | Default handling |
|---|---|---|
FRAME_INCOMPLETE | Start or end boundary is missing | Reject and retain transport evidence |
FIELD_COUNT_INVALID | Field count does not match the command/profile | Reject before business handling |
FIELD_VALUE_INVALID | Type, case, length or range is invalid | Reject with a redacted field pointer |
INTEGRITY_FAILED | CRC does not match | Reject; do not execute the command |
VERSION_UNSUPPORTED | Command or field shape is outside the cabinet profile | Quarantine and request profile review |
DUPLICATE_OBSERVED | Message/order/return was already accepted | Return the idempotent prior result |
STATE_CONFLICT | Frame is valid but conflicts with accepted rental/payment/return state | Hold for reconciliation |
DEPENDENCY_UNAVAILABLE | Device, payment or provider evidence is unavailable | Preserve UNKNOWN; retry by policy |
Device result codes
- Rental/release
0/1/2/100/110: see Rental and return. - Return
0/1/2and abnormal return2/4: see RS/FR. - Maintenance acceptance
0/1: see Device management. - OTA
1/10progress/success and>=200failure: see OT. - Slot/battery health
0/1/2/3/201/202/203: see AE.
Do not interpret the same numeric value across unrelated commands without the command context.
Downloadable vectors
The test-vector JSON contains:
- The standard CRC16/MODBUS check value
123456789 -> 4B37. - Valid
CQ,CN,AC,BW,BR,FBandRSframes. - Exact CRC input strings showing where the test PW suffix is appended.
- Wrong CRC, missing marker, lowercase command and duplicate-order negatives.
The vectors use test-only PW DEMO00. Never replace it with a production PW in a public file or browser bundle.
Local verification
import {verifyFrame} from './protocol-v151.mjs';
const result = verifyFrame('{CQ,17000000,0,6F75}', 'DEMO00');
if (!result.valid) throw new Error('CRC verification failed');
Conformance requires both parser vectors and physical UAT. A parser can prove that a frame is well formed; it cannot prove that a lock opened, a power bank was removed, payment succeeded or a return was physically seated.