2021-08-21 01:19:49 -07:00
|
|
|
package types
|
|
|
|
|
2021-08-24 20:32:17 -07:00
|
|
|
const (
|
|
|
|
ReqTypeHeartRate = iota
|
|
|
|
ReqTypeBattLevel
|
|
|
|
ReqTypeFwVersion
|
|
|
|
ReqTypeFwUpgrade
|
|
|
|
ReqTypeBtAddress
|
|
|
|
ReqTypeNotify
|
|
|
|
ReqTypeSetTime
|
2021-08-25 21:18:24 -07:00
|
|
|
ReqTypeWatchHeartRate
|
|
|
|
ReqTypeWatchBattLevel
|
2021-10-22 13:21:14 -07:00
|
|
|
ReqTypeMotion
|
|
|
|
ReqTypeWatchMotion
|
|
|
|
ReqTypeStepCount
|
|
|
|
ReqTypeWatchStepCount
|
2021-10-23 18:03:17 -07:00
|
|
|
ReqTypeCancel
|
2021-08-24 20:32:17 -07:00
|
|
|
)
|
|
|
|
|
2021-10-22 20:47:57 -07:00
|
|
|
const (
|
|
|
|
ResTypeHeartRate = iota
|
|
|
|
ResTypeBattLevel
|
|
|
|
ResTypeFwVersion
|
|
|
|
ResTypeDFUProgress
|
|
|
|
ResTypeBtAddress
|
|
|
|
ResTypeNotify
|
|
|
|
ResTypeSetTime
|
|
|
|
ResTypeWatchHeartRate
|
|
|
|
ResTypeWatchBattLevel
|
|
|
|
ResTypeMotion
|
|
|
|
ResTypeWatchMotion
|
|
|
|
ResTypeStepCount
|
|
|
|
ResTypeWatchStepCount
|
2021-10-23 18:03:17 -07:00
|
|
|
ResTypeCancel
|
2021-10-22 20:47:57 -07:00
|
|
|
)
|
|
|
|
|
2021-08-24 20:32:17 -07:00
|
|
|
const (
|
|
|
|
UpgradeTypeArchive = iota
|
|
|
|
UpgradeTypeFiles
|
|
|
|
)
|
|
|
|
|
2021-08-21 01:19:49 -07:00
|
|
|
type ReqDataFwUpgrade struct {
|
|
|
|
Type int
|
|
|
|
Files []string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Response struct {
|
2021-10-22 22:14:01 -07:00
|
|
|
Type int `json:"type"`
|
2021-08-21 01:19:49 -07:00
|
|
|
Value interface{} `json:"value,omitempty"`
|
|
|
|
Message string `json:"msg,omitempty"`
|
2021-10-23 18:03:17 -07:00
|
|
|
ID string `json:"id,omitempty"`
|
2021-08-21 01:19:49 -07:00
|
|
|
Error bool `json:"error"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Request struct {
|
2021-08-24 20:32:17 -07:00
|
|
|
Type int `json:"type"`
|
2021-08-21 01:19:49 -07:00
|
|
|
Data interface{} `json:"data,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ReqDataNotify struct {
|
|
|
|
Title string
|
|
|
|
Body string
|
2021-08-24 20:32:17 -07:00
|
|
|
}
|
2021-08-25 21:18:24 -07:00
|
|
|
|
|
|
|
type DFUProgress struct {
|
|
|
|
Received int64 `mapstructure:"recvd"`
|
|
|
|
Total int64 `mapstructure:"total"`
|
|
|
|
}
|
2021-10-22 13:42:33 -07:00
|
|
|
|
|
|
|
type MotionValues struct {
|
|
|
|
X int16
|
|
|
|
Y int16
|
|
|
|
Z int16
|
|
|
|
}
|