api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAddr = "/tmp/itd/socket"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(sockPath string) (*Client, error)

func NewFromConn added in v0.0.6

func NewFromConn(conn io.ReadWriteCloser) *Client

func (*Client) Address

func (c *Client) Address(ctx context.Context) (out string, err error)

func (*Client) BatteryLevel

func (c *Client) BatteryLevel(ctx context.Context) (out uint8, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Download added in v0.0.6

func (c *Client) Download(ctx context.Context, dst, src string) (chan FSTransferProgress, error)

func (*Client) FirmwareUpgrade

func (c *Client) FirmwareUpgrade(ctx context.Context, upgType UpgradeType, files ...string) (chan infinitime.DFUProgress, error)

func (*Client) HeartRate

func (c *Client) HeartRate(ctx context.Context) (out uint8, err error)

func (*Client) LoadResources added in v0.0.8

func (c *Client) LoadResources(ctx context.Context, path string) (<-chan infinitime.ResourceLoadProgress, error)

LoadResources loads resources onto the watch from the given file path to the resources zip

func (*Client) Mkdir added in v0.0.5

func (c *Client) Mkdir(ctx context.Context, paths ...string) error

func (*Client) MkdirAll added in v0.0.8

func (c *Client) MkdirAll(ctx context.Context, paths ...string) error

func (*Client) Motion

func (c *Client) Motion(ctx context.Context) (out infinitime.MotionValues, err error)

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, title, body string) error

func (*Client) ReadDir added in v0.0.5

func (c *Client) ReadDir(ctx context.Context, dir string) (out []FileInfo, err error)

func (*Client) Remove added in v0.0.5

func (c *Client) Remove(ctx context.Context, paths ...string) error

func (*Client) RemoveAll added in v0.0.8

func (c *Client) RemoveAll(ctx context.Context, paths ...string) error

func (*Client) Rename added in v0.0.5

func (c *Client) Rename(ctx context.Context, old, new string) error

func (*Client) SetTime

func (c *Client) SetTime(ctx context.Context, t time.Time) error

func (*Client) StepCount

func (c *Client) StepCount(ctx context.Context) (out uint32, err error)

func (*Client) Upload added in v0.0.6

func (c *Client) Upload(ctx context.Context, dst, src string) (chan FSTransferProgress, error)

func (*Client) Version

func (c *Client) Version(ctx context.Context) (out string, err error)

func (*Client) WatchBatteryLevel

func (c *Client) WatchBatteryLevel(ctx context.Context) (<-chan uint8, error)

func (*Client) WatchHeartRate

func (c *Client) WatchHeartRate(ctx context.Context) (<-chan uint8, error)

func (*Client) WatchMotion

func (c *Client) WatchMotion(ctx context.Context) (<-chan infinitime.MotionValues, error)

func (*Client) WatchStepCount

func (c *Client) WatchStepCount(ctx context.Context) (<-chan uint32, error)

func (*Client) WeatherUpdate added in v0.0.6

func (c *Client) WeatherUpdate(ctx context.Context) error

type FSData added in v0.0.6

type FSData struct {
	Files []string
	Data  string
}

type FSTransferProgress added in v0.0.6

type FSTransferProgress struct {
	Total uint32
	Sent  uint32
}

type FileInfo added in v0.0.6

type FileInfo struct {
	Name  string
	Size  int64
	IsDir bool
}

func (FileInfo) String added in v0.0.6

func (fi FileInfo) String() string

type FwUpgradeData added in v0.0.6

type FwUpgradeData struct {
	Type  UpgradeType
	Files []string
}

type NotifyData added in v0.0.6

type NotifyData struct {
	Title string
	Body  string
}

type UpgradeType

type UpgradeType uint8
const (
	UpgradeTypeArchive UpgradeType = iota
	UpgradeTypeFiles
)

Jump to

Keyboard shortcuts

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