Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultSocketTimeout = 1 * time.Minute ReceiveBufferSize = 20 * 1024 )
Variables ¶
View Source
var ( DeviceNotFoundError = errors.New("Device not found") ManagerNotFoundError = errors.New("Manager not found") )
View Source
var (
DeviceDisconnectedError = fmt.Errorf("device disconnected")
)
Functions ¶
func GetMessageSize ¶
func StateToString ¶
Types ¶
type Connection ¶
type Connection struct { Logger *logrus.Entry Connection net.Conn ResponseChannel chan ResponseData ConnectionStateChannel chan ConnectionState ActionChannel chan action.Response ConnectionParameter *action.Connect }
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) HandleMessages ¶
func (c *Connection) HandleMessages(ctx context.Context)
func (*Connection) Send ¶
func (c *Connection) Send(content []byte) error
type ConnectionState ¶
type ConnectionState uint8
const ( Disconnected ConnectionState = iota Connected )
type Device ¶
type Device interface { DeviceID() string DeviceIP() net.IP DeviceState() State DeviceOSName() string DeviceOSVersion() string DeviceName() string DeviceModel() string IsAppInstalled(*app.Parameter) (bool, error) InstallApp(*app.Parameter) error UninstallApp(*app.Parameter) error UpdateDeviceInfos() error NewContext() context.Context Cancel() ConnectionTimeout() time.Duration SetConnection(*Connection) Connection() *Connection IsAppConnected() bool StartApp(*app.Parameter, string, net.IP) error StopApp(*app.Parameter) error StartRecording(string) error StopRecording() error GetScreenshot() ([]byte, int, int, error) HasFeature(string) bool Execute(string) Lock() error Unlock() error IsLocked() bool SetLogWriter(LogWriter) Data(string, string) LogPerformance(checkpoint string, cpu, fps, mem float32, other string) Log(string, string, ...interface{}) Error(string, string, ...interface{}) Exception(string, string, ...interface{}) AddActionHandler(action.ActionHandler) RemoveActionHandler(action.ActionHandler) ActionHandlers() []action.ActionHandler RunNativeScript(data []byte) }
type Properties ¶
type Properties struct { Name string DeviceID string Type string OS string Architecture string App string }
func (*Properties) AreValid ¶
func (p *Properties) AreValid() bool
type RegisterData ¶
type ResponseData ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.