Engineering Data Link
Note
Octets are used instead of bytes as octets are guaranteed to be 8 bits and bytes are not.
The main form of communication between OreSat and UniClOGS is thru the EDL (Engineering Data Link).
The EDL has Uplink and Downlink.
EDL Packet Structure
The EDL uses USLP (Unified Space Link Protocol) from CCSDS (The Consultative Committee for Space Data Systems).
USLP Primary Header (7 Octets) |
Sequence Number (4 Octets) |
USLP Data Field Header (1 Octet) |
Payload (X Octets) |
HMAC (32 Octets) |
USLP FECF (2 Octets) |
USLP Transfer Frame Data Zone |
|||||
USLP Transfer Frame Insert Zone |
USLP Transfer Frame Data Field |
||||
USLP Transfer Frame |
|||||
USLP Primary Header
Transfer Frame Version Number: 4 bits. Always
"C"in ASCII.Space Craft ID: 16 bits: Always
"OS"in ASCII (short for OreSat) .Source or Destination Identifier: 1 bit. Source (aka
0b1) is for UniClOGS and destination (aka0b0) is for OreSat.- Virtual Channel ID`: 6 bits.
Virtual channel
0b000000is used for C3 commands.Virtual channel
0b000001is used for file transfer.
MAP ID: 6 bits. Not used by OreSat (will always be
0b000000).End of Frame Primary Header Flag: 1 bit. Always
0b0.Frame Length: 16 bits. Length of entire packet minus one, in octets.
Bypass / Sequence Control Flag: 1 bit. Is set to
0b0to mark the packet is sequence controlled QoS will Frame Accepts Check of the FARM will not be bypassed.Protocol Control Command Flag: 1 bit. Will be set to
0b0to mark the TFDF is user data and not protocol controlled information, aka the packet contains a EDL payload.Reserve spare bits: 2 bits.
OCF (Operation Control Field) Flag: 1 bit. Set to
0b0, to mark the OCF is not included in packet.VC Frame Count Length: 3 bits. Is set to
0b000for no VCF Count bits.
Sequence Number
The sequence number is used to prevent repeat attacks. Is a 32-bit unsigned integer.
On every received packet, the C3 will increment its count. Any EDL packet received must have a
higher number that the C3 internal count, otherwise the C3 will ignore it. Number rolls over at
FF FF FF FF.
The sequence number will full take up the optional TFIZ (Transfer Frame Insert Zone) part of the USLP Transfer Frame.
USLP Data Field Header
TFDZ Construction Rules: 3 bits. Set to
0b111to mark variable length TFDZ that is not segmented.UPID (USLP Protocol Identifier): 5 bits. Set to
0b000101to mark the protocol in the TFDZ is mission specific.See https://sanaregistry.org/r/uslp_protocol_id/ for all definitions.
Payload
Differs between types. Length can differ, but it will always be at least 1 octet. If there is no payload, there is no reason for the EDL packet.
HMAC
32 octets HMAC used for authentication. If the HMAC fails, the packet will be rejected and no response will be sent back. For HMAC basics, see https://en.wikipedia.org/wiki/HMAC.
FECF (Frame Error Control Field)
For packet checking. Will be CRC16 (Cyclic redundancy check - length 16 bits) checksum of the rest of the packet. For CRC basics, see https://en.wikipedia.org/wiki/Cyclic_redundancy_check.
EDL C3 Command Packet
The payload of EDL Packet with C3 command will have 1 octet to defined which code it and arbitrary octets for data.
- class oresat_c3.protocols.edl_command.EdlCommandCode(value)[source]
The EDL telecommand codes.
- TX_CTRL = 0
Enable / Disable Tx.
- C3_SOFT_RESET = 1
Soft reset the C3 (reboot C3 daemon).
- C3_HARD_RESET = 2
Hard reset the C3 (reboot system).
- C3_FACTORY_RESET = 3
Factory reset the C3 (clear FRAM, reset RTC, and reboot system).
- CO_NODE_ENABLE = 4
Enable a CANopen node.
- Parameters:
node_id (uint8) – Node id of the CANopen node to enable / disable
enable (bool) – True to enable or False to disable
- Returns:
node status
- Return type:
uint8
- CO_NODE_STATUS = 5
Get the status of a CANopen node.
- Parameters:
node_id (uint8) – Node id of node to get the status for
- Returns:
node status
- Return type:
uint8
- CO_SDO_WRITE = 6
Write a value to a node’s OD over the CAN bus using a CANopen SDO message.
- Parameters:
node_id (uint8) – The id of The CANopen node to write to.
index (uint16) – The OD index to write to.
subindex (uint8) – The OD subindex to write to.
size (uint32) – Size of the data buffer.
buffer (bytes) – Data buffer.
- Returns:
SDO error code (0 is no error).
- Return type:
uint32
- CO_SYNC = 7
Send a CANopen SYNC message on the CAN bus.
- Returns:
The CANopen SYNC message was sent successfully.
- Return type:
- OPD_SYSENABLE = 8
Enable the OPD subsystem.
- OPD_SCAN = 9
Scan for all nodes on the OPD.
- Returns:
The number of nodes found.
- Return type:
uint8
- OPD_PROBE = 10
Probe for a node on the OPD.
- Parameters:
node_id (uint8) – The id of the OPD node to probe for.
- Returns:
True if the node was found or False if not.
- Return type:
- OPD_ENABLE = 11
Enable / disable a node on the OPD.
- Parameters:
node_id (uint8) – The id of the OPD node to enable / disable.
enable (bool) – True to enable or False to disable.
- Returns:
OPD node status. See the OPD page.
- Return type:
uint8
- OPD_RESET = 12
Reset a node on the OPD.
- Parameters:
node_id (uint8) – The id of the OPD node to reset.
- Returns:
OPD node status. See the OPD page.
- Return type:
uint8
- OPD_STATUS = 13
Get the status of a node on the OPD.
- Parameters:
node_id (uint8) – The id of the OPD node to get the status of.
- Returns:
OPD node status. See the OPD page.
- Return type:
uint8
- RTC_SET_TIME = 14
Set the RTC time
- Parameters:
time (uint32) – The Unix time in seconds.
- Returns:
The RTC time was set successfully.
- Return type:
- TIME_SYNC = 15
C3 will send OreSat’s Time Sync TPDO over the CAN bus (all nodes that are powered on and care about time will sync to it).
- Returns:
Time sync was sent.
- Return type:
- BEACON_PING = 16
C3 will response with a beacon regardless of tx state.
- PING = 17
A basic ping to the C3.
- Parameters:
value (uint32) – A value to return.
- Returns:
The parameter value.
- Return type:
uint32
- RX_TEST = 18
Empty command for C3 Rx testing.
- CO_SDO_READ = 19
Read a value from a node’s OD over the CAN bus using a CANopen SDO message.
- Parameters:
node_id (uint8) – The id of The CANopen node to write to.
index (uint16) – The OD index to write to.
subindex (uint8) – The OD subindex to write to.
- Returns:
uint32 – SDO error code (0 is no error).
uint32 – Size of the data buffer.
bytes – Data buffer.
EDL File Transfer Packet
The EDL uses CCSDS File Delivery Protocol (CFDP) for file transfer. The CCSDS PDU packets will be used as the payload of the main USLP packet.