flipper

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 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 Flipper

type Flipper struct {
	Status  status
	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 ScreenStreamFrame

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

func (ScreenStreamFrame) Bytes

func (sf ScreenStreamFrame) Bytes() []byte

func (ScreenStreamFrame) IsPixelSet

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

func (ScreenStreamFrame) ToImage

func (sf ScreenStreamFrame) 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