treadonme

package module
v0.0.0-...-7344258 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 8 Imported by: 0

README

Tread on Me

A Go library and integrated web server for interacting with BLE equipped treadmills by Sole (at least the Sole F80) from Linux.

I wanted to be able to get realtime telemetry from my treadmill and found the official app to be lacking flexibility.

Warning -- Please Read

This software allows you to change the configuration of your treadmill while it is operating; this could be dangerous.

While developing the software I ran across configurations that could cause the treadmill to disable the physical controls on the treadmill while the motor was engaged and running. The code and documentation presented here is based off trial and error while testing with my own treadmill, yours may act differently. Please use this software at your own risk.

Requirements

You'll need a Bluetooth LE adapter and a modern version of Linux. I'm using a Raspberry Pi 4 with its integrated BLE module. You'll also need Go version 1.16 or higher installed.

Installation

You can install this by running the following command:

go install github.com/swedishborgie/treadonme/webserver@latest

You can then run the application like this (you can use hcitool lescan if you need to discover the mac address):

webserver <mac address of treadmill>

Loading http://localhost:8080 (or http://your.ip.address:8080) should result in seeing a dashboard showing the current state of the application.

The treadmill does not listen for connections while in low power mode, the display must be active in order to connect.

Bluetooth LE Technical Details

The treadmill appears to use a fairly common integrated BLE to UART module. It advertises the following:

  • Service ID: 49535343-FE7D-4AE5-8FA9-9FAFD205E455

The service exposes two different characteristics that are required to communicate:

  • Read (Notify) - 49535343-1E4D-4BD9-BA61-23C647249616
  • Write - 49535343-8841-43F4-A8D4-ECBE34729BB3

To perform serial communication you'll subscribe to notifications for the read characteristic to receive messages from the treadmill, and you'll write messages to the write characteristic when you want to communicate.

The messages sent back and forth between the treadmill use a fairly straight forward serial protocol:

  • All messages begin with 0x5b followed immediately by a byte indicating the message length. All messages end with 0x5d.
  • Most messages seem to require an acknowledgement and there are two types: an ACK message (0x00) or repeating the received command back to the treadmill.
  • The first command you send should be Get Device Info (0xf0) which will result in the treadmill establishing communication.
  • Some messages are sent from the treadmill without any prompting from the host. These messages need to be acknowledged for communication to continue.
  • The treadmill cannot handle messages too quickly, even if messages have been promptly acknowledged. A short sleep (300-500ms) is usually sufficient between writes to let the treadmill catch up.

Messages

Name Code Request Response ACK Type Direction
Acknowledge 0x00 N/A 5b0400094f4b5d None Both
Set Workout Mode 0x02 5B0202025D 5B0202025D Echo Host -> Treadmill
Workout Mode 0x03 5B0203015D 5B0203015D Echo Treadmill -> Host
Workout Target 0x04 5B05040A0000005D 5b0400044f4b5d ACK Host -> Treadmill
Workout Data 0x06 5b0f06093b0000000000050000000000015d 5b0400064f4b5d ACK Treadmill -> Host
User Profile 0x07 5B06070123009B435D 5b0400074f4b5d ACK Host -> Treadmill
Program Type 0x08 5b030810015d 5b0400084f4b5d ACK Host -> Treadmill
Heart Rate Type 0x09 5b030901005d 5b0400094f4b5d ACK Treadmill -> Host
Error Code 0x10 5b0210005d 5b0400104f4b5d ACK Treadmill -> Host
End Workout 0x32 5b0a320013000000000800005d 5b0400324f4b5d ACK Treadmill -> Host
Get Device Info 0xF0 5B01F05D 5B08F092000178050F125D Echo (Kinda) Host -> Treadmill

Notes:

  • Speeds are specified in the units returned in the Get Device Info message and are specified in either kilometers per hour (for metric) or miles per hour (for imperial) and the value is multiplied by ten. So for instance if the units are imperial and the speed indicated is 62 the speed would be 6.2 miles per hour.
  • Similarly, distances are specified in either kilometers or miles and are multiplied by one hundred. So if a distance of 102 is returned and the units are imperial it would indicate a distance of 1.02 miles.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingCharacteristic = fmt.Errorf("missing expected characteristic")
	ErrMissingDescriptor     = fmt.Errorf("missing expected descriptor")
	ErrMissingService        = fmt.Errorf("missing expected service")
	ErrInvalidReadPayload    = fmt.Errorf("unexpected data from device")
	ErrAckTimeout            = fmt.Errorf("failed to get acknowledgement from device")
)
View Source
var ErrInvalidMessage = fmt.Errorf("invalid message")

