Mod Library
Sun Devil Rocketry's hardware agnostic utility library
Loading...
Searching...
No Matches
telemetry.h File Reference

: Definitions for the telemetry data structures. More...

#include "error_sdr.h"
#include "commands.h"
#include "main.h"
#include "stm32h7xx_hal.h"
#include "sensor.h"

Go to the source code of this file.

Macros

#define LORA_INTERNAL_HEADER_SIZE   8U
#define LORA_PAYLOAD_SIZE   40U
#define TELEMETRY_MESSAGE_SIZE   (LORA_INTERNAL_HEADER_SIZE + LORA_PAYLOAD_SIZE)

Typedefs

typedef uint8_t FLIGHT_COMP_STATE_TYPE
typedef uint32_t VERSION_INFO_TYPE
typedef enum _TELEMETRY_MESSAGE_TYPES TELEMETRY_MESSAGE_TYPES

Enumerations

enum  _TELEMETRY_MESSAGE_TYPES { TELEMETRY_MSG_VEHICLE_ID = 0x00000001 , TELEMETRY_MSG_DASHBOARD_DATA = 0x00000002 , TELEMETRY_MSG_CALIBRATION = 0x00000003 , __TELEMETRY_MSG_FORCE_32BIT = 0xFFFFFFFF }

Functions

struct __attribute__ ((packed)) _ST_UID_TYPE
struct __attribute ((packed)) _TELEMETRY_MSG_VEHICLE_ID_TYPE
void telemetry_get_next_message (TELEMETRY_MESSAGE *payload)
 Constructs the next telemetry message.
void telemetry_build_payload (TELEMETRY_MESSAGE *msg_buf, TELEMETRY_MESSAGE_TYPES message_type)
 Builds a telemetry payload of the requested type.

Variables

 ST_UID_TYPE
 LORA_INTERNAL_HEADER_TYPE
 TELEMETRY_MSG_VEHICLE_ID_TYPE
 TELEMETRY_MSG_DASHBOARD_DUMP_TYPE
 TELEMETRY_MSG_CALIBRATION_TYPE
 TELEMETRY_MESSAGE

Detailed Description

: Definitions for the telemetry data structures.

Copyright (c) 2025 Sun Devil Rocketry. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is covered under the BSD-3-Clause.

https://opensource.org/license/bsd-3-clause

Function Documentation

◆ telemetry_build_payload()

void telemetry_build_payload ( TELEMETRY_MESSAGE * msg_buf,
TELEMETRY_MESSAGE_TYPES message_type )

Builds a telemetry payload of the requested type.

Builds the requested telemetry payload and fills its message header.

Parameters
msg_bufTelemetry message buffer to fill.
message_typeType of telemetry message to build.

Builds a telemetry payload of the requested type.

Parameters
msg_bufTelemetry message buffer to fill.
message_typeType of telemetry message to build.

In order to support projects with safety critical requirements, mod does not throw fail-fast errors. Thus, this should nop on release builds.

This ensures that the library will only fail fast in the event of a hardfault and enables it to offload FHA requirements to the project that integrates it, if needed.

GCOVR_EXCL_START

A coverage hole is reported here because the debug-mode emulator tests have an actual function call here while release does not. This branch is tested in the release configuration.

◆ telemetry_get_next_message()

void telemetry_get_next_message ( TELEMETRY_MESSAGE * payload)

Constructs the next telemetry message.

Selects and constructs the next scheduled telemetry message.

Parameters
payloadTelemetry message buffer to fill.

Constructs the next telemetry message.

Parameters
payloadTelemetry message buffer to fill.