Skip to main content

CBC Schema Specification (MAPS Messaging)

This document describes the actual CBC (Compact Binary Coding) schema format used by MAPS Messaging, based on the real implementation in FieldSpecification and the JSON schema produced by the server.

1. Overview

CBC is a bit‑packed binary encoding format.
Schemas define the exact bit layout for messages: there is no inference, no dynamic typing, no guessing.
The schema describes:

  • Application metadata
  • One or more messages
  • A list of fields for each message
  • The bit width and rules for each field
  • Optional encode/decode expressions
  • Nested structures

CBC is designed for constrained links (e.g., NTN, LoRa, satellite links) where every bit counts.


2. CBC Schema Structure

{
"application": "exampleApp",
"version": "1.0",
"description": "Example description",
"messages": [
{ /* message definition */ }
]
}

Top‑level fields

FieldTypeDescription
applicationstringNamespace or owner of this CBC schema
versionstringHuman‑readable schema version
descriptionstringDescription of the schema/application
messagesarrayList of messages encoded using CBC

3. Message Definition

{
"description": "A basic status message",
"direction": "UPLINK",
"name": "heartbeat",
"messageKey": 65280,
"fields": [ /* field list */ ]
}

Fields

FieldTypeDescription
namestringUnique message name
directionstring"UPLINK" or "DOWNLINK"
descriptionstringPurpose of the message
messageKeyintegerMessage identifier on the wire
fieldsarrayOrdered field specifications

Order matters. Bits are packed exactly in the order displayed.


4. Field Specification

The schema uses the JSON object produced by this Java method:

toFieldMap(FieldSpecification f)

Possible field attributes

NameTypeMeaning
namestringField name (only present for children; parent inserts manually)
typestringuint, int, bitmask, struct, etc.
sizeintegerBit width (required for numeric types)
optionalbooleanField may be omitted
fixedboolean (false only)Appears only when false, meaning field is not fixed-size
descriptionstringDocumentation
decalcstring (expression)Expression applied when decoding (raw → logical)
encalcstring (expression)Expression applied when encoding (logical → raw)
minnumber/integerMinimum logical value
maxnumber/integerMaximum logical value
enumobjectMapping "numeric_value": "label"
fieldsarrayNested fields (for type: "struct")

Example of encode/decode rules

{
"name": "latitude",
"type": "int",
"size": 18,
"decalc": "v/1000",
"encalc": "v*1000"
}

Raw 18‑bit integer is converted to degrees (and back).


5. Example CBC Schema (Heartbeat Message)

This is an actual valid MAPS CBC schema, matching your real field model:

{
"application": "viasatNtnProofOfConcept",
"version": "1.1",
"description": "Viasat NB-NTN proof of concept for efficient binary data transport",
"messages": [{
"description": "A basic health/config status message for NB-NTN devices.",
"direction": "UPLINK",
"name": "heartbeat",
"messageKey": 65280,
"fields": [
{ "name": "secOfDay", "type": "uint", "size": 17 },

{ "name": "location", "type": "struct", "optional": true, "fields": [
{ "name": "latitude", "type": "int", "size": 18, "decalc": "v/1000", "encalc": "v*1000" },
{ "name": "longitude", "type": "int", "size": 19, "decalc": "v/1000", "encalc": "v*1000" }
]},

{ "name": "signal", "type": "struct", "fields": [
{ "name": "rsrp", "type": "int", "size": 9 },
{ "name": "rsrq", "type": "int", "size": 6 },
{ "name": "sinr", "type": "int", "size": 6 },
{ "name": "rssi", "type": "int", "size": 9, "optional": true },
{ "name": "cellId","type": "uint","size": 32, "optional": true }
]},

{ "name": "psmConfig", "type": "struct", "optional": true, "fields": [
{ "name": "tauT3412", "type": "bitmask", "size": 8 },
{ "name": "actT3324", "type": "bitmask", "size": 8 }
]},

{ "name": "edrxConfig", "type": "struct", "optional": true, "fields": [
{ "name": "edrxCycle", "type": "bitmask", "size": 4 },
{ "name": "edrxPtw", "type": "bitmask", "size": 4 }
]},

{ "name": "counter", "type": "uint", "size": 16, "optional": true }
]
}]
}

This is the canonical form that matches the current server implementation.


6. Summary

CBC is:

  • Fully deterministic bit-packed encoding
  • Strictly defined in JSON
  • Supports nested structs
  • Supports optional fields
  • Supports encode/decode transforms
  • Supports enums
  • Already fully implemented in MAPS using FieldSpecification

This document should be used as the authoritative reference for users designing CBC schemas for IoT, NTN, LoRa, or satellite transport.