aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-28 01:31:15 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-28 01:31:15 +0100
commit623b4aca1392637ae212ef8f2620475dc47fbee7 (patch)
treecc2ce7650ea9e100ac7ca74041b01d95af16aad2
parent9bfc2fe08fbb71322b31b86585816250baf8e883 (diff)
Send some messages
-rw-r--r--cmd/experimental/main.go4
-rw-r--r--protocol.go4
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
)