feat(AveragePosition/GetNTRIPMountPoint): change return type, update cmd average_position

This commit is contained in:
2025-06-12 14:43:41 +02:00
parent 2c5d1442fe
commit 1fcf748310
11 changed files with 148 additions and 187 deletions

View File

@ -12,10 +12,10 @@ type BaseInfo struct {
Height float64
Accumulation int
}
type TaskMessage struct {
Name string `json:"name"`
State string `json:"state"`
Payload map[string]interface{} `json:"payload"`
type TaskMessage[T any] struct {
Name string `json:"name"`
State string `json:"state"`
Payload T `json:"payload"`
}
type Operations interface {
@ -51,10 +51,10 @@ type Operations interface {
Reboot(ctx context.Context) error
// AveragePosition gathers data and computes the average position
AveragePosition(ctx context.Context) (*TaskMessage, error)
AveragePosition(ctx context.Context) (*TaskMessage[AveragePositionPayload], error)
//GetNTRIPMountPoint retrieves availables mount point
GetNTRIPMountPoint(ctx context.Context) error
GetNTRIPMountPoint(ctx context.Context) (*TaskMessage[NTRIPPayload], error)
//SetBaseCorrections updates the corrections obtaining station
SetBaseCorrections(ctx context.Context, funcs ...SetBaseCorrectionsFunc) error