Skip to content

Commit

Permalink
chore: Convert device ID to hexadecimal string format
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Sep 8, 2024
1 parent f9b145b commit d171a23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/v1/station/explorer.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package station

import (
"fmt"

"github.com/anyshake/observer/drivers/explorer"
"github.com/anyshake/observer/utils/timesource"
)

func (e *explorerInfo) get(timeSource *timesource.Source, explorerDeps *explorer.ExplorerDependency) error {
e.DeviceId = explorerDeps.Config.GetDeviceId()
e.DeviceId = fmt.Sprintf("%08X", explorerDeps.Config.GetDeviceId())
e.Elevation = explorerDeps.Config.GetElevation()
e.Errors = explorerDeps.Health.GetErrors()
e.Received = explorerDeps.Health.GetReceived()
Expand Down
2 changes: 1 addition & 1 deletion api/v1/station/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type explorerInfo struct {
Errors int64 `json:"errors"`
Received int64 `json:"received"`
SampleRate int `json:"sample_rate"`
DeviceId uint32 `json:"device_id"`
DeviceId string `json:"device_id"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Elevation float64 `json:"elevation"`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/src/models/response/common/station/0.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"errors": 47,
"received": 131,
"sample_rate": 125,
"device_id": 20030813,
"device_id": "FFFFFFFF",
"latitude": 39.9,
"longitude": 116.4,
"elevation": 50.0,
Expand Down

0 comments on commit d171a23

Please sign in to comment.