From 623b4aca1392637ae212ef8f2620475dc47fbee7 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 28 Dec 2016 01:31:15 +0100 Subject: Send some messages --- cmd/experimental/main.go | 4 ++++ protocol.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/experimental/main.go b/cmd/experimental/main.go index 577a516..f46fcdc 100644 --- a/cmd/experimental/main.go +++ b/cmd/experimental/main.go @@ -69,6 +69,10 @@ func onConnect(p gatt.Peripheral, err error) { //c.HandleReadFunc(onRead) //log.Println("Send") //c.SetValue([]byte{0x01, 0x18}) + p.WriteCharacteristic(c, []byte{0x01, 0x90}, false) // sdk + p.WriteCharacteristic(c, []byte{0x01, 0x16}, true) // ping + p.WriteCharacteristic(c, []byte{0x01, 0x18}, true) // version + p.WriteCharacteristic(c, []byte{0x01, 0x1a}, true) // battery } } } diff --git a/protocol.go b/protocol.go index 4e488b2..9d12393 100644 --- a/protocol.go +++ b/protocol.go @@ -61,7 +61,7 @@ type VehicleMsg struct { type VehicleMsgVersionResponse struct { Size uint8 MsgID uint8 - Version uint16 + Version uint16 // uint32 ? } type VehicleBatteryLevelResponse struct { @@ -174,7 +174,7 @@ type VehicleLocalizationPositionUpdate struct { // VehicleDrivingDirection const ( - Forward = iota + Forward uint8 = iota Reverse ) -- cgit v1.2.3