xethru: github.com/NeuralSpaz/xethru Index | Files

package xethru

import "github.com/NeuralSpaz/xethru"

Package xethru: An open source implementation driver for xethru sensor modules. The current state of the api is still unstable and under active development. Contributions are welcome.

Index

Package Files

ledmode_jsonenums.go ledmode_string.go respirationstate_jsonenums.go respirationstate_string.go status_jsonenums.go status_string.go x2m200.go x2m200Parsers.go x2m200Ping.go x2m200Reset.go x2m200Respiration.go xethru.go

Constants

const (
    LEDOff        ledMode = 0
    LEDSimple     ledMode = 1
    LEDFull       ledMode = 2
    LEDInhalation ledMode = 3
)

XM200 LED Modes

go:generate jsonenums -type=ledMode go:generate stringer -type=ledMode

type BaseBandAmpPhase Uses

type BaseBandAmpPhase struct {
    Time         int64     `json:"time"`
    Status       status    `json:"type"`
    Counter      uint32    `json:"counter"`
    Bins         uint32    `json:"bins"`
    BinLength    float64   `json:"binlength"`
    SamplingFreq float64   `json:"samplingfreq"`
    CarrierFreq  float64   `json:"carrier"`
    RangeOffset  float64   `json:"offset"`
    Amplitude    []float64 `json:"amplitude"`
    Phase        []float64 `json:"phase"`
}

BaseBandAmpPhase is the struct

type BaseBandIQ Uses

type BaseBandIQ struct {
    Time         int64     `json:"time"`
    Status       status    `json:"type"`
    Counter      uint32    `json:"counter"`
    Bins         uint32    `json:"bins"`
    BinLength    float64   `json:"binlength"`
    SamplingFreq float64   `json:"samplingfreq"`
    CarrierFreq  float64   `json:"carrier"`
    RangeOffset  float64   `json:"offset"`
    SigI         []float64 `json:"i"`
    SigQ         []float64 `json:"q"`
}

BaseBandIQ is the struct

type Framer Uses

type Framer interface {
    io.Writer
    io.Reader
    io.Closer
    Reset() (bool, error)
}

Framer is a wrapper for a serial protocol. it inserts the start, crc and end bytes for you

func Open Uses

func Open(device string, port io.ReadWriteCloser) Framer

Open Creates a x2m200 xethu serial protocol from a io.ReadWriter it implements io.Reader and io.Writer

type Module Uses

type Module struct {
    AppID              [4]byte
    LEDMode            ledMode
    DetectionZoneStart float32
    DetectionZoneEnd   float32
    Sensitivity        uint32
    Timeout            time.Duration
    Data               chan interface{}
    // contains filtered or unexported fields
}

func NewModule Uses

func NewModule(f Framer, mode string) *Module

NewModule creates

func (Module) Enable Uses

func (r Module) Enable(mode string) error

<Start> + <XTS_SPC_DIR_COMMAND> + <XTS_SDC_APP_SETINT> + [XTS_SACR_OUTPUTBASEBAND(i)] + [Length(i)] + [EnableCode(i)] + <CRC> + <End> Response: <Start> + <XTS_SPR_ACK> + <CRC> + <End>

func (Module) Load Uses

func (r Module) Load() error

Load is Example: <Start> + <XTS_SPC_MOD_LOADAPP> + [AppID(i)] + <CRC> + <End> Response: <Start> + <XTS_SPR_ACK> + <CRC> + <End>

func (Module) Run Uses

func (r Module) Run(stream chan interface{})

Run start app

func (Module) SetDetectionZone Uses

func (r Module) SetDetectionZone(start, end float64) error

SetDetectionZone is Example: <Start> + <XTS_SPC_APPCOMMAND> + <XTS_SPCA_SET> + [XTS_ID_DETECTION_ZONE(i)] + [Start(f)] + [End(f)] + <CRC> + <End> Response: <Start> + <XTS_SPR_ACK> + <CRC> + <End>

func (*Module) SetLEDMode Uses

func (r *Module) SetLEDMode() error

SetLEDMode is Example: <Start> + <XTS_SPC_MOD_SETLEDCONTROL> + <Mode> + <Reserved> + <CRC> + <End> Response: <Start> + <XTS_SPR_ACK> + <CRC> + <End>

func (Module) SetSensitivity Uses

func (r Module) SetSensitivity(sensitivity int) error

SetSensitivity is Example: <Start> + <XTS_SPC_APPCOMMAND> + <XTS_SPCA_SET> + [XTS_ID_SENSITIVITY(i)] + [Sensitivity(i)]+ <CRC> + <End> Response: <Start> + <XTS_SPR_ACK> + <CRC> + <End>

type Respiration Uses

type Respiration struct {
    Time          int64            `json:"time"`
    Status        status           `json:"status"`
    Counter       uint32           `json:"counter"`
    State         respirationState `json:"state"`
    RPM           uint32           `json:"rpm"`
    Distance      float64          `json:"distance"`
    SignalQuality float64          `json:"signalquality"`
    Movement      float64          `json:"movement"`
}

Respiration is the struct

type Sleep Uses

type Sleep struct {
    Time          int64            `json:"time"`
    Status        status           `json:"type"`
    Counter       uint32           `json:"counter"`
    State         respirationState `json:"state"`
    RPM           float64          `json:"rpm"`
    Distance      float64          `json:"distance"`
    SignalQuality float64          `json:"signalquality"`
    MovementSlow  float64          `json:"movementslow"`
    MovementFast  float64          `json:"movementfast"`
}

Sleep is the struct

type SystemMessage Uses

type SystemMessage struct {
    Message string
}

SystemMessage is the struct

Package xethru imports 9 packages (graph). Updated 2017-09-10. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).