21#ifndef FLIGHT_TELEMETRYMANAGER_H
22#define FLIGHT_TELEMETRYMANAGER_H
147 int16
command(uint16
apid, uint8* buffer, uint16 size)
override;
173 int16
start()
override;
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_PARAMS
Definition appmacros.h:47
Simple first in, first out queue for data storage.
Definition Queue.hpp:38
Wrapper to manage and convert time as timespce.
Definition Time.h:53
App(FlightExecutive &executive, const char *name, uint16 apid, uint8 instance=0)
Executive-based constructor for the task.
Definition App.cpp:21
uint8 & instance()
Get the instance of this app (used to differentiate between multiple instances of the same app).
Definition App.h:109
uint16 apid()
Get the apid for this app.
Definition App.h:105
FlightExecutive & exc
Override our executive to include the FlightExecutive instead.
Definition App.h:120
Executive derivation specifically to run flight systems.
Definition FlightExecutive.h:46
uint16 _tlm_table_idx
Current index in the telemetry table.
Definition TelemetryManager.h:197
clockwerk::Queue< uint8, TLM_HIGH_PRI_QUEUE_SIZE_BYTES > _tlm_high_byte_queue
Normal priority queue of telemetry packet metadata structs.
Definition TelemetryManager.h:189
int16 writeQueues(void *tlm_ptr, uint32 size, const PacketInfo &tlminfo, tlm_priority_e priority)
Function to add telem packets to queue while checking for space.
Definition TelemetryManager.cpp:109
PacketTypeInfo _tlm_table[MAX_TLM_TABLE_SIZE]
High priority queue of telemetry packet metadata structs.
Definition TelemetryManager.h:192
uint8 _successful_packets
Count of successfully sent packets.
Definition TelemetryManager.h:202
clockwerk::Queue< PacketInfo, TLM_HIGH_PRI_QUEUE_SIZE_PKTS > _tlm_high_info_queue
High priority queue of telemetry packets.
Definition TelemetryManager.h:190
uint32 queueCountHighPri()
Get the number of packets in the high priority queue.
Definition TelemetryManager.h:132
int16 deactivate() override
Deactivate the app. The app will not step when deactivated.
Definition TelemetryManager.cpp:421
uint8 _byte_queue_error
Count of dropped packets due to queueing errors.
Definition TelemetryManager.h:198
tlm_tlm_mngr_status _status_tlm
Definition TelemetryManager.h:204
int16 execute() override
Definition TelemetryManager.cpp:338
uint8 _ccsds_failure
Count of dropped packets due to CCSDS failures.
Definition TelemetryManager.h:199
char _print_buff[200]
Table of telemetry packet metadata.
Definition TelemetryManager.h:194
uint16 numRegisteredPackets()
Get the number of registered telemetry packets.
Definition TelemetryManager.h:151
clockwerk::Queue< uint8, TLM_NORMAL_PRI_QUEUE_SIZE_BYTES > _tlm_normal_byte_queue
Definition TelemetryManager.h:186
uint32 queueCountNormalPri()
Get the number of packets in the standard queue.
Definition TelemetryManager.h:128
clockwerk::Queue< PacketInfo, TLM_NORMAL_PRI_QUEUE_SIZE_PKTS > _tlm_normal_info_queue
Normal priority queue of telemetry packets.
Definition TelemetryManager.h:187
TelemetryManager(FlightExecutive &exc)
Only available flight executive constructor.
Definition TelemetryManager.cpp:28
int16 registerTlmPacket(uint16 tlm_apid, uint8 instance)
Register a telemetry packet by adding it to the table.
Definition TelemetryManager.cpp:159
uint8 _tlm_packet[sizeof(_status_tlm)]
Telemetry manager status telemetry packet.
Definition TelemetryManager.h:205
int16 addTlmToQueue(const cmd_tlm_base &pkt, uint8 instance)
Add a telemetry packet to the queue.
Definition TelemetryManager.cpp:46
uint8 _telem_write_error
Count of dropped packets due to interface error.
Definition TelemetryManager.h:200
clockwerk::Queue< uint8, TLM_HIGH_PRI_QUEUE_SIZE_BYTES > & tlmHighPriByteQueue()
Handle to _tlm_high_byte_queue used for unit testing.
Definition TelemetryManager.h:167
uint32 _sendNextTlmPacket()
Send the next telemetry packet.
Definition TelemetryManager.cpp:210
clockwerk::Queue< uint8, TLM_NORMAL_PRI_QUEUE_SIZE_BYTES > & tlmNormalPriByteQueue()
Handle to _tlm_normal_byte_queue used for unit testing.
Definition TelemetryManager.h:159
PacketTypeInfo * registeredPackets()
Get the telemetry table.
Definition TelemetryManager.h:155
int16 command(uint16 apid, uint8 *buffer, uint16 size) override
Process commands issued to the app.
Definition TelemetryManager.cpp:357
int16 start() override
Definition TelemetryManager.cpp:311
int16 configureTlmPacket(const PacketTypeInfo &info)
Register a telemetry packet by adding its metadata to the table.
Definition TelemetryManager.cpp:195
int16 activate() override
Activate the app. The app will step when active.
Definition TelemetryManager.cpp:416
clockwerk::Queue< PacketInfo, TLM_NORMAL_PRI_QUEUE_SIZE_PKTS > & tlmNormalPriInfoQueue()
Handle to _tlm_normal_info_queue used for unit testing.
Definition TelemetryManager.h:163
int32 _findPktIndex(uint16 apid, uint8 instance)
Find index of packet in tlm table matching apid.
Definition TelemetryManager.cpp:33
clockwerk::Queue< PacketInfo, TLM_HIGH_PRI_QUEUE_SIZE_PKTS > & tlmHighPriInfoQueue()
Handle to _tlm_high_info_queue used for unit testing.
Definition TelemetryManager.h:171
uint8 _buffer_overwrite
Count of dropped packets due to overwitten packets.
Definition TelemetryManager.h:201
uint8 _packetized_data[CMD_TLM_PKT_MAX_SIZE_BYTES]
Buffer to hold packetization of status packet.
Definition TelemetryManager.h:207
Definition DeadReckon.cpp:20
tlm_priority_e
Enumeration of valid telemtry queue priorities.
Definition TelemetryManager.h:35
@ NORMAL
Definition TelemetryManager.h:36
@ HIGH
Definition TelemetryManager.h:37
Base struct in definition of command and telemetry packets.
Definition Telemetry.h:48
LED Blinker count packet definition.
Definition tlm_TelemetryManager.h:41
Telemetry packet metadata struct.
Definition TelemetryManager.h:56
clockwerk::Time timestamp
Packet APID.
Definition TelemetryManager.h:59
uint16 apid
Size of the packet in bytes.
Definition TelemetryManager.h:58
uint8 instance
Timestamp of when the packet was added to the queue.
Definition TelemetryManager.h:60
uint32 size
Definition TelemetryManager.h:57
Telemetry packet type metadata struct.
Definition TelemetryManager.h:43
tlm_priority_e priority
Packet counter, rolls over at 0xFFFF.
Definition TelemetryManager.h:48
uint8 target
Instance of APID used.
Definition TelemetryManager.h:50
uint16 apid
The last time this packet was sent.
Definition TelemetryManager.h:46
clockwerk::Time rate_sec
Definition TelemetryManager.h:44
uint8 instance
Priority ranking of the packet.
Definition TelemetryManager.h:49
clockwerk::Time last_sent
Time interval between transmissions of this packet.
Definition TelemetryManager.h:45
uint16 count
Packet APID.
Definition TelemetryManager.h:47
clockwerk::DataIO< uint32 > max_bytes_per_step
Definition TelemetryManager.h:91