@@ -4,41 +4,47 @@ The RTC Manager component interfaces with the RTC Real Time Clock (RTC) to provi
44
55### Typical Usage
66
7- #### ` timeGetPort ` Port Usage
7+ #### ` TIME_SET ` Command Usage
881 . The component is instantiated and initialized during system startup
9- 2 . In a deployment topology, a ` time connection ` is made to the component's ` timeGetPort ` port
9+ 2 . A ground station sends a ` TIME_SET ` command with the desired time
10+ 3 . On each command, the component:
11+ - Sets the time on the RTC
12+ - Emits a ` TimeSet ` event if the time is set successfully
13+ - Emits a ` TimeNotSet ` event if the time is not set successfully
14+ - Emits a ` DeviceNotReady ` event if the device is not ready
1015
11- #### ` timeGet ` Port Usage
16+ #### ` timeGetPort ` Port Usage
12171 . The component is instantiated and initialized during system startup
13- 2 . A manager calls the ` timeGet ` ports
18+ 2 . In a deployment topology, a ` time connection ` relation is made.
14193 . On each call, the component:
15- - Fetches and returns the time from the RTC RTC
20+ - Fetches and returns the time from the RTC
1621 - Emits a ` DeviceNotReady ` event if the device is not ready
1722
18- #### ` timeSet ` Port Usage
23+ #### ` timeGet ` Port Usage
19241 . The component is instantiated and initialized during system startup
20- 2 . A manager calls the ` timeSet ` ports
25+ 2 . A manager calls the ` timeGet ` ports
21263 . On each call, the component:
22- - Sets the time on the RTC RTC
23- - Emits a ` TimeSet ` event if the time is set successfully
24- - Emits a ` TimeNotSet ` event if the time is not set successfully
27+ - Fetches and returns the time from the RTC
2528 - Emits a ` DeviceNotReady ` event if the device is not ready
2629
2730## Requirements
2831| Name | Description | Validation |
2932| ---| ---| ---|
30- | RtcManager-001 | Time can be set on the RTC through a port | Manual |
31- | RtcManager-002 | Time can be read from the RTC through a port | Manual |
33+ | RtcManager-001 | The RTC Manager has a command that sets the time on the RTC | Integration test |
34+ | RtcManager-002 | The RTC Manager has a port which, when called, set the time in FPrime | Integration test |
3235| RtcManager-003 | A device not ready event is emitted if the RTC is not ready | Manual |
33- | RtcManager-004 | A time set event is emitted if the time is set successfully | Manual |
34- | RtcManager-005 | A time not set event is emitted if the time is not set successfully | Manual |
36+ | RtcManager-004 | A time set event is emitted if the time is set successfully | Integration test |
37+ | RtcManager-005 | A time not set event is emitted if the time is not set successfully | Integration test |
3538
3639## Port Descriptions
3740| Name | Description |
3841| ---| ---|
3942| timeGetPort | Time port for FPrime topology connection to get the time from the RTC |
40- | timeSet | Input port sets the time on the RTC |
41- | timeGet | Input port reads the time from the RTC |
43+
44+ ## Commands
45+ | Name | Description |
46+ | ---| ---|
47+ | SET_TIME | Sets the time on the RTC |
4248
4349## Events
4450| Name | Description |
@@ -59,8 +65,8 @@ classDiagram
5965 + RtcManager(char* compName)
6066 + ~RtcManager()
6167 - void timeGetPort_handler(FwIndexType portNum, Fw::Time& time)
62- - U32 timeGet_handler(FwIndexType portNum )
63- - void timeSet_handler(FwIndexType portNum, const Drv::TimeData& time )
68+ - Fw::CmdResponse timeSet_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq, const Drv::TimeData& time )
69+ - Fw::Time timeGet(U32& posix_time, U32& u_secs )
6470 }
6571 }
6672 RtcManagerComponentBase <|-- RtcManager : inherits
@@ -78,11 +84,11 @@ sequenceDiagram
7884 participant Deployment Time Connection
7985 participant RTC Manager
8086 participant Zephyr Time API
81- participant RTC RTC
87+ participant RTC
8288 Deployment Time Connection-->>RTC Manager: Call timeGetPort time port
8389 RTC Manager->>Zephyr Time API: Read time
84- Zephyr Time API->>RTC RTC : Read time
85- RTC RTC ->>Zephyr Time API: Return time
90+ Zephyr Time API->>RTC: Read time
91+ RTC->>Zephyr Time API: Return time
8692 Zephyr Time API->>RTC Manager: Return time
8793 RTC Manager-->>Deployment Time Connection: Return time
8894```
@@ -94,70 +100,32 @@ sequenceDiagram
94100 participant Deployment Time Connection
95101 participant RTC Manager
96102 participant Zephyr Time API
97- participant RTC RTC
103+ participant RTC
98104 Deployment Time Connection->>RTC Manager: Call timeGetPort time port
99105 RTC Manager->>Zephyr Time API: Read time
100- Zephyr Time API->>RTC RTC : Read time
101- RTC RTC ->>Zephyr Time API: Return device not ready
106+ Zephyr Time API->>RTC: Read time
107+ RTC->>Zephyr Time API: Return device not ready
102108 Zephyr Time API->>RTC Manager: Return device not ready
103109 RTC Manager->>Event Log: Emit DeviceNotReady event
104110 RTC Manager->>Deployment Time Connection: Return 0 time
105111```
106112
107- ### ` timeGet ` port
108-
109- The ` timeGet ` port is called from a manager component to get the current time from the RTC.
110-
111- #### Success
112- ``` mermaid
113- sequenceDiagram
114- participant Event Log
115- participant Manager
116- participant RTC Manager
117- participant Zephyr Time API
118- participant RTC RTC
119- Manager-->>RTC Manager: Call timeGet synchronous input port
120- RTC Manager->>Zephyr Time API: Read time
121- Zephyr Time API->>RTC RTC: Read time
122- RTC RTC->>Zephyr Time API: Return time
123- Zephyr Time API->>RTC Manager: Return time
124- RTC Manager->>Event Log: Emit event GetTime
125- ```
126-
127- #### Device Not Ready
128- ``` mermaid
129- sequenceDiagram
130- participant Event Log
131- participant Manager
132- participant RTC Manager
133- participant Zephyr Time API
134- participant RTC RTC
135- Manager-->>RTC Manager: Call timeGet synchronous input port
136- RTC Manager->>Zephyr Time API: Read time
137- Zephyr Time API->>RTC RTC: Read time
138- RTC RTC->>Zephyr Time API: Return device not ready
139- Zephyr Time API->>RTC Manager: Return device not ready
140- RTC Manager->>Event Log: Emit event DeviceNotReady
141- ```
142-
143- ### ` timeSet ` port
113+ ### ` TIME_SET ` Command
144114
145- The ` timeSet ` port is called from a manager component to set the current time on the RTC.
115+ The ` TIME_SET ` command is called to set the current time on the RTC.
146116
147117#### Success
148118``` mermaid
149119sequenceDiagram
150120 participant Ground Station
151121 participant Event Log
152- participant Manager
153122 participant RTC Manager
154123 participant Zephyr Time API
155- participant RTC RTC
156- Ground Station-->>Manager: Command to set time with Drv::TimeData struct
157- Manager->>RTC Manager: Call the timeSet synchronous input port with Drv::TimeData struct
124+ participant RTC
125+ Ground Station-->>RTC Manager: Command to set time with Drv::TimeData struct
158126 RTC Manager->>Zephyr Time API: Set time
159- Zephyr Time API->>RTC RTC : Set time
160- RTC RTC ->>Zephyr Time API: Return set success
127+ Zephyr Time API->>RTC: Set time
128+ RTC->>Zephyr Time API: Return set success
161129 Zephyr Time API->>RTC Manager: Return set success
162130 RTC Manager->>Event Log: Emit event TimeSet
163131```
@@ -167,15 +135,13 @@ sequenceDiagram
167135sequenceDiagram
168136 participant Ground Station
169137 participant Event Log
170- participant Manager
171138 participant RTC Manager
172139 participant Zephyr Time API
173- participant RTC RTC
174- Ground Station-->>Manager: Command to set time with Drv::TimeData struct
175- Manager->>RTC Manager: Call the timeSet synchronous input port with Drv::TimeData struct
140+ participant RTC
141+ Ground Station-->>RTC Manager: Command to set time with Drv::TimeData struct
176142 RTC Manager->>Zephyr Time API: Set time
177- Zephyr Time API->>RTC RTC : Set time
178- RTC RTC ->>Zephyr Time API: Return device not ready
143+ Zephyr Time API->>RTC: Set time
144+ RTC->>Zephyr Time API: Return device not ready
179145 Zephyr Time API->>RTC Manager: Return device not ready
180146 RTC Manager->>Event Log: Emit event DeviceNotReady
181147```
@@ -185,15 +151,13 @@ sequenceDiagram
185151sequenceDiagram
186152 participant Ground Station
187153 participant Event Log
188- participant Manager
189154 participant RTC Manager
190155 participant Zephyr Time API
191- participant RTC RTC
192- Ground Station-->>Manager: Command to set time with Drv::TimeData struct
193- Manager->>RTC Manager: Call the timeSet synchronous input port with Drv::TimeData struct
156+ participant RTC
157+ Ground Station-->>RTC Manager: Command to set time with Drv::TimeData struct
194158 RTC Manager->>Zephyr Time API: Set time
195- Zephyr Time API->>RTC RTC : Set time
196- RTC RTC ->>Zephyr Time API: Return set failure
159+ Zephyr Time API->>RTC: Set time
160+ RTC->>Zephyr Time API: Return set failure
197161 Zephyr Time API->>RTC Manager: Return set failure
198162 RTC Manager->>Event Log: Emit event TimeNotSet
199163```
0 commit comments