Functions

func EncodeMessage

func EncodeMessage(msg Message) ([]byte, error)

Types

type CommandType

type CommandType byte
const (
	CommandTypeStart     CommandType = 0x01
	CommandTypeLevelUp   CommandType = 0x02
	CommandTypeLevelDown CommandType = 0x03
	CommandTypeStop      CommandType = 0x06
)

func (CommandType) String

func (ct CommandType) String() string

type DeviceModel

type DeviceModel byte
const (
	DeviceModelF80 DeviceModel = 146
)

func (DeviceModel) String

func (dm DeviceModel) String() string

type Height

type Height byte

type Message

type Message interface {
	MessageType() MessageType
	MarshalBinary() ([]byte, error)
	UnmarshalBinary([]byte) error
	ExpectedLength() int
	String() string
}

func ParseMessage

func ParseMessage(data []byte) (Message, error)

type MessageACK

type MessageACK struct {
	Acknowledged MessageType
}

func (*MessageACK) ExpectedLength

func (ack *MessageACK) ExpectedLength() int

func (*MessageACK) MarshalBinary

func (ack *MessageACK) MarshalBinary() ([]byte, error)

func (*MessageACK) MessageType

func (ack *MessageACK) MessageType() MessageType

func (*MessageACK) String

func (ack *MessageACK) String() string

func (*MessageACK) UnmarshalBinary

func (ack *MessageACK) UnmarshalBinary(data []byte) error

type MessageCommand

type MessageCommand struct {
	Command CommandType
}

func (*MessageCommand) ExpectedLength

func (e *MessageCommand) ExpectedLength() int

func (*MessageCommand) MarshalBinary

func (e *MessageCommand) MarshalBinary() ([]byte, error)

func (*MessageCommand) MessageType

func (e *MessageCommand) MessageType() MessageType

func (*MessageCommand) String

func (e *MessageCommand) String() string

func (*MessageCommand) UnmarshalBinary

func (e *MessageCommand) UnmarshalBinary(data []byte) error

type MessageDeviceInfo

type MessageDeviceInfo struct {
	Model       DeviceModel
	Version     byte
	Units       UnitsType
	MaxSpeed    Speed
	MinSpeed    Speed
	InclineMax  byte
	UserSegment byte
}

func (*MessageDeviceInfo) ExpectedLength

func (di *MessageDeviceInfo) ExpectedLength() int

func (*MessageDeviceInfo) MarshalBinary

func (di *MessageDeviceInfo) MarshalBinary() ([]byte, error)

func (*MessageDeviceInfo) MessageType

func (di *MessageDeviceInfo) MessageType() MessageType

func (*MessageDeviceInfo) String

func (di *MessageDeviceInfo) String() string

func (*MessageDeviceInfo) UnmarshalBinary

func (di *MessageDeviceInfo) UnmarshalBinary(data []byte) error

type MessageEndWorkout

type MessageEndWorkout struct {
	Seconds   uint16
	Distance  uint16
	Calories  uint16
	Speed     Speed
	HeartRate byte
	Incline   byte
}

func (*MessageEndWorkout) ExpectedLength

func (e *MessageEndWorkout) ExpectedLength() int

func (*MessageEndWorkout) MarshalBinary

func (e *MessageEndWorkout) MarshalBinary() ([]byte, error)

func (*MessageEndWorkout) MessageType

func (e *MessageEndWorkout) MessageType() MessageType

func (*MessageEndWorkout) String

func (e *MessageEndWorkout) String() string

func (*MessageEndWorkout) UnmarshalBinary

func (e *MessageEndWorkout) UnmarshalBinary(data []byte) error

type MessageErrorCode

type MessageErrorCode struct {
	Code byte
}

func (*MessageErrorCode) ExpectedLength

func (e *MessageErrorCode) ExpectedLength() int

func (*MessageErrorCode) MarshalBinary

func (e *MessageErrorCode) MarshalBinary() ([]byte, error)

func (*MessageErrorCode) MessageType

func (e *MessageErrorCode) MessageType() MessageType

func (*MessageErrorCode) String

func (e *MessageErrorCode) String() string

func (*MessageErrorCode) UnmarshalBinary

