visca

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 3

README

visca

implements a subset of the visca over ip protocol in golang

Documentation

Index

Constants

View Source
const (
	TiltDirectionUp   = 0x01
	TiltDirectionDown = 0x02
	TiltDirectionStop = 0x03

	PanDirectionLeft  = 0x01
	PanDirectionRight = 0x02
	PanDirectionStop  = 0x03

	PanTiltSpeedMin = 0x00
	PanTiltSpeedMax = 0x18
)

Variables

View Source
var (
	ErrInvalidPanTiltSpeed     = errors.New("speed out of range")
	ErrInvalidPanTiltDirection = errors.New("invalid pan/tilt direction")
)
View Source
var (
	ErrArgsTooLong       = errors.New("payload arguments length must not exceed 0xffff")
	ErrMissingTerminator = errors.New("payload missing terminator")
)
View Source
var (
	ErrSyntaxError       = errors.New("command format valid or illegal command parameters")
	ErrCommandBufferFull = errors.New("unable to accept a command because 2 commands are currently being executed")
)

Functions

This section is empty.

Types

type Camera

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

func New

func New(addr string, opts ...Option) *Camera

func (*Camera) MemoryRecall

func (c *Camera) MemoryRecall(ctx context.Context, channel byte) error

func (*Camera) MemorySet added in v0.2.0

func (c *Camera) MemorySet(ctx context.Context, channel byte) error

func (*Camera) PanLeft

func (c *Camera) PanLeft(ctx context.Context, speed byte) error

func (*Camera) PanRight

func (c *Camera) PanRight(ctx context.Context, speed byte) error

func (*Camera) PanTiltDrive

func (c *Camera) PanTiltDrive(ctx context.Context, panDir, tiltDir, panSpeed, tiltSpeed byte) error

func (*Camera) PanTiltStop

func (c *Camera) PanTiltStop(ctx context.Context) error

func (*Camera) TiltDown

func (c *Camera) TiltDown(ctx context.Context, speed byte) error

func (*Camera) TiltUp

func (c *Camera) TiltUp(ctx context.Context, speed byte) error

func (*Camera) ZoomStop

func (c *Camera) ZoomStop(ctx context.Context) error

func (*Camera) ZoomTele

func (c *Camera) ZoomTele(ctx context.Context) error

func (*Camera) ZoomWide

func (c *Camera) ZoomWide(ctx context.Context) error

type Logger

type Logger interface {
	Debugf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Warnf(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures how we create the Camera.

func WithDelay

func WithDelay(t time.Duration) Option

WithDelay changes the delay between sending commands to the Camera. The default value is 250 milliseconds. See more details about delay at https://github.com/byuoitav/connpool.

func WithDialer

func WithDialer(d net.Dialer) Option

WithDialer sets the dialer to use when opening connections with the Camera. The default value is net.Dialer{}. See more details at https://golang.org/pkg/net/#Dialer

func WithLogger

func WithLogger(l Logger) Option

WithLogger adds a logger to Camera. Camera will log appropriate information about the underlying connection and the commands being sent. The default value is nil, meaning that no logs are written.

func WithTTL

func WithTTL(t time.Duration) Option

WithTTL changes the TTL for the underlying UDP connection to the Camera. The default value is 30 seconds. See more details about TTL at https://github.com/byuoitav/connpool.

Jump to

Keyboard shortcuts

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