itd/api/get.go

74 lines
1007 B
Go
Raw Normal View History

2022-04-23 00:12:30 +00:00
package api
import (
2022-05-01 22:22:28 +00:00
"context"
2022-04-23 00:12:30 +00:00
"go.arsenm.dev/infinitime"
)
2022-05-01 22:22:28 +00:00
func (c *Client) HeartRate(ctx context.Context) (out uint8, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"HeartRate",
nil,
&out,
)
return
}
2022-05-01 22:22:28 +00:00
func (c *Client) BatteryLevel(ctx context.Context) (out uint8, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"BatteryLevel",
nil,
&out,
)
return
}
2022-05-01 22:22:28 +00:00
func (c *Client) Motion(ctx context.Context) (out infinitime.MotionValues, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"Motion",
nil,
&out,
)
return
}
2022-05-01 22:22:28 +00:00
func (c *Client) StepCount(ctx context.Context) (out uint32, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"StepCount",
nil,
&out,
)
return
}
2022-05-01 22:22:28 +00:00
func (c *Client) Version(ctx context.Context) (out string, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"Version",
nil,
&out,
)
return
}
2022-05-01 22:22:28 +00:00
func (c *Client) Address(ctx context.Context) (out string, err error) {
err = c.client.Call(
2022-05-01 22:22:28 +00:00
ctx,
"ITD",
2022-04-23 00:12:30 +00:00
"Address",
nil,
&out,
)
return
}