aboutsummaryrefslogtreecommitdiff
path: root/protocol2.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-28 22:18:13 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-28 22:18:13 +0100
commit987606d976bf7004dcbdbbcfb45ac31f5913f477 (patch)
tree48de77846b9c49b964f5b83fa835829c946036ea /protocol2.go
parent6cce2f71fe994d33c785541718c16fb235a09768 (diff)
More missing parts
Diffstat (limited to 'protocol2.go')
-rw-r--r--protocol2.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/protocol2.go b/protocol2.go
index cf8c4c0..dbffd22 100644
--- a/protocol2.go
+++ b/protocol2.go
@@ -1,11 +1,13 @@
package anki
const (
- VehicleMsgV2CSpeedUpdate = 0x36
- VehicleMsgV2CStatusUpdate = 0x3f
- VehicleMsgV2CCollisionDetected = 0x4d
+ VehicleMsgV2CSpeedUpdate ID = 0x36
+ VehicleMsgV2CStatusUpdate ID = 0x3f
+ VehicleMsgV2CCollisionDetected ID = 0x4d
+ VehicleMsgV2CCycleOvertime ID = 0x86
)
+// 07 36 20 03 98 3A 2A 00 cchhh
type VehicleMsgSpeedUpdate struct {
Size uint8
MsgID uint8
@@ -14,6 +16,7 @@ type VehicleMsgSpeedUpdate struct {
CurrentSpeed uint16 // mm/sec
}
+// 05 3F 01 00 01 00
type VehicleMsgStatusUpdate struct {
Size uint8
MsgID uint8
@@ -23,9 +26,19 @@ type VehicleMsgStatusUpdate struct {
HasChargedBattery uint8
}
+// 03 4D 01 00
type VehicleMsgCollisionDetected struct {
Size uint8
MsgID uint8
WasSideOnCollision uint8
WasFrontBackCollision uint8
}
+
+// 0B 86 11 00 26 08 00 00 13 10 00 00 cchii
+type VehicleMsgCycleOvertime struct {
+ Size uint8
+ MsgID ID
+ NumOvertimeCycles uint16
+ AverageCycleTime uint32 // µsec
+ MaxCycleTime uint32 // µsec
+}