What depends on the ICD of a target stays in the code of its driver. What depends on the link (a spacecraft identifier, a CSP address, a virtual channel, a frame length) is a parameter of the link, declared in the topology. The same driver and transport then serve a flatsat and a flight model, or a unit on its integration bench and on the flatsat, with different values.
targets:
# The engineering model of the camera, on its integration bench, then on the CAN bus of the
# flatsat, where the ground has another CSP address.
cam-em-1:
platform: hsc-100@1.0.0
environments: [BENCH, FLATSAT]
links:
can:
driver: hsc-100-csp@1
transport: csp1-can@1
gateway: bench-can-1
default: true
params: {csp_address: 6}
environments:
FLATSAT: {params: {csp_address: 10}}
sat-fm-1:
platform: cubesat-6u@1.0.0
environments: [FM, in_orbit]
links:
sband:
driver: cubesat-6u-ccsds@1
transport: ccsds-tc@1
gateway: "any(tag: sband)"
default: true
params: {scid: 0x2C5, tm_length: 256}Declaring parameters#
paramsmaps names to booleans, numbers or text:{scid: 0x2C5, tm_ocf: true, t1: 2.5}. Names are identifiers (topology::invalid-param).environmentsoverrides them key by key for some environments of the target:FLATSAT: {params: {csp_address: 10}}. Keys not overridden keep their base value. The environments must be environments of the target (topology::unknown-link-environment).- Parameters belong to the link: they go to its driver and to its transport, each reading the keys it knows.
The link context#
With every telecommand to encode and every frame received, the driver and the transport receive a
context: target, link, environment, and the parameters resolved for that environment. Each
reads what concerns it. The hsc-100-csp driver takes the ground CSP address from csp_address;
the ccsds-tc transport takes its COP-1 and frame settings from scid, vcid, window…
The environment of a telecommand#
A telecommand carries the environment of its run. A direct telecommand may declare one (the
environment field of POST /v1/tc, stellar send --environment, the environment field of the
web form):
| Case | Environment used |
|---|---|
| Declared, and the target is engaged in it | That one |
| Declared, but the target is not engaged in it | Refused: tc::unknown-environment |
| Not declared, target engaged in a single environment | That one |
| Not declared, the link overrides parameters by environment, target engaged in several | Refused: tc::environment-required |
| Not declared otherwise | None: that of the last telecommand of the link, see below |
stellar send cam-em-1 camera.housekeeping --environment FLATSATA telecommand without environment, such as those the transfer manager sends, takes the
environment of the last telecommand of its link. On reception, a frame is decoded in the context
of the last telecommand of its link, or with the base parameters before any; the decoded values
then carry the header Stellar-Environment.
Parameter schemas#
At registration, a driver, a transport and a gateway may declare the JSON Schema of the parameters
they read (params_schema, an object schema with properties). A gateway declares the settings
of its port: rate, termination, electrical mode. When binding a link, the reconciler checks
the resolved parameters of every environment of the link, the base one included:
- each schema validates the keys it declares;
- a key that no component of the chain declares is refused, when the driver and the transport declare a schema; the schema of the gateway adds the keys of its port;
- a component without schema is not checked.
A refusal leaves the link unbound, with the reason in the readiness of the target:
link `can`: parameters of link in `FLATSAT` refused by driver `hsc-100-csp-1`: `csp_address`: 40 is greater than the maximum of 31Several targets on one gateway#
A CAN or RS-485 bus often carries several targets (the camera and the EPS of a flatsat): one gateway serves several links. Its parameters are of two kinds:
- port parameters, every key of the schema of the gateway but
rx_filter(rate, termination, electrical mode): one bus has one setting, so they must be equal on every link bound to the gateway, in the base parameters and in every environment. Otherwise none of these links is bound, each with the reasongateway-param-conflictnaming the key and the other link; rx_filter, a link parameter: which received frames go to the target of the link. On CAN,"0x200/0x700"(identifier and mask, hexadecimal or decimal),"0x211"or an integer (that identifier); on RS-485, the address the gateway reads. A link without filter takes every frame of the bus.
targets:
cam-em-1:
links:
bus: {driver: hsc-100-csp@1, transport: csp1-can@1, gateway: bench-can-1, params: {csp_address: 10, bitrate: 1000000, rx_filter: "0x6000000/0x1F000000"}}
eps-em-1:
links:
bus: {driver: cubesat-eps-csp@1, transport: csp1-can@1, gateway: bench-can-1, params: {csp_address: 10, bitrate: 1000000, rx_filter: "0x2000000/0x1F000000"}}The reconciler checks the port parameters when it binds, as the gateway declares them; the compiler does not know the schema of a gateway.
Parameters of the example components#
ccsds-tc (transport of space packets in CCSDS TC frames under COP-1, and back from TM
frames):
| Parameter | Type | Default | Meaning |
|---|---|---|---|
scid | integer 0–1023 | required | Spacecraft identifier of the TC and TM frames |
vcid | integer 0–63 | 0 | Virtual channel of the telecommands |
window | integer 1–255 | 10 | Sliding window K of the FOP, below W/2 of the FARM |
t1 | number, seconds, above 0 up to 3600 | 5 | Timer T1 of the FOP |
transmission_limit | integer 1–255 | 3 | Transmissions of a frame, the first one included |
tm_length | integer 16–2048 | 1115 | Length of the TM frames, in octets |
tm_ocf | boolean | true | TM frames with an Operational Control Field (the CLCW) |
tm_fecf | boolean | true | TM frames with a Frame Error Control Field |
csp1-kiss, csp2-kiss (CSP packets in KISS frames):
| Parameter | Type | Default | Meaning |
|---|---|---|---|
crc32 | boolean | true | Packets sent up with their CRC32 (CRC-32C), flagged in their header |
csp1-can, csp2-can (CSP packets on a CAN bus, CFP of libcsp):
| Parameter | Type | Default | Meaning |
|---|---|---|---|
crc32 | boolean | true | Packets sent up with their CRC32 (CRC-32C), flagged in their header |
via | integer 0–31 | the destination | CFP 1: the node of the bus the packets go through |
can_address | integer 0–63 | the source of the packet | CFP 2: the address of the CAN interface of the ground, sender of the frames |
reassembly_timeout_ms | integer, at least 1 | 1000 | How long a packet down may take to arrive whole |
hsc-100-csp (driver of the hsc-100 camera, in the payload integration repository):
| Parameter | Type | Default | Meaning |
|---|---|---|---|
csp_address | integer 0–31 | required | CSP address of the ground on the link |
See COP-1 and the Link Component for what the ccsds-tc settings do, and
Writing a Driver to read parameters from a driver or a transport.