Skip to content
github-actions[bot] edited this page Mar 13, 2025 · 9 revisions

proc

import "github.com/AarC10/GSW-V2/proc"

Index

func DatabaseWriter(handler db.Handler, packet tlm.TelemetryPacket, channel chan []byte)

DatabaseWriter writes telemetry data to the database It reads data from the channel and writes it to the database

func GetPacketSize(packet tlm.TelemetryPacket) int

GetPacketSize returns the size of a telemetry packet in bytes

func ResetConfig()

ResetConfig resets the global configuration

func TelemetryPacketReader(packet tlm.TelemetryPacket, outChannel chan []byte)

TelemetryPacketReader is a goroutine that reads telemetry data from shared memory and sends it to an output channel

func TelemetryPacketWriter(packet tlm.TelemetryPacket, outChannel chan []byte)

TelemetryPacketWriter is a goroutine that listens for telemetry data on a UDP port and writes it to shared memory

Configuration is a struct that holds the configuration for the GSW

type Configuration struct {
    Name             string                     `yaml:"name"`              // Name of the configuration
    Measurements     map[string]tlm.Measurement `yaml:"measurements"`      // Map of measurements
    TelemetryPackets []tlm.TelemetryPacket      `yaml:"telemetry_packets"` // List of telemetry packets
}

TODO: Make global safer

var GswConfig Configuration

func ParseConfig(filename string) (*Configuration, error)

ParseConfig parses a YAML configuration file and returns a Configuration struct

func ParseConfigBytes(data []byte) (*Configuration, error)

ParseConfigBytes parses a YAML formatted byte slice and returns a Configuration struct

Generated by gomarkdoc

Clone this wiki locally