web

package
v0.0.0-...-df6b22a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_MAX_MOTION = 0.1

	SMOOTHING_FAST = 0.9
	SMOOTHING_SLOW = 0.99
)

Variables

View Source
var (
	MAX_SMOOTHING = math.Pow(0.999, 1.0/100)
)

Functions

This section is empty.

Types

type Client

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

Client is a middleman between the websocket connection and the hub.

type Hub

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

Hub maintains the set of active clients and broadcasts messages to the clients.

type PhoneEvent

type PhoneEvent struct {
	Key string `json:"key"`

	RGB              string `json:"rgb"`
	R                uint32 `json:"r,omitempty"`
	G                uint32 `json:"g,omitempty"`
	B                uint32 `json:"b,omitempty"`
	NormalizedMotion float64

	Orientation deviceOrientation `json:"orientation,omitempty"`
	Motion      deviceMotion      `json:"motion,omitempty"`
}

type Web

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

func InitWeb

func InitWeb(webAddr string) *Web

func (*Web) Phone

func (w *Web) Phone() <-chan PhoneEvent

func (*Web) Render

func (w *Web) Render(msg string)

Jump to

Keyboard shortcuts

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