From 776923f099cd61de29613f6cc5e10c225ca1e72b Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 8 Jun 2017 13:48:51 +0200 Subject: [PATCH] minidrone: never expect responses for characteristic writes Signed-off-by: deadprogram --- platforms/parrot/minidrone/helpers_test.go | 23 ++++++++++--------- .../parrot/minidrone/minidrone_driver.go | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/platforms/parrot/minidrone/helpers_test.go b/platforms/parrot/minidrone/helpers_test.go index 1b7158bd..f9450e71 100644 --- a/platforms/parrot/minidrone/helpers_test.go +++ b/platforms/parrot/minidrone/helpers_test.go @@ -9,21 +9,22 @@ import ( var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) type bleTestClientAdaptor struct { - name string - address string - mtx sync.Mutex - + name string + address string + mtx sync.Mutex + withoutReponses bool testReadCharacteristic func(string) ([]byte, error) testWriteCharacteristic func(string, []byte) error } -func (t *bleTestClientAdaptor) Connect() (err error) { return } -func (t *bleTestClientAdaptor) Reconnect() (err error) { return } -func (t *bleTestClientAdaptor) Disconnect() (err error) { return } -func (t *bleTestClientAdaptor) Finalize() (err error) { return } -func (t *bleTestClientAdaptor) Name() string { return t.name } -func (t *bleTestClientAdaptor) SetName(n string) { t.name = n } -func (t *bleTestClientAdaptor) Address() string { return t.address } +func (t *bleTestClientAdaptor) Connect() (err error) { return } +func (t *bleTestClientAdaptor) Reconnect() (err error) { return } +func (t *bleTestClientAdaptor) Disconnect() (err error) { return } +func (t *bleTestClientAdaptor) Finalize() (err error) { return } +func (t *bleTestClientAdaptor) Name() string { return t.name } +func (t *bleTestClientAdaptor) SetName(n string) { t.name = n } +func (t *bleTestClientAdaptor) Address() string { return t.address } +func (t *bleTestClientAdaptor) WithoutReponses(use bool) { t.withoutReponses = use } func (t *bleTestClientAdaptor) ReadCharacteristic(cUUID string) (data []byte, err error) { t.mtx.Lock() diff --git a/platforms/parrot/minidrone/minidrone_driver.go b/platforms/parrot/minidrone/minidrone_driver.go index 5eb794ea..87e97805 100644 --- a/platforms/parrot/minidrone/minidrone_driver.go +++ b/platforms/parrot/minidrone/minidrone_driver.go @@ -152,6 +152,7 @@ func (b *Driver) adaptor() ble.BLEConnector { // Start tells driver to get ready to do work func (b *Driver) Start() (err error) { + b.adaptor().WithoutReponses(true) b.Init() b.FlatTrim() b.StartPcmd()