From 55fe0c3c7bcd0243493976195a1e4d3283e2bfb7 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 29 Dec 2016 22:41:38 +0100 Subject: Dig deeper --- protocol2.go | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'protocol2.go') 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 -- cgit v1.2.3