Radio

package
v0.0.0-...-8707f5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureRadioModule

func ConfigureRadioModule(serialPort io.ReadWriteCloser) error

func OpenSerial

func OpenSerial(port string, baudrate uint) (io.ReadWriteCloser, error)

Types

type Packet

type Packet struct {
	ID           uint32      `json:"id"`
	Temperature  Temperature `json:"temperature"`  // Temperature in Celsius
	Pressure     float32     `json:"pressure"`     // Pressure in hPa
	BMPAltitude  float32     `json:"bmpAltitude"`  // Altitude based on the pressure from the BMP module
	GPS          GPS.Packet  `json:"gps"`          // A GPS object contains all the information from the GPS module
	Acceleration pkg.Vector3 `json:"acceleration"` // Acceleration is an instance of Vector3 containing three axis (xyz)
	Gyroscope    pkg.Vector3 `json:"gyroscope"`    // Gyroscope is an instance of Vector3 containing three axis (xyz)
	Time         []byte      `json:"time"`         // Time is a char array containing three items: hh:mm:ss
}

func Decode

func Decode(buf []byte, n int) (Packet, bool, error)

type Temperature

type Temperature struct {
	BMP float32 `json:"bmpTemp"`
	MPU float32 `json:"mpuTemp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL