minidrone: never expect responses for characteristic writes

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-06-08 13:48:51 +02:00
parent c23eb64403
commit 776923f099
2 changed files with 13 additions and 11 deletions

View File

@ -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()

View File

@ -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()