format
This commit is contained in:
parent
f380631b5e
commit
3c1a96c8e0
|
@ -9,9 +9,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
|
"github.com/kschamplin/gotelem"
|
||||||
"github.com/kschamplin/gotelem/internal/logparsers"
|
"github.com/kschamplin/gotelem/internal/logparsers"
|
||||||
"github.com/kschamplin/gotelem/skylab"
|
"github.com/kschamplin/gotelem/skylab"
|
||||||
"github.com/kschamplin/gotelem"
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
|
@ -96,7 +96,6 @@ func (s *socketCANService) Start(cCtx *cli.Context, deps svcDeps) (err error) {
|
||||||
|
|
||||||
frame, err = skylab.ToCanFrame(msg.Data)
|
frame, err = skylab.ToCanFrame(msg.Data)
|
||||||
|
|
||||||
|
|
||||||
s.sock.Send(&frame)
|
s.sock.Send(&frame)
|
||||||
|
|
||||||
case msg := <-rxCan:
|
case msg := <-rxCan:
|
||||||
|
@ -107,7 +106,7 @@ func (s *socketCANService) Start(cCtx *cli.Context, deps svcDeps) (err error) {
|
||||||
}
|
}
|
||||||
cde := skylab.BusEvent{
|
cde := skylab.BusEvent{
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
Name: p.String(),
|
Name: p.String(),
|
||||||
Data: p,
|
Data: p,
|
||||||
}
|
}
|
||||||
broker.Publish("socketCAN", cde)
|
broker.Publish("socketCAN", cde)
|
||||||
|
|
4
db.go
4
db.go
|
@ -321,7 +321,6 @@ func (e DocumentNotFoundError) Error() string {
|
||||||
return fmt.Sprintf("document could not find key: %s", string(e))
|
return fmt.Sprintf("document could not find key: %s", string(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateDocument replaces the entire contents of a document matching
|
// UpdateDocument replaces the entire contents of a document matching
|
||||||
// the given key. Note that the key is derived from the document,
|
// the given key. Note that the key is derived from the document,
|
||||||
// and no checks are done to ensure that the new key is the same.
|
// and no checks are done to ensure that the new key is the same.
|
||||||
|
@ -343,7 +342,6 @@ func (tdb *TelemDb) UpdateDocument(ctx context.Context, key string,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetDocument gets the document matching the corresponding key.
|
// GetDocument gets the document matching the corresponding key.
|
||||||
func (tdb *TelemDb) GetDocument(ctx context.Context, key string) (json.RawMessage, error) {
|
func (tdb *TelemDb) GetDocument(ctx context.Context, key string) (json.RawMessage, error) {
|
||||||
const get = `SELECT data FROM openmct_objects WHERE key IS ?`
|
const get = `SELECT data FROM openmct_objects WHERE key IS ?`
|
||||||
|
@ -363,7 +361,7 @@ func (tdb *TelemDb) GetDocument(ctx context.Context, key string) (json.RawMessag
|
||||||
|
|
||||||
// GetAllDocuments returns all documents in the database.
|
// GetAllDocuments returns all documents in the database.
|
||||||
func (tdb *TelemDb) GetAllDocuments(ctx context.Context) ([]json.RawMessage, error) {
|
func (tdb *TelemDb) GetAllDocuments(ctx context.Context) ([]json.RawMessage, error) {
|
||||||
const getall = `SELECT data FROM openmct_objects`;
|
const getall = `SELECT data FROM openmct_objects`
|
||||||
|
|
||||||
rows, err := tdb.db.QueryxContext(ctx, getall)
|
rows, err := tdb.db.QueryxContext(ctx, getall)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -201,7 +201,7 @@ func TestDbDocuments(t *testing.T) {
|
||||||
tdb := MakeMockDatabase(t.Name())
|
tdb := MakeMockDatabase(t.Name())
|
||||||
tdb.db.Ping()
|
tdb.db.Ping()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
var badDoc = map[string]string{"bad":"duh"}
|
var badDoc = map[string]string{"bad": "duh"}
|
||||||
msg, err := json.Marshal(badDoc)
|
msg, err := json.Marshal(badDoc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -241,7 +241,7 @@ func TestDbDocuments(t *testing.T) {
|
||||||
|
|
||||||
res, err := tdb.GetDocument(ctx, "hi")
|
res, err := tdb.GetDocument(ctx, "hi")
|
||||||
|
|
||||||
if err == nil || !errors.Is(err, DocumentNotFoundError("hi")){
|
if err == nil || !errors.Is(err, DocumentNotFoundError("hi")) {
|
||||||
t.Fatalf("GetDocument expected DocumentNotFoundError, got %v", err)
|
t.Fatalf("GetDocument expected DocumentNotFoundError, got %v", err)
|
||||||
}
|
}
|
||||||
if res != nil {
|
if res != nil {
|
||||||
|
|
1
http.go
1
http.go
|
@ -274,7 +274,6 @@ func apiV1GetValues(db *TelemDb) http.HandlerFunc {
|
||||||
// override the bus event filter name option
|
// override the bus event filter name option
|
||||||
bef.Names = []string{name}
|
bef.Names = []string{name}
|
||||||
|
|
||||||
|
|
||||||
var res []Datum
|
var res []Datum
|
||||||
// make the call, skip the limit modifier if it's nil.
|
// make the call, skip the limit modifier if it's nil.
|
||||||
res, err = db.GetValues(r.Context(), *bef, field, lim)
|
res, err = db.GetValues(r.Context(), *bef, field, lim)
|
||||||
|
|
|
@ -6,20 +6,19 @@
|
||||||
// by writing "adapters" to various devices/formats (xbee, socketcan)
|
// by writing "adapters" to various devices/formats (xbee, socketcan)
|
||||||
package can
|
package can
|
||||||
|
|
||||||
|
|
||||||
type CanID struct {
|
type CanID struct {
|
||||||
Id uint32
|
Id uint32
|
||||||
Extended bool // since the id itself is not enough.
|
Extended bool // since the id itself is not enough.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Frame represents a protocol-agnostic CAN frame. The Id can be standard or extended,
|
// Frame represents a protocol-agnostic CAN frame. The Id can be standard or extended,
|
||||||
// but if it is extended, the Kind should be EFF.
|
// but if it is extended, the Kind should be EFF.
|
||||||
type Frame struct {
|
type Frame struct {
|
||||||
Id CanID
|
Id CanID
|
||||||
Data []byte
|
Data []byte
|
||||||
Kind Kind
|
Kind Kind
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: should this be replaced
|
// TODO: should this be replaced
|
||||||
type CANFrame interface {
|
type CANFrame interface {
|
||||||
Id()
|
Id()
|
||||||
|
@ -34,8 +33,8 @@ type Kind uint8
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CanDataFrame Kind = iota // Standard ID Frame
|
CanDataFrame Kind = iota // Standard ID Frame
|
||||||
CanRTRFrame // Remote Transmission Request Frame
|
CanRTRFrame // Remote Transmission Request Frame
|
||||||
CanErrFrame // Error Frame
|
CanErrFrame // Error Frame
|
||||||
)
|
)
|
||||||
|
|
||||||
// CanFilter is a basic filter for masking out data. It has an Inverted flag
|
// CanFilter is a basic filter for masking out data. It has an Inverted flag
|
||||||
|
|
|
@ -44,7 +44,7 @@ var candumpRegex = regexp.MustCompile(`^\((\d+)\.(\d{6})\) \w+ (\w+)#(\w+)$`)
|
||||||
|
|
||||||
func parseCanDumpLine(dumpLine string) (frame can.Frame, ts time.Time, err error) {
|
func parseCanDumpLine(dumpLine string) (frame can.Frame, ts time.Time, err error) {
|
||||||
frame = can.Frame{}
|
frame = can.Frame{}
|
||||||
ts = time.Unix(0,0)
|
ts = time.Unix(0, 0)
|
||||||
// dumpline looks like this:
|
// dumpline looks like this:
|
||||||
// (1684538768.521889) can0 200#8D643546
|
// (1684538768.521889) can0 200#8D643546
|
||||||
// remove trailing newline/whitespaces
|
// remove trailing newline/whitespaces
|
||||||
|
@ -84,11 +84,11 @@ func parseCanDumpLine(dumpLine string) (frame can.Frame, ts time.Time, err error
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add extended id support, need an example log and a test.
|
// TODO: add extended id support, need an example log and a test.
|
||||||
frame.Id = can.CanID{Id: uint32(id), Extended: false}
|
frame.Id = can.CanID{Id: uint32(id), Extended: false}
|
||||||
frame.Data = rawData
|
frame.Data = rawData
|
||||||
frame.Kind = can.CanDataFrame
|
frame.Kind = can.CanDataFrame
|
||||||
|
|
||||||
ts = time.Unix(unixSeconds, unixMicros * int64(time.Microsecond))
|
ts = time.Unix(unixSeconds, unixMicros*int64(time.Microsecond))
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ var telemRegex = regexp.MustCompile(`^(\d+)\.(\d{3}) (\w{3})(\w+)$`)
|
||||||
|
|
||||||
func parseTelemLogLine(line string) (frame can.Frame, ts time.Time, err error) {
|
func parseTelemLogLine(line string) (frame can.Frame, ts time.Time, err error) {
|
||||||
frame = can.Frame{}
|
frame = can.Frame{}
|
||||||
ts = time.Unix(0,0)
|
ts = time.Unix(0, 0)
|
||||||
// strip trailng newline since we rely on it being gone
|
// strip trailng newline since we rely on it being gone
|
||||||
line = strings.TrimSpace(line)
|
line = strings.TrimSpace(line)
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,6 @@ func Test_parseTelemLogLine_errors(t *testing.T) {
|
||||||
name: "utf8 corruption",
|
name: "utf8 corruption",
|
||||||
input: "1698180835.318 0619\xed\xa0\x80fsadfD805640X0EBE24",
|
input: "1698180835.318 0619\xed\xa0\x80fsadfD805640X0EBE24",
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//go:build openmct
|
//go:build openmct
|
||||||
|
|
||||||
package gotelem
|
package gotelem
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -74,7 +74,6 @@ type Sizer interface {
|
||||||
// CanSend takes a packet and makes CAN framing data.
|
// CanSend takes a packet and makes CAN framing data.
|
||||||
func ToCanFrame(p Packet) (f can.Frame, err error) {
|
func ToCanFrame(p Packet) (f can.Frame, err error) {
|
||||||
|
|
||||||
|
|
||||||
f.Id, err = p.CanId()
|
f.Id, err = p.CanId()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -146,8 +145,9 @@ func (e *UnknownIdError) Error() string {
|
||||||
|
|
||||||
type BadLengthError struct {
|
type BadLengthError struct {
|
||||||
expected uint32
|
expected uint32
|
||||||
actual uint32
|
actual uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *BadLengthError) Error() string {
|
func (e *BadLengthError) Error() string {
|
||||||
return fmt.Sprintf("bad data length, expected %d, got %d", e.expected, e.actual)
|
return fmt.Sprintf("bad data length, expected %d, got %d", e.expected, e.actual)
|
||||||
}
|
}
|
||||||
|
|
1261
skylab/skylab_gen.go
1261
skylab/skylab_gen.go
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,10 @@
|
||||||
|
|
||||||
package skylab
|
package skylab
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func TestMarshalUnmarshalBmsMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalBmsMeasurement(t *testing.T) {
|
||||||
v := &BmsMeasurement{}
|
v := &BmsMeasurement{}
|
||||||
bin, err := v.MarshalPacket()
|
bin, err := v.MarshalPacket()
|
||||||
|
@ -40,7 +38,6 @@ func TestJSONBmsMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBatteryStatus(t *testing.T) {
|
func TestMarshalUnmarshalBatteryStatus(t *testing.T) {
|
||||||
v := &BatteryStatus{}
|
v := &BatteryStatus{}
|
||||||
|
@ -75,7 +72,6 @@ func TestJSONBatteryStatus(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsKillReason(t *testing.T) {
|
func TestMarshalUnmarshalBmsKillReason(t *testing.T) {
|
||||||
v := &BmsKillReason{}
|
v := &BmsKillReason{}
|
||||||
|
@ -110,7 +106,6 @@ func TestJSONBmsKillReason(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsModuleMinMax(t *testing.T) {
|
func TestMarshalUnmarshalBmsModuleMinMax(t *testing.T) {
|
||||||
v := &BmsModuleMinMax{}
|
v := &BmsModuleMinMax{}
|
||||||
|
@ -145,7 +140,6 @@ func TestJSONBmsModuleMinMax(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsSoc(t *testing.T) {
|
func TestMarshalUnmarshalBmsSoc(t *testing.T) {
|
||||||
v := &BmsSoc{}
|
v := &BmsSoc{}
|
||||||
|
@ -180,7 +174,6 @@ func TestJSONBmsSoc(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsCapacity(t *testing.T) {
|
func TestMarshalUnmarshalBmsCapacity(t *testing.T) {
|
||||||
v := &BmsCapacity{}
|
v := &BmsCapacity{}
|
||||||
|
@ -215,7 +208,6 @@ func TestJSONBmsCapacity(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsCurrentlimit(t *testing.T) {
|
func TestMarshalUnmarshalBmsCurrentlimit(t *testing.T) {
|
||||||
v := &BmsCurrentlimit{}
|
v := &BmsCurrentlimit{}
|
||||||
|
@ -250,7 +242,6 @@ func TestJSONBmsCurrentlimit(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsFanInfo(t *testing.T) {
|
func TestMarshalUnmarshalBmsFanInfo(t *testing.T) {
|
||||||
v := &BmsFanInfo{}
|
v := &BmsFanInfo{}
|
||||||
|
@ -285,7 +276,6 @@ func TestJSONBmsFanInfo(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsSetMinFanSpeed(t *testing.T) {
|
func TestMarshalUnmarshalBmsSetMinFanSpeed(t *testing.T) {
|
||||||
v := &BmsSetMinFanSpeed{}
|
v := &BmsSetMinFanSpeed{}
|
||||||
|
@ -320,7 +310,6 @@ func TestJSONBmsSetMinFanSpeed(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsModule(t *testing.T) {
|
func TestMarshalUnmarshalBmsModule(t *testing.T) {
|
||||||
v := &BmsModule{}
|
v := &BmsModule{}
|
||||||
|
@ -355,7 +344,6 @@ func TestJSONBmsModule(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsChargerResponse(t *testing.T) {
|
func TestMarshalUnmarshalBmsChargerResponse(t *testing.T) {
|
||||||
v := &BmsChargerResponse{}
|
v := &BmsChargerResponse{}
|
||||||
|
@ -390,7 +378,6 @@ func TestJSONBmsChargerResponse(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalChassisIsolationFault(t *testing.T) {
|
func TestMarshalUnmarshalChassisIsolationFault(t *testing.T) {
|
||||||
v := &ChassisIsolationFault{}
|
v := &ChassisIsolationFault{}
|
||||||
|
@ -425,7 +412,6 @@ func TestJSONChassisIsolationFault(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsImdInfo(t *testing.T) {
|
func TestMarshalUnmarshalBmsImdInfo(t *testing.T) {
|
||||||
v := &BmsImdInfo{}
|
v := &BmsImdInfo{}
|
||||||
|
@ -460,7 +446,6 @@ func TestJSONBmsImdInfo(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalDashboardPedalPercentages(t *testing.T) {
|
func TestMarshalUnmarshalDashboardPedalPercentages(t *testing.T) {
|
||||||
v := &DashboardPedalPercentages{}
|
v := &DashboardPedalPercentages{}
|
||||||
|
@ -495,7 +480,6 @@ func TestJSONDashboardPedalPercentages(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalCarState(t *testing.T) {
|
func TestMarshalUnmarshalCarState(t *testing.T) {
|
||||||
v := &CarState{}
|
v := &CarState{}
|
||||||
|
@ -530,7 +514,6 @@ func TestJSONCarState(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalDashboardPedalFault(t *testing.T) {
|
func TestMarshalUnmarshalDashboardPedalFault(t *testing.T) {
|
||||||
v := &DashboardPedalFault{}
|
v := &DashboardPedalFault{}
|
||||||
|
@ -565,7 +548,6 @@ func TestJSONDashboardPedalFault(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalDashboardSystemTimeoutTest(t *testing.T) {
|
func TestMarshalUnmarshalDashboardSystemTimeoutTest(t *testing.T) {
|
||||||
v := &DashboardSystemTimeoutTest{}
|
v := &DashboardSystemTimeoutTest{}
|
||||||
|
@ -600,7 +582,6 @@ func TestJSONDashboardSystemTimeoutTest(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalCarSpeed(t *testing.T) {
|
func TestMarshalUnmarshalCarSpeed(t *testing.T) {
|
||||||
v := &CarSpeed{}
|
v := &CarSpeed{}
|
||||||
|
@ -635,7 +616,6 @@ func TestJSONCarSpeed(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalFlightComputerLvBoardDisconnectCounts(t *testing.T) {
|
func TestMarshalUnmarshalFlightComputerLvBoardDisconnectCounts(t *testing.T) {
|
||||||
v := &FlightComputerLvBoardDisconnectCounts{}
|
v := &FlightComputerLvBoardDisconnectCounts{}
|
||||||
|
@ -670,7 +650,6 @@ func TestJSONFlightComputerLvBoardDisconnectCounts(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalFlightComputerHvBoardDisconnectCounts(t *testing.T) {
|
func TestMarshalUnmarshalFlightComputerHvBoardDisconnectCounts(t *testing.T) {
|
||||||
v := &FlightComputerHvBoardDisconnectCounts{}
|
v := &FlightComputerHvBoardDisconnectCounts{}
|
||||||
|
@ -705,7 +684,6 @@ func TestJSONFlightComputerHvBoardDisconnectCounts(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalFlightComputerInternalState(t *testing.T) {
|
func TestMarshalUnmarshalFlightComputerInternalState(t *testing.T) {
|
||||||
v := &FlightComputerInternalState{}
|
v := &FlightComputerInternalState{}
|
||||||
|
@ -740,7 +718,6 @@ func TestJSONFlightComputerInternalState(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalPowerToDrive(t *testing.T) {
|
func TestMarshalUnmarshalPowerToDrive(t *testing.T) {
|
||||||
v := &PowerToDrive{}
|
v := &PowerToDrive{}
|
||||||
|
@ -775,7 +752,6 @@ func TestJSONPowerToDrive(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalArrayPower(t *testing.T) {
|
func TestMarshalUnmarshalArrayPower(t *testing.T) {
|
||||||
v := &ArrayPower{}
|
v := &ArrayPower{}
|
||||||
|
@ -810,7 +786,6 @@ func TestJSONArrayPower(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalArrayEnergy(t *testing.T) {
|
func TestMarshalUnmarshalArrayEnergy(t *testing.T) {
|
||||||
v := &ArrayEnergy{}
|
v := &ArrayEnergy{}
|
||||||
|
@ -845,7 +820,6 @@ func TestJSONArrayEnergy(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalArrayEnergyReset(t *testing.T) {
|
func TestMarshalUnmarshalArrayEnergyReset(t *testing.T) {
|
||||||
v := &ArrayEnergyReset{}
|
v := &ArrayEnergyReset{}
|
||||||
|
@ -880,7 +854,6 @@ func TestJSONArrayEnergyReset(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionTurnSignalsCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionTurnSignalsCommand(t *testing.T) {
|
||||||
v := &VisionTurnSignalsCommand{}
|
v := &VisionTurnSignalsCommand{}
|
||||||
|
@ -915,7 +888,6 @@ func TestJSONVisionTurnSignalsCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionBrakeLightsCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionBrakeLightsCommand(t *testing.T) {
|
||||||
v := &VisionBrakeLightsCommand{}
|
v := &VisionBrakeLightsCommand{}
|
||||||
|
@ -950,7 +922,6 @@ func TestJSONVisionBrakeLightsCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionHeadlightsCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionHeadlightsCommand(t *testing.T) {
|
||||||
v := &VisionHeadlightsCommand{}
|
v := &VisionHeadlightsCommand{}
|
||||||
|
@ -985,7 +956,6 @@ func TestJSONVisionHeadlightsCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionHornCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionHornCommand(t *testing.T) {
|
||||||
v := &VisionHornCommand{}
|
v := &VisionHornCommand{}
|
||||||
|
@ -1020,7 +990,6 @@ func TestJSONVisionHornCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionArrayLatchesCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionArrayLatchesCommand(t *testing.T) {
|
||||||
v := &VisionArrayLatchesCommand{}
|
v := &VisionArrayLatchesCommand{}
|
||||||
|
@ -1055,7 +1024,6 @@ func TestJSONVisionArrayLatchesCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionRearviewCommand(t *testing.T) {
|
func TestMarshalUnmarshalVisionRearviewCommand(t *testing.T) {
|
||||||
v := &VisionRearviewCommand{}
|
v := &VisionRearviewCommand{}
|
||||||
|
@ -1090,7 +1058,6 @@ func TestJSONVisionRearviewCommand(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTrackerEnable(t *testing.T) {
|
func TestMarshalUnmarshalTrackerEnable(t *testing.T) {
|
||||||
v := &TrackerEnable{}
|
v := &TrackerEnable{}
|
||||||
|
@ -1125,7 +1092,6 @@ func TestJSONTrackerEnable(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalDistanceTraveled(t *testing.T) {
|
func TestMarshalUnmarshalDistanceTraveled(t *testing.T) {
|
||||||
v := &DistanceTraveled{}
|
v := &DistanceTraveled{}
|
||||||
|
@ -1160,7 +1126,6 @@ func TestJSONDistanceTraveled(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalChargerState(t *testing.T) {
|
func TestMarshalUnmarshalChargerState(t *testing.T) {
|
||||||
v := &ChargerState{}
|
v := &ChargerState{}
|
||||||
|
@ -1195,7 +1160,6 @@ func TestJSONChargerState(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalChargerBmsRequest(t *testing.T) {
|
func TestMarshalUnmarshalChargerBmsRequest(t *testing.T) {
|
||||||
v := &ChargerBmsRequest{}
|
v := &ChargerBmsRequest{}
|
||||||
|
@ -1230,7 +1194,6 @@ func TestJSONChargerBmsRequest(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalChargerCurrentVoltage(t *testing.T) {
|
func TestMarshalUnmarshalChargerCurrentVoltage(t *testing.T) {
|
||||||
v := &ChargerCurrentVoltage{}
|
v := &ChargerCurrentVoltage{}
|
||||||
|
@ -1265,7 +1228,6 @@ func TestJSONChargerCurrentVoltage(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalChargerPower(t *testing.T) {
|
func TestMarshalUnmarshalChargerPower(t *testing.T) {
|
||||||
v := &ChargerPower{}
|
v := &ChargerPower{}
|
||||||
|
@ -1300,7 +1262,6 @@ func TestJSONChargerPower(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalThunderstruckControlMessage(t *testing.T) {
|
func TestMarshalUnmarshalThunderstruckControlMessage(t *testing.T) {
|
||||||
v := &ThunderstruckControlMessage{}
|
v := &ThunderstruckControlMessage{}
|
||||||
|
@ -1335,7 +1296,6 @@ func TestJSONThunderstruckControlMessage(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionStatusFront(t *testing.T) {
|
func TestMarshalUnmarshalVisionStatusFront(t *testing.T) {
|
||||||
v := &VisionStatusFront{}
|
v := &VisionStatusFront{}
|
||||||
|
@ -1370,7 +1330,6 @@ func TestJSONVisionStatusFront(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionStatusRear(t *testing.T) {
|
func TestMarshalUnmarshalVisionStatusRear(t *testing.T) {
|
||||||
v := &VisionStatusRear{}
|
v := &VisionStatusRear{}
|
||||||
|
@ -1405,7 +1364,6 @@ func TestJSONVisionStatusRear(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalLightsFrontId(t *testing.T) {
|
func TestMarshalUnmarshalLightsFrontId(t *testing.T) {
|
||||||
v := &LightsFrontId{}
|
v := &LightsFrontId{}
|
||||||
|
@ -1440,7 +1398,6 @@ func TestJSONLightsFrontId(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalLightsBackId(t *testing.T) {
|
func TestMarshalUnmarshalLightsBackId(t *testing.T) {
|
||||||
v := &LightsBackId{}
|
v := &LightsBackId{}
|
||||||
|
@ -1475,7 +1432,6 @@ func TestJSONLightsBackId(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalVisionId(t *testing.T) {
|
func TestMarshalUnmarshalVisionId(t *testing.T) {
|
||||||
v := &VisionId{}
|
v := &VisionId{}
|
||||||
|
@ -1510,7 +1466,6 @@ func TestJSONVisionId(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalSteeringPressCount1(t *testing.T) {
|
func TestMarshalUnmarshalSteeringPressCount1(t *testing.T) {
|
||||||
v := &SteeringPressCount1{}
|
v := &SteeringPressCount1{}
|
||||||
|
@ -1545,7 +1500,6 @@ func TestJSONSteeringPressCount1(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalSteeringPressCount2(t *testing.T) {
|
func TestMarshalUnmarshalSteeringPressCount2(t *testing.T) {
|
||||||
v := &SteeringPressCount2{}
|
v := &SteeringPressCount2{}
|
||||||
|
@ -1580,7 +1534,6 @@ func TestJSONSteeringPressCount2(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalSteeringButtonColors1(t *testing.T) {
|
func TestMarshalUnmarshalSteeringButtonColors1(t *testing.T) {
|
||||||
v := &SteeringButtonColors1{}
|
v := &SteeringButtonColors1{}
|
||||||
|
@ -1615,7 +1568,6 @@ func TestJSONSteeringButtonColors1(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalSteeringButtonColors2(t *testing.T) {
|
func TestMarshalUnmarshalSteeringButtonColors2(t *testing.T) {
|
||||||
v := &SteeringButtonColors2{}
|
v := &SteeringButtonColors2{}
|
||||||
|
@ -1650,7 +1602,6 @@ func TestJSONSteeringButtonColors2(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalSteeringHorn(t *testing.T) {
|
func TestMarshalUnmarshalSteeringHorn(t *testing.T) {
|
||||||
v := &SteeringHorn{}
|
v := &SteeringHorn{}
|
||||||
|
@ -1685,7 +1636,6 @@ func TestJSONSteeringHorn(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalThunderstruckStatusMessage(t *testing.T) {
|
func TestMarshalUnmarshalThunderstruckStatusMessage(t *testing.T) {
|
||||||
v := &ThunderstruckStatusMessage{}
|
v := &ThunderstruckStatusMessage{}
|
||||||
|
@ -1720,7 +1670,6 @@ func TestJSONThunderstruckStatusMessage(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTrackerData(t *testing.T) {
|
func TestMarshalUnmarshalTrackerData(t *testing.T) {
|
||||||
v := &TrackerData{}
|
v := &TrackerData{}
|
||||||
|
@ -1755,7 +1704,6 @@ func TestJSONTrackerData(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumMotorDriveL(t *testing.T) {
|
func TestMarshalUnmarshalTritiumMotorDriveL(t *testing.T) {
|
||||||
v := &TritiumMotorDriveL{}
|
v := &TritiumMotorDriveL{}
|
||||||
|
@ -1790,7 +1738,6 @@ func TestJSONTritiumMotorDriveL(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumMotorPowerL(t *testing.T) {
|
func TestMarshalUnmarshalTritiumMotorPowerL(t *testing.T) {
|
||||||
v := &TritiumMotorPowerL{}
|
v := &TritiumMotorPowerL{}
|
||||||
|
@ -1825,7 +1772,6 @@ func TestJSONTritiumMotorPowerL(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumResetL(t *testing.T) {
|
func TestMarshalUnmarshalTritiumResetL(t *testing.T) {
|
||||||
v := &TritiumResetL{}
|
v := &TritiumResetL{}
|
||||||
|
@ -1860,7 +1806,6 @@ func TestJSONTritiumResetL(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumMotorDriveR(t *testing.T) {
|
func TestMarshalUnmarshalTritiumMotorDriveR(t *testing.T) {
|
||||||
v := &TritiumMotorDriveR{}
|
v := &TritiumMotorDriveR{}
|
||||||
|
@ -1895,7 +1840,6 @@ func TestJSONTritiumMotorDriveR(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumMotorPowerR(t *testing.T) {
|
func TestMarshalUnmarshalTritiumMotorPowerR(t *testing.T) {
|
||||||
v := &TritiumMotorPowerR{}
|
v := &TritiumMotorPowerR{}
|
||||||
|
@ -1930,7 +1874,6 @@ func TestJSONTritiumMotorPowerR(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTritiumResetR(t *testing.T) {
|
func TestMarshalUnmarshalTritiumResetR(t *testing.T) {
|
||||||
v := &TritiumResetR{}
|
v := &TritiumResetR{}
|
||||||
|
@ -1965,7 +1908,6 @@ func TestJSONTritiumResetR(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsAhSet(t *testing.T) {
|
func TestMarshalUnmarshalBmsAhSet(t *testing.T) {
|
||||||
v := &BmsAhSet{}
|
v := &BmsAhSet{}
|
||||||
|
@ -2000,7 +1942,6 @@ func TestJSONBmsAhSet(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsWhSet(t *testing.T) {
|
func TestMarshalUnmarshalBmsWhSet(t *testing.T) {
|
||||||
v := &BmsWhSet{}
|
v := &BmsWhSet{}
|
||||||
|
@ -2035,7 +1976,6 @@ func TestJSONBmsWhSet(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalBmsKill(t *testing.T) {
|
func TestMarshalUnmarshalBmsKill(t *testing.T) {
|
||||||
v := &BmsKill{}
|
v := &BmsKill{}
|
||||||
|
@ -2070,7 +2010,6 @@ func TestJSONBmsKill(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalTelemetryRtcReset(t *testing.T) {
|
func TestMarshalUnmarshalTelemetryRtcReset(t *testing.T) {
|
||||||
v := &TelemetryRtcReset{}
|
v := &TelemetryRtcReset{}
|
||||||
|
@ -2105,7 +2044,6 @@ func TestJSONTelemetryRtcReset(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrIdentification(t *testing.T) {
|
func TestMarshalUnmarshalWsrIdentification(t *testing.T) {
|
||||||
v := &WsrIdentification{}
|
v := &WsrIdentification{}
|
||||||
|
@ -2140,7 +2078,6 @@ func TestJSONWsrIdentification(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrStatusInformation(t *testing.T) {
|
func TestMarshalUnmarshalWsrStatusInformation(t *testing.T) {
|
||||||
v := &WsrStatusInformation{}
|
v := &WsrStatusInformation{}
|
||||||
|
@ -2175,7 +2112,6 @@ func TestJSONWsrStatusInformation(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrBusMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWsrBusMeasurement(t *testing.T) {
|
||||||
v := &WsrBusMeasurement{}
|
v := &WsrBusMeasurement{}
|
||||||
|
@ -2210,7 +2146,6 @@ func TestJSONWsrBusMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrVelocity(t *testing.T) {
|
func TestMarshalUnmarshalWsrVelocity(t *testing.T) {
|
||||||
v := &WsrVelocity{}
|
v := &WsrVelocity{}
|
||||||
|
@ -2245,7 +2180,6 @@ func TestJSONWsrVelocity(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrPhaseCurrent(t *testing.T) {
|
func TestMarshalUnmarshalWsrPhaseCurrent(t *testing.T) {
|
||||||
v := &WsrPhaseCurrent{}
|
v := &WsrPhaseCurrent{}
|
||||||
|
@ -2280,7 +2214,6 @@ func TestJSONWsrPhaseCurrent(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrMotorVoltageVector(t *testing.T) {
|
func TestMarshalUnmarshalWsrMotorVoltageVector(t *testing.T) {
|
||||||
v := &WsrMotorVoltageVector{}
|
v := &WsrMotorVoltageVector{}
|
||||||
|
@ -2315,7 +2248,6 @@ func TestJSONWsrMotorVoltageVector(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrMotorCurrentVector(t *testing.T) {
|
func TestMarshalUnmarshalWsrMotorCurrentVector(t *testing.T) {
|
||||||
v := &WsrMotorCurrentVector{}
|
v := &WsrMotorCurrentVector{}
|
||||||
|
@ -2350,7 +2282,6 @@ func TestJSONWsrMotorCurrentVector(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrMotorBackemf(t *testing.T) {
|
func TestMarshalUnmarshalWsrMotorBackemf(t *testing.T) {
|
||||||
v := &WsrMotorBackemf{}
|
v := &WsrMotorBackemf{}
|
||||||
|
@ -2385,7 +2316,6 @@ func TestJSONWsrMotorBackemf(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsr15165VoltageRail(t *testing.T) {
|
func TestMarshalUnmarshalWsr15165VoltageRail(t *testing.T) {
|
||||||
v := &Wsr15165VoltageRail{}
|
v := &Wsr15165VoltageRail{}
|
||||||
|
@ -2420,7 +2350,6 @@ func TestJSONWsr15165VoltageRail(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsr2512VoltageRail(t *testing.T) {
|
func TestMarshalUnmarshalWsr2512VoltageRail(t *testing.T) {
|
||||||
v := &Wsr2512VoltageRail{}
|
v := &Wsr2512VoltageRail{}
|
||||||
|
@ -2455,7 +2384,6 @@ func TestJSONWsr2512VoltageRail(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrHeatsinkMotorTemp(t *testing.T) {
|
func TestMarshalUnmarshalWsrHeatsinkMotorTemp(t *testing.T) {
|
||||||
v := &WsrHeatsinkMotorTemp{}
|
v := &WsrHeatsinkMotorTemp{}
|
||||||
|
@ -2490,7 +2418,6 @@ func TestJSONWsrHeatsinkMotorTemp(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrDspBoardTemp(t *testing.T) {
|
func TestMarshalUnmarshalWsrDspBoardTemp(t *testing.T) {
|
||||||
v := &WsrDspBoardTemp{}
|
v := &WsrDspBoardTemp{}
|
||||||
|
@ -2525,7 +2452,6 @@ func TestJSONWsrDspBoardTemp(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrReserved(t *testing.T) {
|
func TestMarshalUnmarshalWsrReserved(t *testing.T) {
|
||||||
v := &WsrReserved{}
|
v := &WsrReserved{}
|
||||||
|
@ -2560,7 +2486,6 @@ func TestJSONWsrReserved(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrOdometerBusAmphoursMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWsrOdometerBusAmphoursMeasurement(t *testing.T) {
|
||||||
v := &WsrOdometerBusAmphoursMeasurement{}
|
v := &WsrOdometerBusAmphoursMeasurement{}
|
||||||
|
@ -2595,7 +2520,6 @@ func TestJSONWsrOdometerBusAmphoursMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsrSlipSpeedMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWsrSlipSpeedMeasurement(t *testing.T) {
|
||||||
v := &WsrSlipSpeedMeasurement{}
|
v := &WsrSlipSpeedMeasurement{}
|
||||||
|
@ -2630,7 +2554,6 @@ func TestJSONWsrSlipSpeedMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslIdentification(t *testing.T) {
|
func TestMarshalUnmarshalWslIdentification(t *testing.T) {
|
||||||
v := &WslIdentification{}
|
v := &WslIdentification{}
|
||||||
|
@ -2665,7 +2588,6 @@ func TestJSONWslIdentification(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslStatusInformation(t *testing.T) {
|
func TestMarshalUnmarshalWslStatusInformation(t *testing.T) {
|
||||||
v := &WslStatusInformation{}
|
v := &WslStatusInformation{}
|
||||||
|
@ -2700,7 +2622,6 @@ func TestJSONWslStatusInformation(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslBusMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWslBusMeasurement(t *testing.T) {
|
||||||
v := &WslBusMeasurement{}
|
v := &WslBusMeasurement{}
|
||||||
|
@ -2735,7 +2656,6 @@ func TestJSONWslBusMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslVelocity(t *testing.T) {
|
func TestMarshalUnmarshalWslVelocity(t *testing.T) {
|
||||||
v := &WslVelocity{}
|
v := &WslVelocity{}
|
||||||
|
@ -2770,7 +2690,6 @@ func TestJSONWslVelocity(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslPhaseCurrent(t *testing.T) {
|
func TestMarshalUnmarshalWslPhaseCurrent(t *testing.T) {
|
||||||
v := &WslPhaseCurrent{}
|
v := &WslPhaseCurrent{}
|
||||||
|
@ -2805,7 +2724,6 @@ func TestJSONWslPhaseCurrent(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslMotorVoltageVector(t *testing.T) {
|
func TestMarshalUnmarshalWslMotorVoltageVector(t *testing.T) {
|
||||||
v := &WslMotorVoltageVector{}
|
v := &WslMotorVoltageVector{}
|
||||||
|
@ -2840,7 +2758,6 @@ func TestJSONWslMotorVoltageVector(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslMotorCurrentVector(t *testing.T) {
|
func TestMarshalUnmarshalWslMotorCurrentVector(t *testing.T) {
|
||||||
v := &WslMotorCurrentVector{}
|
v := &WslMotorCurrentVector{}
|
||||||
|
@ -2875,7 +2792,6 @@ func TestJSONWslMotorCurrentVector(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslMotorBackemf(t *testing.T) {
|
func TestMarshalUnmarshalWslMotorBackemf(t *testing.T) {
|
||||||
v := &WslMotorBackemf{}
|
v := &WslMotorBackemf{}
|
||||||
|
@ -2910,7 +2826,6 @@ func TestJSONWslMotorBackemf(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsl15165VoltageRail(t *testing.T) {
|
func TestMarshalUnmarshalWsl15165VoltageRail(t *testing.T) {
|
||||||
v := &Wsl15165VoltageRail{}
|
v := &Wsl15165VoltageRail{}
|
||||||
|
@ -2945,7 +2860,6 @@ func TestJSONWsl15165VoltageRail(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWsl2512VoltageRail(t *testing.T) {
|
func TestMarshalUnmarshalWsl2512VoltageRail(t *testing.T) {
|
||||||
v := &Wsl2512VoltageRail{}
|
v := &Wsl2512VoltageRail{}
|
||||||
|
@ -2980,7 +2894,6 @@ func TestJSONWsl2512VoltageRail(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslHeatsinkMotorTemp(t *testing.T) {
|
func TestMarshalUnmarshalWslHeatsinkMotorTemp(t *testing.T) {
|
||||||
v := &WslHeatsinkMotorTemp{}
|
v := &WslHeatsinkMotorTemp{}
|
||||||
|
@ -3015,7 +2928,6 @@ func TestJSONWslHeatsinkMotorTemp(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslDspBoardTemp(t *testing.T) {
|
func TestMarshalUnmarshalWslDspBoardTemp(t *testing.T) {
|
||||||
v := &WslDspBoardTemp{}
|
v := &WslDspBoardTemp{}
|
||||||
|
@ -3050,7 +2962,6 @@ func TestJSONWslDspBoardTemp(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslOdometerBusAmphoursMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWslOdometerBusAmphoursMeasurement(t *testing.T) {
|
||||||
v := &WslOdometerBusAmphoursMeasurement{}
|
v := &WslOdometerBusAmphoursMeasurement{}
|
||||||
|
@ -3085,7 +2996,6 @@ func TestJSONWslOdometerBusAmphoursMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslReserved(t *testing.T) {
|
func TestMarshalUnmarshalWslReserved(t *testing.T) {
|
||||||
v := &WslReserved{}
|
v := &WslReserved{}
|
||||||
|
@ -3120,7 +3030,6 @@ func TestJSONWslReserved(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
func TestMarshalUnmarshalWslSlipSpeedMeasurement(t *testing.T) {
|
func TestMarshalUnmarshalWslSlipSpeedMeasurement(t *testing.T) {
|
||||||
v := &WslSlipSpeedMeasurement{}
|
v := &WslSlipSpeedMeasurement{}
|
||||||
|
@ -3155,5 +3064,4 @@ func TestJSONWslSlipSpeedMeasurement(t *testing.T) {
|
||||||
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,3 @@ import (
|
||||||
|
|
||||||
// this program demonstrates basic CAN stuff.
|
// this program demonstrates basic CAN stuff.
|
||||||
// i give up this shit is so hard
|
// i give up this shit is so hard
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -134,12 +134,11 @@ func (sck *CanSocket) Send(msg *can.Frame) error {
|
||||||
|
|
||||||
idToWrite := msg.Id.Id
|
idToWrite := msg.Id.Id
|
||||||
|
|
||||||
if (msg.Id.Extended) {
|
if msg.Id.Extended {
|
||||||
idToWrite &= unix.CAN_EFF_MASK
|
idToWrite &= unix.CAN_EFF_MASK
|
||||||
idToWrite |= unix.CAN_EFF_FLAG
|
idToWrite |= unix.CAN_EFF_FLAG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch msg.Kind {
|
switch msg.Kind {
|
||||||
case can.CanRTRFrame:
|
case can.CanRTRFrame:
|
||||||
idToWrite |= unix.CAN_RTR_FLAG
|
idToWrite |= unix.CAN_RTR_FLAG
|
||||||
|
@ -191,10 +190,10 @@ func (sck *CanSocket) Recv() (*can.Frame, error) {
|
||||||
id.Id = raw_id
|
id.Id = raw_id
|
||||||
if raw_id&unix.CAN_EFF_FLAG != 0 {
|
if raw_id&unix.CAN_EFF_FLAG != 0 {
|
||||||
// extended id frame
|
// extended id frame
|
||||||
id.Extended = true;
|
id.Extended = true
|
||||||
} else {
|
} else {
|
||||||
// it's a normal can frame
|
// it's a normal can frame
|
||||||
id.Extended = false;
|
id.Extended = false
|
||||||
}
|
}
|
||||||
|
|
||||||
var k can.Kind = can.CanDataFrame
|
var k can.Kind = can.CanDataFrame
|
||||||
|
@ -204,7 +203,7 @@ func (sck *CanSocket) Recv() (*can.Frame, error) {
|
||||||
k = can.CanErrFrame
|
k = can.CanErrFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
if raw_id & unix.CAN_RTR_FLAG != 0 {
|
if raw_id&unix.CAN_RTR_FLAG != 0 {
|
||||||
k = can.CanRTRFrame
|
k = can.CanRTRFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Frameable is an object that can be sent in an XBee Frame. An XBee Frame
|
// Frameable is an object that can be sent in an XBee Frame. An XBee Frame
|
||||||
|
@ -105,7 +104,6 @@ func xbeeFrameSplit(data []byte, atEOF bool) (advance int, token []byte, err err
|
||||||
// FIXME: add bounds checking! this can panic.
|
// FIXME: add bounds checking! this can panic.
|
||||||
var frameLen = int(binary.BigEndian.Uint16(data[startIdx+1:startIdx+3])) + 4
|
var frameLen = int(binary.BigEndian.Uint16(data[startIdx+1:startIdx+3])) + 4
|
||||||
|
|
||||||
|
|
||||||
// if the value of frameLen is > 0x100, we know that it's screwed up.
|
// if the value of frameLen is > 0x100, we know that it's screwed up.
|
||||||
// this helps keep error duration lowered.
|
// this helps keep error duration lowered.
|
||||||
if frameLen > 0x100 {
|
if frameLen > 0x100 {
|
||||||
|
|
|
@ -103,14 +103,13 @@ func Test_xbeeFrameSplit(t *testing.T) {
|
||||||
{
|
{
|
||||||
name: "start delimiter inside partial packet",
|
name: "start delimiter inside partial packet",
|
||||||
args: args{
|
args: args{
|
||||||
data: advTest,
|
data: advTest,
|
||||||
atEOF: false,
|
atEOF: false,
|
||||||
},
|
},
|
||||||
wantAdvance: 2,
|
wantAdvance: 2,
|
||||||
wantToken: nil,
|
wantToken: nil,
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
@ -129,8 +128,6 @@ func Test_xbeeFrameSplit(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func Test_parseFrame(t *testing.T) {
|
func Test_parseFrame(t *testing.T) {
|
||||||
type args struct {
|
type args struct {
|
||||||
frame []byte
|
frame []byte
|
||||||
|
|
Loading…
Reference in a new issue