func (e *MessageErrorCode) UnmarshalBinary(data []byte) error

type MessageHeartRate

type MessageHeartRate struct {
	HeartRate byte
}

func (*MessageHeartRate) ExpectedLength

func (e *MessageHeartRate) ExpectedLength() int

func (*MessageHeartRate) MarshalBinary

func (e *MessageHeartRate) MarshalBinary() ([]byte, error)

func (*MessageHeartRate) MessageType

func (e *MessageHeartRate) MessageType() MessageType

func (*MessageHeartRate) String

func (e *MessageHeartRate) String() string

func (*MessageHeartRate) UnmarshalBinary

func (e *MessageHeartRate) UnmarshalBinary(data []byte) error

type MessageHeartRateType

type MessageHeartRateType struct {
	Type1 byte
	Type2 byte
}

func (*MessageHeartRateType) ExpectedLength

func (hr *MessageHeartRateType) ExpectedLength() int

func (*MessageHeartRateType) MarshalBinary

func (hr *MessageHeartRateType) MarshalBinary() ([]byte, error)

func (*MessageHeartRateType) MessageType

func (hr *MessageHeartRateType) MessageType() MessageType

func (*MessageHeartRateType) String

func (hr *MessageHeartRateType) String() string

func (*MessageHeartRateType) UnmarshalBinary

func (hr *MessageHeartRateType) UnmarshalBinary(data []byte) error

type MessageIncline

type MessageIncline struct {
	Incline byte
}

func (*MessageIncline) ExpectedLength

func (e *MessageIncline) ExpectedLength() int

func (*MessageIncline) MarshalBinary

func (e *MessageIncline) MarshalBinary() ([]byte, error)

func (*MessageIncline) MessageType

func (e *MessageIncline) MessageType() MessageType

func (*MessageIncline) String

func (e *MessageIncline) String() string

func (*MessageIncline) UnmarshalBinary

func (e *MessageIncline) UnmarshalBinary(data []byte) error

type MessageLevel

type MessageLevel struct {
	Level byte
}

func (*MessageLevel) ExpectedLength

func (e *MessageLevel) ExpectedLength() int

func (*MessageLevel) MarshalBinary

func (e *MessageLevel) MarshalBinary() ([]byte, error)

func (*MessageLevel) MessageType

func (e *MessageLevel) MessageType() MessageType

func (*MessageLevel) String

func (e *MessageLevel) String() string

func (*MessageLevel) UnmarshalBinary

func (e *MessageLevel) UnmarshalBinary(data []byte) error

type MessageListener

type MessageListener func(Message, error)

type MessageMaxIncline

type MessageMaxIncline struct {
	MaxIncline byte
}

func (*MessageMaxIncline) ExpectedLength

func (mi *MessageMaxIncline) ExpectedLength() int

func (*MessageMaxIncline) MarshalBinary

func (mi *MessageMaxIncline) MarshalBinary() ([]byte, error)

func (*MessageMaxIncline) MessageType

func (mi *MessageMaxIncline) MessageType() MessageType

func (*MessageMaxIncline) String

func (mi *MessageMaxIncline) String() string

func (*MessageMaxIncline) UnmarshalBinary

func (mi *MessageMaxIncline) UnmarshalBinary(data []byte) error

type MessageMaxLevel

type MessageMaxLevel struct {
	Level byte
}

func (*MessageMaxLevel) ExpectedLength

func (e *MessageMaxLevel) ExpectedLength() int

func (*MessageMaxLevel) MarshalBinary

func (e *MessageMaxLevel) MarshalBinary() ([]byte, error)

func (*MessageMaxLevel) MessageType

func (e *MessageMaxLevel) MessageType() MessageType

func (*MessageMaxLevel) String

func (e *MessageMaxLevel) String() string

func (*MessageMaxLevel) UnmarshalBinary

func (e *MessageMaxLevel) UnmarshalBinary(data []byte) error

type MessageMaxSpeed

type MessageMaxSpeed struct {
	Speed Speed
}

func (*MessageMaxSpeed) ExpectedLength

func (e *MessageMaxSpeed) ExpectedLength() int

func (*MessageMaxSpeed) MarshalBinary

func (e *MessageMaxSpeed) MarshalBinary() ([]byte, error)

func (*MessageMaxSpeed) MessageType

func (e *MessageMaxSpeed) MessageType() MessageType

func (*MessageMaxSpeed) String

func (e *MessageMaxSpeed) String() string

func (*MessageMaxSpeed) UnmarshalBinary

func (e *MessageMaxSpeed) UnmarshalBinary(data []byte) error

type MessageProgram

type MessageProgram struct {
	Program Program
}

func (*MessageProgram) ExpectedLength

func (e *MessageProgram) ExpectedLength() int

func (*MessageProgram) MarshalBinary

func (e *MessageProgram) MarshalBinary() ([]byte, error)

func (*MessageProgram) MessageType

func (e *MessageProgram) MessageType() MessageType

func (*MessageProgram) String

func (e *MessageProgram) String() string

func (*MessageProgram) UnmarshalBinary

func (e *MessageProgram) UnmarshalBinary(data []byte) error

type MessageProgramGraphics

type MessageProgramGraphics struct {
	Graph [18]byte
}

func (*MessageProgramGraphics) ExpectedLength

func (e *MessageProgramGraphics) ExpectedLength() int

func (*MessageProgramGraphics) MarshalBinary

func (e *MessageProgramGraphics) MarshalBinary() ([]byte, error)

func (*MessageProgramGraphics) MessageType

func (e *MessageProgramGraphics) MessageType() MessageType

func (*MessageProgramGraphics) String

func (e *MessageProgramGraphics) String() string

func (*MessageProgramGraphics) UnmarshalBinary

func (e *MessageProgramGraphics) UnmarshalBinary(data []byte) error

type MessageRPM

type MessageRPM struct {
	RPM byte
}

func (*MessageRPM) ExpectedLength

func (e *MessageRPM) ExpectedLength() int

func (*MessageRPM) MarshalBinary

func (e *MessageRPM) MarshalBinary() ([]byte, error)

func (*MessageRPM) MessageType

func (e *MessageRPM) MessageType() MessageType

func (*MessageRPM) String

func (e *MessageRPM) String() string

func (*MessageRPM) UnmarshalBinary

func (e *MessageRPM) UnmarshalBinary(data []byte) error

type MessageSetWorkoutMode

type MessageSetWorkoutMode struct {
	Mode WorkoutMode
}

func (*MessageSetWorkoutMode) ExpectedLength

func (wm *MessageSetWorkoutMode) ExpectedLength() int

func (*MessageSetWorkoutMode) MarshalBinary

func (wm *MessageSetWorkoutMode) MarshalBinary() ([]byte, error)

func (*MessageSetWorkoutMode) MessageType

func (wm *MessageSetWorkoutMode) MessageType() MessageType

func (*MessageSetWorkoutMode) String

func (wm *MessageSetWorkoutMode) String() string

func (*MessageSetWorkoutMode) UnmarshalBinary

func (wm *MessageSetWorkoutMode) UnmarshalBinary(data []byte) error

type MessageSpeed

type MessageSpeed struct {
	Speed Speed
}

func (*MessageSpeed) ExpectedLength

func (e *MessageSpeed) ExpectedLength() int

func (*MessageSpeed) MarshalBinary

func (e *MessageSpeed) MarshalBinary() ([]byte, error)

func (*MessageSpeed) MessageType

func (e *MessageSpeed) MessageType() MessageType

func (*MessageSpeed) String

func (e *MessageSpeed) String() string

func (*MessageSpeed) UnmarshalBinary

func (e *MessageSpeed) UnmarshalBinary(data []byte) error

type MessageTargetHeartRate

type MessageTargetHeartRate struct {
	HeartRate byte
}

func (*MessageTargetHeartRate) ExpectedLength

func (e *MessageTargetHeartRate) ExpectedLength() int

func (*MessageTargetHeartRate) MarshalBinary

func (e *MessageTargetHeartRate) MarshalBinary() ([]byte, error)

func (*MessageTargetHeartRate) MessageType

func (e *MessageTargetHeartRate) MessageType() MessageType

func (*MessageTargetHeartRate) String

func (e *MessageTargetHeartRate) String() string

func (*MessageTargetHeartRate) UnmarshalBinary

func (e *MessageTargetHeartRate) UnmarshalBinary(data []byte) error

type MessageType

