fix socketcan bugs
This commit is contained in:
parent
641c35afbd
commit
cf112ef561
|
@ -144,6 +144,8 @@ func (sck *CanSocket) Send(msg *can.Frame) error {
|
||||||
idToWrite |= unix.CAN_RTR_FLAG
|
idToWrite |= unix.CAN_RTR_FLAG
|
||||||
case can.CanErrFrame:
|
case can.CanErrFrame:
|
||||||
return errors.New("you can't send error frames")
|
return errors.New("you can't send error frames")
|
||||||
|
case can.CanDataFrame:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return errors.New("unknown frame type")
|
return errors.New("unknown frame type")
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ func TestCanSocket(t *testing.T) {
|
||||||
err := sock.Send(testFrame)
|
err := sock.Send(testFrame)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue