mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
new: implemented can.obd2 builtin parser
This commit is contained in:
parent
cf6fba6151
commit
c3999d6bb5
11 changed files with 520 additions and 52 deletions
24
modules/can/can_message.go
Normal file
24
modules/can/can_message.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package can
|
||||
|
||||
import (
|
||||
"github.com/bettercap/bettercap/v2/network"
|
||||
"go.einride.tech/can"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
// the raw frame
|
||||
Frame can.Frame
|
||||
// parsed as OBD2
|
||||
OBD2 *OBD2Message
|
||||
// parsed from DBC
|
||||
Name string
|
||||
Source *network.CANDevice
|
||||
Signals map[string]string
|
||||
}
|
||||
|
||||
func NewCanMessage(frame can.Frame) Message {
|
||||
return Message{
|
||||
Frame: frame,
|
||||
Signals: make(map[string]string),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue