motionmount

package module
v0.0.0-...-64f24c9 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

go-vogels-motionmount

Golang client for controlling a Vogels MotionMount over bluetooth.

Features:

  • Reading the current position
  • Setting the position
  • Reading the presets (as defined in the official MotionMount app)

This has only been tested on the Vogels SIGNATURE series MotionMount device.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a client for finding and interacting with Vogels MotionMount devices over Bluetooth

func DefaultClient

func DefaultClient() (*Client, error)

DefaultClient returns a client using the default bluetooth adapter

func (*Client) Scan

func (c *Client) Scan(ctx context.Context, results chan<- *MotionMount) error

Scan will scan for MotionMount devices, it will scan continuously until the context is canceled adding each new device to the output channel.

It will not return the same MotionMount device multiple times.

func (*Client) ScanOne

func (c *Client) ScanOne(ctx context.Context) (device *MotionMount, err error)

ScanOne will scan for a single MotionMount device and then stop scanning. If called multiple times it will not return the same MotionMount device.

type MotionMount

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

MotionMount is a Vogels MotionMount device

func (*MotionMount) Close

func (m *MotionMount) Close() error

Close will disconnect from the MotionMount, the MotionMount will be re-connected to for any further calls.

func (*MotionMount) GetPosition

func (m *MotionMount) GetPosition() (Position, error)

GetPosition returns the current Position of the MotionMount

func (*MotionMount) GetPositionsPresets

func (m *MotionMount) GetPositionsPresets() ([]Position, error)

GetPositionsPresets returns all configured presets for the MotionMount

func (*MotionMount) MoveToPosition

func (m *MotionMount) MoveToPosition(position Position) error

MoveToPosition moves the MotionMount to a given position

func (*MotionMount) Name

func (m *MotionMount) Name() string

Name is the name of the MotionMount device

type Position

type Position struct {
	// Label is defined for "Preset" positions
	Label string
	// WallDistance is an int between 0 and 100.
	WallDistance int16
	// Orientation is an int between -100 and 100, a negative int orients the
	// MotionMount right, a positive int orients it left.
	Orientation int16
}

Position is a position struct for the MotionMount

Jump to

Keyboard shortcuts

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