flipper

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 14 Imported by: 3

README

go-flipper

Control your Flipper Zero over Protobuf RPC protocol.


This library is designed to be transport agnostic, though I've tested it with RPC over VCP only.

The library is in a draft state. TODO:

  • cover with godoc
  • refactor the progressCallback crap
  • better storage read/write implementation
  • implement VCP transport out of the box
  • set up proper git flow, CI, etc
  • prepare a cool readme with some fashionable badges :>

Anna.

Documentation

Index

Constants

View Source
const (
	InputKeyUp    = InputKey(pbgui.InputKey_UP)
	InputKeyDown  = InputKey(pbgui.InputKey_DOWN)
	InputKeyRight = InputKey(pbgui.InputKey_RIGHT)
	InputKeyLeft  = InputKey(pbgui.InputKey_LEFT)
	InputKeyOk    = InputKey(pbgui.InputKey_OK)
	InputKeyBack  = InputKey(pbgui.InputKey_BACK)
)
View Source
const (
	InputTypePress   = InputType(pbgui.InputType_PRESS)
	InputTypeRelease = InputType(pbgui.InputType_RELEASE)
	InputTypeShort   = InputType(pbgui.InputType_SHORT)
	InputTypeLong    = InputType(pbgui.InputType_LONG)
	InputTypeRepeat  = InputType(pbgui.InputType_REPEAT)
)
View Source
const (
	FileTypeFile = FileType(pbstorage.File_FILE)
	FileTypeDir  = FileType(pbstorage.File_DIR)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Type FileType
	Name string
	Size uint32
	Data []byte
}

type FileType added in v0.1.1

type FileType pbstorage.File_FileType

type Flipper

type Flipper struct {
	System  system
	Storage storage
	App     app
	Gui     gui
	// contains filtered or unexported fields
}

func Connect

func Connect(rw io.ReadWriter) (*Flipper, error)

func ConnectWithTimeout

func ConnectWithTimeout(rw io.ReadWriter, timeout time.Duration) (*Flipper, error)

func (*Flipper) StopSession

func (f *Flipper) StopSession() error

type InputKey added in v0.1.1

type InputKey pbgui.InputKey

type InputType added in v0.1.1

type InputType pbgui.InputType

type RebootMode added in v0.3.0

type ScreenFrame added in v0.2.0

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

func (ScreenFrame) Bytes added in v0.2.0

func (sf ScreenFrame) Bytes() []byte

func (ScreenFrame) IsPixelSet added in v0.2.0

func (sf ScreenFrame) IsPixelSet(x, y int) bool

func (ScreenFrame) ToImage added in v0.2.0

func (sf ScreenFrame) ToImage(foreground, background color.Color) image.Image

Directories

Path Synopsis
internal
delimited
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
Package delimited implements a reader and writer for simple streams of length-delimited byte records.

Jump to

Keyboard shortcuts

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