aboutsummaryrefslogtreecommitdiff
path: root/protocol2.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-29 22:41:38 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-29 22:41:38 +0100
commit55fe0c3c7bcd0243493976195a1e4d3283e2bfb7 (patch)
tree803b8800a896ccbccb86edf0b7dd0154ef639052 /protocol2.go
parent8085261f5e086f1bbb091a4ca9ec4042e62c47a5 (diff)
Dig deeper
Diffstat (limited to 'protocol2.go')
-rw-r--r--protocol2.go40
1 files changed, 33 insertions, 7 deletions
diff --git a/protocol2.go b/protocol2.go
index dbffd22..333b871 100644
--- a/protocol2.go
+++ b/protocol2.go
@@ -1,16 +1,20 @@
package anki
const (
- VehicleMsgV2CSpeedUpdate ID = 0x36
- VehicleMsgV2CStatusUpdate ID = 0x3f
- VehicleMsgV2CCollisionDetected ID = 0x4d
- VehicleMsgV2CCycleOvertime ID = 0x86
+ VehicleMsgV2CSpeedUpdate ID = 0x36
+ VehicleMsgV2CStatusUpdate ID = 0x3f
+ VehicleMsgV2CLaneChangeUpdate ID = 0x41
+ VehicleMsgV2CDelocAutoRecoveryEntered ID = 0x43
+ VehicleMsgV2CDelocAutoRecoverySuccess ID = 0x44
+ VehicleMsgV2CCollisionDetected ID = 0x4d
+ VehicleMsgV2CCycleOvertime ID = 0x86
+ VehicleMsgV2CDebug ID = 0xc9
)
// 07 36 20 03 98 3A 2A 00 cchhh
type VehicleMsgSpeedUpdate struct {
Size uint8
- MsgID uint8
+ MsgID ID
DesiredSpeed uint16 // mm/sec
Accel uint16 // mm/sec²
CurrentSpeed uint16 // mm/sec
@@ -19,17 +23,28 @@ type VehicleMsgSpeedUpdate struct {
// 05 3F 01 00 01 00
type VehicleMsgStatusUpdate struct {
Size uint8
- MsgID uint8
+ MsgID ID
IsOnTrack uint8
IsOnCharger uint8
HasLowBattery uint8
HasChargedBattery uint8
}
+// ID(65) | 00 00 99 42 00 00 99 42 00 00 F4 01 81
+type VehicleMsgLaneChangeUpdate struct {
+ Size uint8
+ MsgID ID
+ CurrentOffsetFromRoadCenter float32
+ TargetOffsetFromRoadCenter float32
+ HorizontalSpeed uint16
+ VerticalSpeed uint16
+ LaneChangeID uint8
+}
+
// 03 4D 01 00
type VehicleMsgCollisionDetected struct {
Size uint8
- MsgID uint8
+ MsgID ID
WasSideOnCollision uint8
WasFrontBackCollision uint8
}
@@ -42,3 +57,14 @@ type VehicleMsgCycleOvertime struct {
AverageCycleTime uint32 // µsec
MaxCycleTime uint32 // µsec
}
+
+// ID(201) | 04 15 03 00 00
+// case 0: read char
+// case 1: read char
+// case 2: read uint16
+// case 3: read uint16: Debug message (s16) from vehicle
+// case 4: read uint32
+// case 5: read uint32
+// case 6: read float: Debug message (float) from vehicle
+// case 7: read char: Vehicle Error: Error triggered on vehicle
+// default: Invalid CMD_DEBUG type