{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CoreCharge cabinet protocol v1.51 public test vectors",
  "version": "1.51",
  "containsProductionData": false,
  "testOnlyPassword": "DEMO00",
  "notes": [
    "The password suffix participates in CRC input but is not sent in the wire frame.",
    "Identifiers are synthetic and do not map to any device, order, SIM or power bank.",
    "Use the same order ID for idempotent retries."
  ],
  "crcPrimitive": {
    "input": "123456789",
    "expectedCrc16Modbus": "4B37"
  },
  "validFrames": [
    {
      "id": "cq-all-slots-query",
      "dataWithoutCrc": "CQ,17000000,0",
      "crcInput": "CQ,17000000,0,DEMO00",
      "expectedCrc": "6F75",
      "frame": "{CQ,17000000,0,6F75}"
    },
    {
      "id": "cn-online-4g-synthetic",
      "dataWithoutCrc": "CN,DEVICE-000001,MODEM-000001,V1.51,-67,SIM-000001,0,0",
      "crcInput": "CN,DEVICE-000001,MODEM-000001,V1.51,-67,SIM-000001,0,0,DEMO00",
      "expectedCrc": "796B",
      "frame": "{CN,DEVICE-000001,MODEM-000001,V1.51,-67,SIM-000001,0,0,796B}"
    },
    {
      "id": "cn-server-ack-synthetic",
      "dataWithoutCrc": "CN,DEVICE-000001,HB:60;BP:180;",
      "crcInput": "CN,DEVICE-000001,HB:60;BP:180;,DEMO00",
      "expectedCrc": "8E6D",
      "frame": "{CN,DEVICE-000001,HB:60;BP:180;,8E6D}"
    },
    {
      "id": "ac-two-slot-inventory",
      "dataWithoutCrc": "AC,17000003,DEVICE-000001,MODEM-000001,SIM-000001,-67,V1.51,2,1:1:PB-000001:88:1110,2:1:NULL:0:0110",
      "crcInput": "AC,17000003,DEVICE-000001,MODEM-000001,SIM-000001,-67,V1.51,2,1:1:PB-000001:88:1110,2:1:NULL:0:0110,DEMO00",
      "expectedCrc": "40AA",
      "frame": "{AC,17000003,DEVICE-000001,MODEM-000001,SIM-000001,-67,V1.51,2,1:1:PB-000001:88:1110,2:1:NULL:0:0110,40AA}"
    },
    {
      "id": "bw-prepare-fast-charge",
      "dataWithoutCrc": "BW,17000004,ORDER-0001,1",
      "crcInput": "BW,17000004,ORDER-0001,1,DEMO00",
      "expectedCrc": "E6AD",
      "frame": "{BW,17000004,ORDER-0001,1,E6AD}"
    },
    {
      "id": "br-selection-ack",
      "dataWithoutCrc": "BR,17000005,ORDER-0001",
      "crcInput": "BR,17000005,ORDER-0001,DEMO00",
      "expectedCrc": "B87F",
      "frame": "{BR,17000005,ORDER-0001,B87F}"
    },
    {
      "id": "fb-release-selected-slot",
      "dataWithoutCrc": "FB,17000006,ORDER-0001,2",
      "crcInput": "FB,17000006,ORDER-0001,2,DEMO00",
      "expectedCrc": "8395",
      "frame": "{FB,17000006,ORDER-0001,2,8395}"
    },
    {
      "id": "rs-successful-return",
      "dataWithoutCrc": "RS,17000007,DEVICE-000001,1,2,PB-000001,88,1,1",
      "crcInput": "RS,17000007,DEVICE-000001,1,2,PB-000001,88,1,1,DEMO00",
      "expectedCrc": "D1B9",
      "frame": "{RS,17000007,DEVICE-000001,1,2,PB-000001,88,1,1,D1B9}"
    }
  ],
  "negativeVectors": [
    {
      "id": "wrong-crc",
      "frame": "{CQ,17000000,0,0000}",
      "expectedCategory": "INTEGRITY_FAILED"
    },
    {
      "id": "missing-end-marker",
      "frame": "{CQ,17000000,0,6F75",
      "expectedCategory": "FRAME_INCOMPLETE"
    },
    {
      "id": "lowercase-command",
      "frame": "{cq,17000000,0,6F75}",
      "expectedCategory": "FIELD_VALUE_INVALID"
    },
    {
      "id": "duplicate-order-id",
      "firstFrame": "{FB,17000006,ORDER-0001,2,8395}",
      "retryRule": "Return the cached prior result; do not release a second power bank.",
      "expectedCategory": "DUPLICATE_OBSERVED"
    }
  ]
}
