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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"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) {
|
2022-05-01 18:36:28 +00:00
|
|
|
err = c.client.Call(
|
2022-05-01 22:22:28 +00:00
|
|
|
ctx,
|
2022-05-01 18:36:28 +00:00
|
|
|
"ITD",
|
2022-04-23 00:12:30 +00:00
|
|
|
"Address",
|
|
|
|
nil,
|
|
|
|
&out,
|
|
|
|
)
|
|
|
|
return
|
|
|
|
}
|