Compare commits
5 Commits
2c5d1442fe
...
3885abbcc5
Author | SHA1 | Date | |
---|---|---|---|
3885abbcc5 | |||
49a4642db2 | |||
ecf5fb46a0 | |||
38a1d5a2c6 | |||
9cbf5b1cde |
@ -17,12 +17,14 @@ var (
|
||||
host string = "192.168.42.1"
|
||||
filter string = ""
|
||||
rawLogLevel string = "ERROR"
|
||||
messageType string = "broadcast"
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&rawLogLevel, "log-level", rawLogLevel, "log level")
|
||||
flag.StringVar(&host, "host", host, "the reachrs module host")
|
||||
flag.StringVar(&filter, "filter", filter, "filter the broadcast messages by name")
|
||||
flag.StringVar(&filter, "filter", filter, "filter the socket messages by name")
|
||||
flag.StringVar(&messageType, "messageType", messageType, "socket messages by name")
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -51,7 +53,7 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
broadcasts, err := reach.OnBroadcast(ctx, client)
|
||||
broadcasts, err := reach.OnMessageType(ctx, client, messageType)
|
||||
if err != nil {
|
||||
fmt.Printf("[FATAL] %+v", errors.WithStack(err))
|
||||
os.Exit(1)
|
||||
|
@ -2,6 +2,7 @@ package testsuite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"os"
|
||||
@ -240,30 +241,6 @@ var testCases = []operationTestCase{
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "AveragePosition",
|
||||
Run: func(t *testing.T, ops protocol.Operations) {
|
||||
ctx := context.Background()
|
||||
|
||||
if err := ops.Connect(ctx); err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := ops.Close(ctx); err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
}
|
||||
}()
|
||||
|
||||
taskmessage, err := ops.AveragePosition(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
return
|
||||
}
|
||||
t.Logf("Task Message : %s", taskmessage)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "SetBaseModeAveragePosition",
|
||||
Run: func(t *testing.T, ops protocol.Operations) {
|
||||
@ -289,7 +266,7 @@ var testCases = []operationTestCase{
|
||||
protocol.WithBaseLongitude(longitude),
|
||||
protocol.WithBaseHeight(height),
|
||||
protocol.WithBaseAntennaOffset(antennaOffset),
|
||||
protocol.WithBaseMode("fix-and-hold"),
|
||||
protocol.WithBaseMode(fmt.Sprintf("%s-and-hold", "fix")),
|
||||
}
|
||||
|
||||
if err := ops.SetBase(ctx, opts...); err != nil {
|
||||
@ -355,6 +332,30 @@ var testCases = []operationTestCase{
|
||||
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "AveragePosition",
|
||||
Run: func(t *testing.T, ops protocol.Operations) {
|
||||
ctx := context.Background()
|
||||
|
||||
if err := ops.Connect(ctx); err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
return
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := ops.Close(ctx); err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
}
|
||||
}()
|
||||
|
||||
taskmessage, err := ops.AveragePosition(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("%+v", errors.WithStack(err))
|
||||
return
|
||||
}
|
||||
fmt.Println(taskmessage)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "GetNTRIPMountPoint",
|
||||
Run: func(t *testing.T, ops protocol.Operations) {
|
||||
|
16
reach/client/protocol/testsuite/operations_test.go
Normal file
16
reach/client/protocol/testsuite/operations_test.go
Normal file
@ -0,0 +1,16 @@
|
||||
package testsuite
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"forge.cadoles.com/cadoles/go-emlid/reach/client"
|
||||
"forge.cadoles.com/cadoles/go-emlid/reach/client/protocol"
|
||||
)
|
||||
|
||||
func TestReachOperations(t *testing.T) {
|
||||
opsFactory := func(addr string) (protocol.Operations, error) {
|
||||
return client.NewClient(addr), nil
|
||||
}
|
||||
|
||||
TestOperations(t, opsFactory)
|
||||
}
|
@ -347,7 +347,7 @@ func (o *Operations) SetBaseCorrections(ctx context.Context, funcs ...protocol.S
|
||||
}
|
||||
|
||||
config := &model.IOConfig{
|
||||
// todo parametrage du type
|
||||
// todo parametrage du type ????
|
||||
IOType: "ntripcli",
|
||||
Settings: model.IOConfigSettings{
|
||||
NTRIPCli: model.NTRIPCliConfig{
|
||||
|
Reference in New Issue
Block a user