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