Skip to content

Commit 6d756f7

Browse files
authored
Specify dictionary types as required by GDS (#4442)
* Specify dictionary types as required by GDS * Update requirements.txt for fprime-tools * Update documentation referencing type
1 parent 8cbba54 commit 6d756f7

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

Ref/fprime-gds.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
command-line-options:
2-
scid: 0x0044
32
framing-selection: space-packet-space-data-link

default/config/ComCfg.fpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
# ======================================================================
44

55
@ The width of packet descriptors when they are serialized by the framework
6-
type FwPacketDescriptorType = U16
6+
dictionary type FwPacketDescriptorType = U16
77
constant SIZE_OF_FwPacketDescriptorType = 2 @< Size of FwPacketDescriptorType in bytes
88

99
module ComCfg {
1010

11-
# Needed in dictionary:
12-
# - spacecraftId
13-
# - TmFrameFixedSize
14-
# - potentially APID enum ?
15-
constant SpacecraftId = 0x0044 # Spacecraft ID (10 bits)
16-
constant TmFrameFixedSize = 1024 # Needs to be at least COM_BUFFER_MAX_SIZE + (2 * SpacePacketHeaderSize) + 1
11+
@ Spacecraft ID (10 bits) for CCSDS Data Link layer
12+
dictionary constant SpacecraftId = 0x0044
13+
14+
@ Fixed size of CCSDS TM frames
15+
dictionary constant TmFrameFixedSize = 1024 # Needs to be at least COM_BUFFER_MAX_SIZE + (2 * SpacePacketHeaderSize) + 1
16+
17+
@ Aggregation buffer for ComAggregator component
1718
constant AggregationSize = TmFrameFixedSize - 6 - 6 - 1 - 2 # 2 header (6) + 1 idle byte + 2 trailer bytes
1819

1920
@ APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF
20-
enum Apid : FwPacketDescriptorType {
21+
dictionary enum Apid : FwPacketDescriptorType {
2122
# APIDs prefixed with FW are reserved for F Prime and need to be present
2223
# in the enumeration. Their values can be changed
2324
FW_PACKET_COMMAND = 0x0000 @< Command packet type - incoming

default/config/FpConfig.fpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type FwTaskIdType = PlatformTaskIdType
5151
####
5252

5353
@ The type of a telemetry channel identifier
54-
type FwChanIdType = FwIdType
54+
dictionary type FwChanIdType = FwIdType
5555
constant SIZE_OF_FwChanIdType = SIZE_OF_FwIdType @< Size of FwChanIdType in bytes
5656

5757
@ The type of a data product identifier
@@ -61,22 +61,22 @@ type FwDpIdType = FwIdType
6161
type FwDpPriorityType = U32
6262

6363
@ The type of an event identifier
64-
type FwEventIdType = FwIdType
64+
dictionary type FwEventIdType = FwIdType
6565
constant SIZE_OF_FwEventIdType = SIZE_OF_FwIdType @< Size of FwEventIdType in bytes
6666

6767
@ The type of a command opcode
68-
type FwOpcodeType = FwIdType
68+
dictionary type FwOpcodeType = FwIdType
6969
constant SIZE_OF_FwOpcodeType = SIZE_OF_FwIdType @< Size of FwOpcodeType in bytes
7070

7171
@ The type of a parameter identifier
7272
type FwPrmIdType = FwIdType
7373
constant SIZE_OF_FwPrmIdType = SIZE_OF_FwIdType @< Size of FwPrmIdType in bytes
7474

7575
@ The type used to serialize a size value
76-
type FwSizeStoreType = U16
76+
dictionary type FwSizeStoreType = U16
7777

7878
@ The type used to serialize a time context value
79-
type FwTimeContextStoreType = U8
79+
dictionary type FwTimeContextStoreType = U8
8080

8181
@ The type of a telemetry packet identifier
8282
type FwTlmPacketizeIdType = U16
@@ -92,9 +92,10 @@ type FwEnumStoreType = I32
9292
type FwTimeBaseStoreType = U16
9393

9494
@ Define enumeration for Time base types
95-
enum TimeBase : FwTimeBaseStoreType {
95+
dictionary enum TimeBase : FwTimeBaseStoreType {
9696
TB_NONE = 0 @< No time base has been established (Required)
9797
TB_PROC_TIME = 1 @< Indicates time is processor cycle time. Not tied to external time
9898
TB_WORKSTATION_TIME = 2 @< Time as reported on workstation where software is running. For testing. (Required)
99+
TB_SC_TIME = 3, @< Time as reported by the spacecraft clock.
99100
TB_DONT_CARE = 0xFFFF @< Don't care value for sequences. If FwTimeBaseStoreType is changed, value should be changed (Required)
100101
} default TB_NONE;

default/config/FpConstants.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ constant FW_ASSERT_COUNT_MAX = 10
8080
constant FW_CONTEXT_DONT_CARE = 0xFF
8181
8282
@ Value encoded during serialization for boolean true
83-
constant FW_SERIALIZE_TRUE_VALUE = 0xFF
83+
dictionary constant FW_SERIALIZE_TRUE_VALUE = 0xFF
8484
8585
@ Value encoded during serialization for boolean false
86-
constant FW_SERIALIZE_FALSE_VALUE = 0x00
86+
dictionary constant FW_SERIALIZE_FALSE_VALUE = 0x00

docs/user-manual/gds/gds-test-api-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ The TimeType serializable stores timestamp information for both events and telem
375375
> Math operations between TimeType objects of different time_bases or time_context will return a TimeType with the same base and context as the left operand.
376376
377377
```python
378-
from fprime.common.models.serialize.time_type import TimeType
378+
from fprime_gds.common.models.serialize.time_type import TimeType
379379

380380
t0 = TimeType() # 0.0 seconds
381381

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Flask-RESTful==0.3.10
2121
fprime-fpl-layout==1.0.3
2222
fprime-fpl-write-pic==1.0.3
2323
fprime-fpp==3.1.0a10
24-
fprime-gds==4.0.2a10
25-
fprime-tools==4.0.2a1
24+
fprime-gds==4.0.2a11
25+
fprime-tools==4.0.2a2
2626
fprime-visual==1.0.2
2727
gcovr==8.2
2828
idna==3.10

0 commit comments

Comments
 (0)