stf

package module
v0.0.0-...-8dbc778 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: MIT Imports: 22 Imported by: 0

README

go-stf

Golang wraps for some stf good stuff.

Includes

LICENSE

Under LICENSE MIT

Documentation

Overview

RotationWatcher.apk Service

Index

Constants

View Source
const (
	QUALITY_1080P = 1
	QUALITY_720P  = 2
	QUALITY_480P  = 3
	QUALITY_240P  = 4
)
View Source
const (
	TOUCH_DOWN = TouchAction(iota)
	TOUCH_MOVE
	TOUCH_UP
)

Variables

View Source
var (
	ErrServiceAlreadyStarted = errors.New("Service already started")
	ErrServiceNotStarted     = errors.New("Service not started")
)

Functions

func AdbCheckOutput

func AdbCheckOutput(d *adb.Device, name string, args ...string) (outStr string, err error)

func AdbFileExists

func AdbFileExists(d *adb.Device, path string) bool

func GoFunc

func GoFunc(f func() error) chan error

func PushFileFromHTTP

func PushFileFromHTTP(d *adb.Device, dst string, perms os.FileMode, urlStr string) error

Types

type RotationWatcher

type RotationWatcher interface {
	Servicer
	Rotation() (int, error)
	Subscribe() chan int
	Unsubscribe(chan int)
}

type STFCapturer

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

func NewSTFCapturer

func NewSTFCapturer(device *adb.Device) *STFCapturer

func (STFCapturer) SetQuality

func (m STFCapturer) SetQuality(quality int)

TODO(ssx): setQuality

func (STFCapturer) SetRotation

func (m STFCapturer) SetRotation(r int)

func (*STFCapturer) Start

func (s *STFCapturer) Start() error

func (*STFCapturer) Stop

func (s *STFCapturer) Stop() error

func (*STFCapturer) Wait

func (s *STFCapturer) Wait() error

type STFRotation

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

func NewSTFRotation

func NewSTFRotation(d *adb.Device) *STFRotation

func (*STFRotation) Rotation

func (s *STFRotation) Rotation() (int, error)

0, 90, 180, 270

func (*STFRotation) Start

func (s *STFRotation) Start() error

func (*STFRotation) Stop

func (s *STFRotation) Stop() error

func (*STFRotation) Subscribe

func (s *STFRotation) Subscribe() chan int

func (*STFRotation) Unsubscribe

func (s *STFRotation) Unsubscribe(C chan int)

unsubscribe will also close channel

type STFTouch

type STFTouch struct {
	*adb.Device
	// contains filtered or unexported fields
}

func NewSTFTouch

func NewSTFTouch(device *adb.Device) *STFTouch

func (*STFTouch) Down

func (s *STFTouch) Down(index int, xP, yP float64)

func (*STFTouch) IsStarted

func (t *STFTouch) IsStarted() bool

func (*STFTouch) Move

func (s *STFTouch) Move(index int, xP, yP float64)

func (*STFTouch) SetRotation

func (s *STFTouch) SetRotation(r int)

func (*STFTouch) Start

func (s *STFTouch) Start() error

func (*STFTouch) Stop

func (s *STFTouch) Stop() error

func (*STFTouch) Up

func (s *STFTouch) Up(index int)

func (*STFTouch) Wait

func (e *STFTouch) Wait() error

type ScreenReader

type ScreenReader interface {
	Servicer
	NextImage() (image.Image, error)
	LastImage() (image.Image, error)
	Subscribe() (chan image.Image, error)
}

type Servicer

type Servicer interface {
	Start() error
	Stop() error
	Wait() error
}

func MultiServicer

func MultiServicer(ss ...Servicer) Servicer

Combine servicers into one servicer

type TouchAction

type TouchAction int

type Toucher

type Toucher interface {
	Servicer
	Down(x, y int) error
	Move(x, y int) error
	Up() error
}

type UITester

type UITester interface {
	Servicer
	Address() string
}

Jump to

Keyboard shortcuts

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