diff --git a/hands/hands.go b/hands/hands.go index fc1c1c3..6bccf2f 100644 --- a/hands/hands.go +++ b/hands/hands.go @@ -11,18 +11,6 @@ import ( "time" ) -// 传感器数据结构体 -type SensorData struct { - Interface string `json:"interface"` - Thumb int `json:"thumb"` - Index int `json:"index"` - Middle int `json:"middle"` - Ring int `json:"ring"` - Pinky int `json:"pinky"` - PalmPosition []byte `json:"palmPosition"` - LastUpdate time.Time `json:"lastUpdate"` -} - // 手型配置结构体 type HandConfig struct { HandType string `json:"handType"` diff --git a/hands/sensor.go b/hands/sensor.go index 515abe3..a8185d7 100644 --- a/hands/sensor.go +++ b/hands/sensor.go @@ -7,6 +7,18 @@ import ( "time" ) +// 传感器数据结构体 +type SensorData struct { + Interface string `json:"interface"` + Thumb int `json:"thumb"` + Index int `json:"index"` + Middle int `json:"middle"` + Ring int `json:"ring"` + Pinky int `json:"pinky"` + PalmPosition []byte `json:"palmPosition"` + LastUpdate time.Time `json:"lastUpdate"` +} + var ( SensorDataMap map[string]*SensorData // 每个接口的传感器数据 SensorMutex sync.RWMutex