gm1356

package module
v0.0.0-...-6cce72d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// SoundLevelRange30_130 is from 30dB to 130dB
	SoundLevelRange30_130 = iota
	// SoundLevelRange30_80 is from 30dB to 80dB
	SoundLevelRange30_80
	// SoundLevelRange50_100 is from 50dB to 100dB
	SoundLevelRange50_100
	// SoundLevelRange60_110 is from 60dB to 110dB
	SoundLevelRange60_110
	// SoundLevelRange80_130 is from 80dB to 130dB
	SoundLevelRange80_130
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TimeWeight            TimeWeight
	FrequencyWeight       FrequencyWeight
	SoundLevelRange       SoundLevelRange
	SoundLevelDisplayMode SoundLevelDisplayMode
}

Config is configuration of GM1356 device

func (Config) String

func (c Config) String() string

String returns string representing config

type ConfiguredEvent

type ConfiguredEvent struct {
}

ConfiguredEvent from GM1356

func (ConfiguredEvent) String

func (e ConfiguredEvent) String() string

String returns string describes event

func (ConfiguredEvent) Type

func (e ConfiguredEvent) Type() EventType

Type returns event type

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver is GM1356 controller

func Open

func Open(eventBufferSize uint64) (*Driver, error)

Open opens GM1356 device

func (*Driver) Close

func (d *Driver) Close()

Close closes GM1356 device

func (*Driver) Configure

func (d *Driver) Configure(config Config) error

Configure requests configuration change

func (*Driver) EventChannel

func (d *Driver) EventChannel() <-chan Event

EventChannel retuns event channel

func (*Driver) Import

func (d *Driver) Import() error

Import requests recorded data

func (*Driver) IsImporting

func (d *Driver) IsImporting() bool

IsImporting returns true when importing recorded data

func (*Driver) Measure

func (d *Driver) Measure() error

Measure requests current sound level

type Event

type Event interface {
	Type() EventType
	String() string
}

Event from GM1356 device

type EventType

type EventType int

EventType is type of event from GM1356 device

const (
	// EventTypeConfigured is configured event type
	EventTypeConfigured EventType = iota
	// EventTypeMeasured is measured event type
	EventTypeMeasured
)

type FrequencyWeight

type FrequencyWeight int

FrequencyWeight is frequency weighting characteristic

const (
	// FrequencyWeightA is dBA
	FrequencyWeightA FrequencyWeight = iota
	// FrequencyWeightC is dBC
	FrequencyWeightC
)

func (FrequencyWeight) String

func (f FrequencyWeight) String() string

FrequencyWeight is frequency weighting characteristic

type MeasuredEvent

type MeasuredEvent struct {
	Time       time.Time
	SoundLevel float32
	Config     Config
}

MeasuredEvent from GM1356

func (MeasuredEvent) String

func (e MeasuredEvent) String() string

String returns string describes event

func (MeasuredEvent) Type

func (e MeasuredEvent) Type() EventType

Type returns event type

type SoundLevelDisplayMode

type SoundLevelDisplayMode int

SoundLevelDisplayMode is display mode

const (
	// SoundLevelDisplayModeNormal is normal mode
	SoundLevelDisplayModeNormal SoundLevelDisplayMode = iota
	// SoundLevelDisplayModeMaxHold is max hold mode
	SoundLevelDisplayModeMaxHold
)

func (SoundLevelDisplayMode) String

func (d SoundLevelDisplayMode) String() string

SoundLevelDisplayMode is display mode

type SoundLevelRange

type SoundLevelRange int

SoundLevelRange is sound level range on indicator

func (SoundLevelRange) String

func (l SoundLevelRange) String() string

SoundLevelRange is sound level range on indicator

type TimeWeight

type TimeWeight int

TimeWeight is time weighting characteristic

const (
	// TimeWeightFast is fast mode
	TimeWeightFast TimeWeight = iota
	// TimeWeightSlow is slow mode
	TimeWeightSlow
)

func (TimeWeight) String

func (t TimeWeight) String() string

TimeWeight is time weighting characteristic

Directories

Path Synopsis
gm1356-cli module

Jump to

Keyboard shortcuts

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