type MessageType byte
const (
	MessageTypeACK             MessageType = 0x00
	MessageTypeSetWorkoutMode  MessageType = 0x02
	MessageTypeWorkoutMode     MessageType = 0x03
	MessageTypeWorkoutTarget   MessageType = 0x04
	MessageTypeWorkoutData     MessageType = 0x06
	MessageTypeUserProfile     MessageType = 0x07
	MessageTypeProgram         MessageType = 0x08
	MessageTypeHeartRateType   MessageType = 0x09
	MessageTypeErrorCode       MessageType = 0x10
	MessageTypeSpeed           MessageType = 0x11
	MessageTypeIncline         MessageType = 0x12
	MessageTypeLevel           MessageType = 0x13
	MessageTypeRPM             MessageType = 0x14
	MessageTypeHeartRate       MessageType = 0x15
	MessageTypeTargetHeartRate MessageType = 0x20
	MessageTypeMaxSpeed        MessageType = 0x21
	MessageTypeMaxIncline      MessageType = 0x22
	MessageTypeMaxLevel        MessageType = 0x23
	MessageTypeUserIncline     MessageType = 0x25
	MessageTypeUserLevel       MessageType = 0x27
	MessageTypeEndWorkout      MessageType = 0x32
	MessageTypeProgramGraphics MessageType = 0x40
	MessageTypeDeviceInfo      MessageType = 0xf0
	MessageTypeCommand         MessageType = 0xf1
	MessageTypeUnknown         MessageType = 0xff
)

func (MessageType) Create

func (mt MessageType) Create() Message

func (MessageType) String

func (mt MessageType) String() string

type MessageUserIncline

type MessageUserIncline struct {
	Incline byte
}

func (*MessageUserIncline) ExpectedLength

func (e *MessageUserIncline) ExpectedLength() int

func (*MessageUserIncline) MarshalBinary

func (e *MessageUserIncline) MarshalBinary() ([]byte, error)

func (*MessageUserIncline) MessageType

func (e *MessageUserIncline) MessageType() MessageType

func (*MessageUserIncline) String

func (e *MessageUserIncline) String() string

func (*MessageUserIncline) UnmarshalBinary

func (e *MessageUserIncline) UnmarshalBinary(data []byte) error

type MessageUserLevel

type MessageUserLevel struct {
	Level byte
}

func (*MessageUserLevel) ExpectedLength

func (e *MessageUserLevel) ExpectedLength() int

func (*MessageUserLevel) MarshalBinary

func (e *MessageUserLevel) MarshalBinary() ([]byte, error)

func (*MessageUserLevel) MessageType

func (e *MessageUserLevel) MessageType() MessageType

func (*MessageUserLevel) String

func (e *MessageUserLevel) String() string

func (*MessageUserLevel) UnmarshalBinary

func (e *MessageUserLevel) UnmarshalBinary(data []byte) error

type MessageUserProfile

type MessageUserProfile struct {
	Sex    SexType
	Age    byte
	Weight Weight
	Height Height
}

func (*MessageUserProfile) ExpectedLength

func (p *MessageUserProfile) ExpectedLength() int

func (*MessageUserProfile) MarshalBinary

func (p *MessageUserProfile) MarshalBinary() ([]byte, error)

func (*MessageUserProfile) MessageType

func (p *MessageUserProfile) MessageType() MessageType

func (*MessageUserProfile) String

func (p *MessageUserProfile) String() string

func (*MessageUserProfile) UnmarshalBinary

func (p *MessageUserProfile) UnmarshalBinary(data []byte) error

type MessageWorkoutData

type MessageWorkoutData struct {
	Minute        byte
	Second        byte
	Distance      uint16
	Calories      uint16
	HeartRate     byte
	Speed         Speed
	Incline       byte
	HRType        byte
	IntervalTime  byte
	RecoveryTime  byte
	ProgramRow    byte
	ProgramColumn byte
}

func (*MessageWorkoutData) ExpectedLength

func (wd *MessageWorkoutData) ExpectedLength() int

func (*MessageWorkoutData) MarshalBinary

func (wd *MessageWorkoutData) MarshalBinary() ([]byte, error)

func (*MessageWorkoutData) MessageType

func (wd *MessageWorkoutData) MessageType() MessageType

func (*MessageWorkoutData) String

func (wd *MessageWorkoutData) String() string

func (*MessageWorkoutData) UnmarshalBinary

func (wd *MessageWorkoutData) UnmarshalBinary(data []byte) error

type MessageWorkoutMode

type MessageWorkoutMode struct {
	Mode WorkoutMode
}

func (*MessageWorkoutMode) ExpectedLength

