Generalize socket cancellation and update API accordingly

This commit is contained in:
2021-10-23 18:03:17 -07:00
parent ef4bad94b5
commit e198b769f9
9 changed files with 211 additions and 76 deletions

View File

@@ -9,15 +9,12 @@ const (
ReqTypeNotify
ReqTypeSetTime
ReqTypeWatchHeartRate
ReqTypeCancelHeartRate
ReqTypeWatchBattLevel
ReqTypeCancelBattLevel
ReqTypeMotion
ReqTypeWatchMotion
ReqTypeCancelMotion
ReqTypeStepCount
ReqTypeWatchStepCount
ReqTypeCancelStepCount
ReqTypeCancel
)
const (
@@ -29,15 +26,12 @@ const (
ResTypeNotify
ResTypeSetTime
ResTypeWatchHeartRate
ResTypeCancelHeartRate
ResTypeWatchBattLevel
ResTypeCancelBattLevel
ResTypeMotion
ResTypeWatchMotion
ResTypeCancelMotion
ResTypeStepCount
ResTypeWatchStepCount
ResTypeCancelStepCount
ResTypeCancel
)
const (
@@ -54,6 +48,7 @@ type Response struct {
Type int `json:"type"`
Value interface{} `json:"value,omitempty"`
Message string `json:"msg,omitempty"`
ID string `json:"id,omitempty"`
Error bool `json:"error"`
}