Telemetry Manager Setup
```mermaid
flowchart TB
TMConstructor("Create TelemetryManager Instance")
MTConstructor("Create MavlinkTranslator Instance")
GSCConstructor("Create GroundStationCommunication Instance")
defineCallbacks["Define routineDataTransmission Task Callback"]
GSCDefine("create
DMAReceiveBuffer,
lowPriorityTransmitBuffer,
highPriorityTransmitBuffer")
End("End")
TMConstructor --> MTConstructor
TMConstructor --> GSCConstructor
MTConstructor --> defineCallbacks
GSCConstructor --> defineCallbacks
GSCConstructor --> GSCDefine
defineCallbacks --> End
```
Telemetry Manager Operation
```mermaid
flowchart TB
%% TELEMETRY MANAGER
%% Routine Data Transmission Functionality
routineDataTransmission("RTOS Task: routineDataTransmission")
ingestStateData["Ingest drone state data
and convert to Mavlink bytes"]
packHPBuffer["Pack drone state data
(Mavlink bytes) into
GSC.highPriorityTransmitBuffer"]
transmitStateData["Transmit GSC.highPriorityTransmitBuffer
contents via GSC.transmit()"]
RTOSDelay["RTOS delay: 500ms"]
routineDataTransmission --> ingestStateData
ingestStateData --> packHPBuffer
packHPBuffer --> transmitStateData
transmitStateData --> RTOSDelay
RTOSDelay --> ingestStateData
%% DMA Receive Functionality
DMAInterrupt("RFD900 Interrupt: receiveInterruptServiceRoutine")
receiveData["Receive data"]
checkBufferSpace{"GSC.DMAReceiveBuffer
enough space?"}
addDataToBuffer["Add new data to GSC.DMAReceiveBuffer"]
discardData["Discard new data"]
DMAInterruptEnd("DMA Interrupt Handler End")
DMAInterrupt --> receiveData
receiveData --> checkBufferSpace
checkBufferSpace --> |Yes| addDataToBuffer
checkBufferSpace --> |No| discardData
addDataToBuffer --> DMAInterruptEnd
discardData --> DMAInterruptEnd
%% Loop Update Functionality
loopUpdate("SM Managed: update")
translateMavlink["Translate Mavlink bytes
(to callback actions) from
GSC.DMAReceiveBuffer and
trigger associated callbakcs"]
fillLowPriorityBuffer["Fill GSC.lowPriorityTransmitBuffer"]
transmitLowPriorityBuffer["Transmit GSC.lowPriorityTransmitBuffer"]
loopUpdate --> translateMavlink
translateMavlink --> fillLowPriorityBuffer
fillLowPriorityBuffer --> transmitLowPriorityBuffer
transmitLowPriorityBuffer --> |SM Managed Delay| translateMavlink
``` |