func (wm *MessageWorkoutMode) ExpectedLength() int

func (*MessageWorkoutMode) MarshalBinary

func (wm *MessageWorkoutMode) MarshalBinary() ([]byte, error)

func (*MessageWorkoutMode) MessageType

func (wm *MessageWorkoutMode) MessageType() MessageType

func (*MessageWorkoutMode) String

func (wm *MessageWorkoutMode) String() string

func (*MessageWorkoutMode) UnmarshalBinary

func (wm *MessageWorkoutMode) UnmarshalBinary(data []byte) error

type MessageWorkoutTarget

type MessageWorkoutTarget struct {
	Time     byte
	Calories uint16
}

func (*MessageWorkoutTarget) ExpectedLength

func (wt *MessageWorkoutTarget) ExpectedLength() int

func (*MessageWorkoutTarget) MarshalBinary

func (wt *MessageWorkoutTarget) MarshalBinary() ([]byte, error)

func (*MessageWorkoutTarget) MessageType

func (wt *MessageWorkoutTarget) MessageType() MessageType

func (*MessageWorkoutTarget) String

func (wt *MessageWorkoutTarget) String() string

func (*MessageWorkoutTarget) UnmarshalBinary

func (wt *MessageWorkoutTarget) UnmarshalBinary(data []byte) error

type Program

type Program uint16
const (
	ProgramManual   Program = 0x1001 //0x10 0x01
	ProgramHill     Program = 0x2002 //0x20 0x02
	ProgramFatBurn  Program = 0x2003 //0x20 0x03
	ProgramCardio   Program = 0x2004 //0x20 0x04
	ProgramStrength Program = 0x2005 //0x20 0x05
	ProgramInterval Program = 0x2006 //0x20 0x06
	ProgramHR1      Program = 0x3009 //0x30 0x09
	ProgramHR2      Program = 0x300a //0x30 0x0a
	ProgramUser1    Program = 0x3007 //0x30 0x07
	ProgramUser2    Program = 0x3008 //0x30 0x08
	ProgramFusion   Program = 0x600c //0x60 0x0c
)

func (Program) String

func (p Program) String() string

type SexType

type SexType byte
const (
	SexTypeMale   SexType = 0x01
	SexTypeFemale SexType = 0x02
)

func (SexType) String

func (st SexType) String() string

type Speed

type Speed byte

type Treadmill

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

func New

func New(addr string) (*Treadmill, error)

func (*Treadmill) AddListener

func (t *Treadmill) AddListener(listener MessageListener)

func (*Treadmill) Close

func (t *Treadmill) Close() error

func (*Treadmill) Connect

func (t *Treadmill) Connect(ctx context.Context) error

func (*Treadmill) GetDeviceInfo

func (t *Treadmill) GetDeviceInfo() (*MessageDeviceInfo, error)

func (*Treadmill) LevelUp

func (t *Treadmill) LevelUp() error

func (*Treadmill) SetMaxIncline

func (t *Treadmill) SetMaxIncline(maxIncline byte) error

func (*Treadmill) SetProgram

func (t *Treadmill) SetProgram(program Program) error

func (*Treadmill) SetUserProfile

func (t *Treadmill) SetUserProfile(sex SexType, age byte, weight Weight, height Height) error

func (*Treadmill) SetWorkoutMode

func (t *Treadmill) SetWorkoutMode(mode WorkoutMode) error

func (*Treadmill) SetWorkoutTime

func (t *Treadmill) SetWorkoutTime(tm time.Duration) error

func (*Treadmill) Start

func (t *Treadmill) Start() error

func (*Treadmill) WaitForResponse

func (t *Treadmill) WaitForResponse(ctx context.Context, msgType MessageType) (Message, error)

type UnitsType

type UnitsType byte
const (
	UnitsTypeMetric   UnitsType = 0x0
	UnitsTypeImperial UnitsType = 0x1
)

func (UnitsType) String

func (ut UnitsType) String() string

type Weight

type Weight uint16

type WorkoutMode

type WorkoutMode byte
const (
	WorkoutModeIdle    WorkoutMode = 0x01
	WorkoutModeStart   WorkoutMode = 0x02
	WorkoutModeRunning WorkoutMode = 0x04
	WorkoutModePause   WorkoutMode = 0x06
	WorkoutModeDone    WorkoutMode = 0x07
)

func (WorkoutMode) String

func (wm WorkoutMode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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