Compare commits
7 Commits
3885abbcc5
...
2c5d1442fe
Author | SHA1 | Date | |
---|---|---|---|
2c5d1442fe | |||
5a8f4301cb | |||
af3b3b40f3 | |||
3224e1ef0f | |||
359a0018c5 | |||
f560465364 | |||
abebc7d8c6 |
@ -17,14 +17,12 @@ var (
|
|||||||
host string = "192.168.42.1"
|
host string = "192.168.42.1"
|
||||||
filter string = ""
|
filter string = ""
|
||||||
rawLogLevel string = "ERROR"
|
rawLogLevel string = "ERROR"
|
||||||
messageType string = "broadcast"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.StringVar(&rawLogLevel, "log-level", rawLogLevel, "log level")
|
flag.StringVar(&rawLogLevel, "log-level", rawLogLevel, "log level")
|
||||||
flag.StringVar(&host, "host", host, "the reachrs module host")
|
flag.StringVar(&host, "host", host, "the reachrs module host")
|
||||||
flag.StringVar(&filter, "filter", filter, "filter the socket messages by name")
|
flag.StringVar(&filter, "filter", filter, "filter the broadcast messages by name")
|
||||||
flag.StringVar(&messageType, "messageType", messageType, "socket messages by name")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -53,7 +51,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
broadcasts, err := reach.OnMessageType(ctx, client, messageType)
|
broadcasts, err := reach.OnBroadcast(ctx, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("[FATAL] %+v", errors.WithStack(err))
|
fmt.Printf("[FATAL] %+v", errors.WithStack(err))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -2,7 +2,6 @@ package testsuite
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
@ -241,6 +240,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
|
||||||
|
}
|
||||||
|
t.Logf("Task Message : %s", taskmessage)
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "SetBaseModeAveragePosition",
|
Name: "SetBaseModeAveragePosition",
|
||||||
Run: func(t *testing.T, ops protocol.Operations) {
|
Run: func(t *testing.T, ops protocol.Operations) {
|
||||||
@ -266,7 +289,7 @@ var testCases = []operationTestCase{
|
|||||||
protocol.WithBaseLongitude(longitude),
|
protocol.WithBaseLongitude(longitude),
|
||||||
protocol.WithBaseHeight(height),
|
protocol.WithBaseHeight(height),
|
||||||
protocol.WithBaseAntennaOffset(antennaOffset),
|
protocol.WithBaseAntennaOffset(antennaOffset),
|
||||||
protocol.WithBaseMode(fmt.Sprintf("%s-and-hold", "fix")),
|
protocol.WithBaseMode("fix-and-hold"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ops.SetBase(ctx, opts...); err != nil {
|
if err := ops.SetBase(ctx, opts...); err != nil {
|
||||||
@ -332,30 +355,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
|
|
||||||
}
|
|
||||||
fmt.Println(taskmessage)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "GetNTRIPMountPoint",
|
Name: "GetNTRIPMountPoint",
|
||||||
Run: func(t *testing.T, ops protocol.Operations) {
|
Run: func(t *testing.T, ops protocol.Operations) {
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
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{
|
config := &model.IOConfig{
|
||||||
// todo parametrage du type ????
|
// todo parametrage du type
|
||||||
IOType: "ntripcli",
|
IOType: "ntripcli",
|
||||||
Settings: model.IOConfigSettings{
|
Settings: model.IOConfigSettings{
|
||||||
NTRIPCli: model.NTRIPCliConfig{
|
NTRIPCli: model.NTRIPCliConfig{
|
||||||
|
Reference in New Issue
Block a user