geophone

package
v0.0.0-...-b2150f3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// READY_THRESHOLD should be strictly 1 second
	READY_THRESHOLD time.Duration = 1 * time.Second
	// TIMEOUT_THRESHOLD should be greater than READY_THRESHOLD
	TIMEOUT_THRESHOLD time.Duration = 3 * time.Second
)
View Source
const MODULE string = "geophone"

Variables

View Source
var (
	// RESET_WORD resets geophone ADC module
	RESET_WORD = [...]byte{0x61}
	// SYNC_WORD indicates a data packet is following
	SYNC_WORD = [...]byte{0xFC, 0x1B}
	// ACK_WORD indicates a valid command is received
	ACK_WORD = [...]byte{0xFC, 0x2B}
)

Functions

This section is empty.

Types

type Geophone

type Geophone struct {
	Ticker *time.Ticker
}

func (*Geophone) OnError

func (g *Geophone) OnError(options *feature.FeatureOptions, err error)

func (*Geophone) OnReady

func (g *Geophone) OnReady(options *feature.FeatureOptions, v ...any)

func (*Geophone) OnStart

func (g *Geophone) OnStart(options *feature.FeatureOptions, v ...any)

func (*Geophone) OnStop

func (g *Geophone) OnStop(options *feature.FeatureOptions, v ...any)

func (*Geophone) Read

func (g *Geophone) Read(port io.ReadWriteCloser, conf *config.Conf, packet *Packet, packetLen int) error

func (*Geophone) Reset

func (g *Geophone) Reset(port io.ReadWriteCloser) error

func (*Geophone) Run

func (g *Geophone) Run(options *feature.FeatureOptions, waitGroup *sync.WaitGroup)

type Packet

type Packet struct {
	EHZ      []int32 // Vertical
	EHE      []int32 // East-West
	EHN      []int32 // North-South
	Checksum [3]uint8
}

Jump to

Keyboard shortcuts

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