Switch to iota for request types and move to types package

This commit is contained in:
2021-08-24 20:32:17 -07:00
parent 7786ea1d58
commit cb8d207249
11 changed files with 62 additions and 60 deletions

View File

@@ -1,5 +1,20 @@
package types
const (
ReqTypeHeartRate = iota
ReqTypeBattLevel
ReqTypeFwVersion
ReqTypeFwUpgrade
ReqTypeBtAddress
ReqTypeNotify
ReqTypeSetTime
)
const (
UpgradeTypeArchive = iota
UpgradeTypeFiles
)
type ReqDataFwUpgrade struct {
Type int
Files []string
@@ -12,11 +27,11 @@ type Response struct {
}
type Request struct {
Type string `json:"type"`
Type int `json:"type"`
Data interface{} `json:"data,omitempty"`
}
type ReqDataNotify struct {
Title string
Body string
}
}