Skip to content

Commit

Permalink
bb8: use updated ble adaptor interface for tests
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Jun 15, 2017
1 parent 9c7e1ca commit 049ca30
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions platforms/sphero/bb8/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ 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()
Expand Down

0 comments on commit 049ca30

Please sign in to comment.