itd/internal/types/types.go

45 lines
733 B
Go
Raw Normal View History

2021-08-21 08:19:49 +00:00
package types
const (
ReqTypeHeartRate = iota
ReqTypeBattLevel
ReqTypeFwVersion
ReqTypeFwUpgrade
ReqTypeBtAddress
ReqTypeNotify
ReqTypeSetTime
2021-08-26 04:18:24 +00:00
ReqTypeWatchHeartRate
ReqTypeWatchBattLevel
)
const (
UpgradeTypeArchive = iota
UpgradeTypeFiles
)
2021-08-21 08:19:49 +00:00
type ReqDataFwUpgrade struct {
Type int
Files []string
}
type Response struct {
Value interface{} `json:"value,omitempty"`
Message string `json:"msg,omitempty"`
Error bool `json:"error"`
}
type Request struct {
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-26 04:18:24 +00:00
type DFUProgress struct {
Received int64 `mapstructure:"recvd"`
Total int64 `mapstructure:"total"`
}