forked from Elara6331/itd
		
	Send response types in socket responses and create api package
This commit is contained in:
		| @@ -16,6 +16,22 @@ const ( | ||||
| 	ReqTypeWatchStepCount | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	ResTypeHeartRate = iota | ||||
| 	ResTypeBattLevel | ||||
| 	ResTypeFwVersion | ||||
| 	ResTypeDFUProgress | ||||
| 	ResTypeBtAddress | ||||
| 	ResTypeNotify | ||||
| 	ResTypeSetTime | ||||
| 	ResTypeWatchHeartRate | ||||
| 	ResTypeWatchBattLevel | ||||
| 	ResTypeMotion | ||||
| 	ResTypeWatchMotion | ||||
| 	ResTypeStepCount | ||||
| 	ResTypeWatchStepCount | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	UpgradeTypeArchive = iota | ||||
| 	UpgradeTypeFiles | ||||
| @@ -27,6 +43,7 @@ type ReqDataFwUpgrade struct { | ||||
| } | ||||
|  | ||||
| type Response struct { | ||||
| 	Type    int | ||||
| 	Value   interface{} `json:"value,omitempty"` | ||||
| 	Message string      `json:"msg,omitempty"` | ||||
| 	Error   bool        `json:"error"` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user