fc

package
v0.0.0-...-e6dfd68 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FC

type FC struct {
	Features uint32

	PidMap map[string]*Pid
	// contains filtered or unexported fields
}

FC represents a connection to the flight controller, which can handle disconnections and reconnections on its on. Use NewFC() to initialize an FC and then call FC.StartUpdating().

func NewFC

func NewFC(opts FCOptions) (*FC, error)

NewFC returns a new FC using the given port and baud rate. stdout is optional and will default to os.Stdout if nil

func (*FC) Close

func (f *FC) Close() error

func (*FC) Flash

func (f *FC) Flash(srcDir string, targetName string) error

Flash compiles the given target and flashes the board

func (*FC) GetPIDs

func (f *FC) GetPIDs() (err error)

func (*FC) HasDetectedTargetName

func (f *FC) HasDetectedTargetName() bool

HasDetectedTargetName returns true iff the target name installed on the board has been retrieved via MSP.

func (*FC) IsSimulatingRX

func (f *FC) IsSimulatingRX() bool

func (*FC) RX

func (f *FC) RX() rx.RX

func (*FC) Reboot

func (f *FC) Reboot()

Reboot reboots the board via MSP_REBOOT

func (*FC) SetPIDs

func (f *FC) SetPIDs(pids []uint8) (err error)

func (*FC) StartUpdating

func (f *FC) StartUpdating(w interface{})

StartUpdating starts reading from the MSP port and handling the received messages. Note that it never returns.

func (*FC) ToggleRXSimulation

func (f *FC) ToggleRXSimulation() (enabled bool, err error)

type FCOptions

type FCOptions struct {
	PortName         string
	BaudRate         int
	Stdout           io.Writer
	EnableDebugTrace bool
}

type PIDReceiver

type PIDReceiver interface {
	ReceivedPID(map[string]*Pid) error
}

type Pid

type Pid struct {
	FlightSurface string
	Value         []uint8
}

Jump to

Keyboard shortcuts

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