ble: correct spelling error in function name

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans 2018-02-18 08:47:28 +01:00
parent 8e6391105d
commit 5c74cab289
2 changed files with 24 additions and 24 deletions

View File

@ -28,7 +28,7 @@ type BLEConnector interface {
ReadCharacteristic(string) ([]byte, error)
WriteCharacteristic(string, []byte) error
Subscribe(string, func([]byte, error)) error
WithoutReponses(bool)
WithoutResponses(bool)
}
// ClientAdaptor represents a Client Connection to a BLE Peripheral
@ -42,19 +42,19 @@ type ClientAdaptor struct {
client blelib.Client
profile *blelib.Profile
connected bool
ready chan struct{}
withoutReponses bool
connected bool
ready chan struct{}
withoutResponses bool
}
// NewClientAdaptor returns a new ClientAdaptor given an address or peripheral name
func NewClientAdaptor(address string) *ClientAdaptor {
return &ClientAdaptor{
name: gobot.DefaultName("BLEClient"),
address: address,
DeviceName: "default",
connected: false,
withoutReponses: false,
name: gobot.DefaultName("BLEClient"),
address: address,
DeviceName: "default",
connected: false,
withoutResponses: false,
}
}
@ -67,9 +67,9 @@ func (b *ClientAdaptor) SetName(n string) { b.name = n }
// Address returns the Bluetooth LE address for the adaptor
func (b *ClientAdaptor) Address() string { return b.address }
// WithoutReponses sets if the adaptor should expect responses after
// WithoutResponses sets if the adaptor should expect responses after
// writing characteristics for this device
func (b *ClientAdaptor) WithoutReponses(use bool) { b.withoutReponses = use }
func (b *ClientAdaptor) WithoutResponses(use bool) { b.withoutResponses = use }
// Connect initiates a connection to the BLE peripheral. Returns true on successful connection.
func (b *ClientAdaptor) Connect() (err error) {
@ -152,7 +152,7 @@ func (b *ClientAdaptor) WriteCharacteristic(cUUID string, data []byte) (err erro
uuid, _ := blelib.Parse(cUUID)
if u := b.profile.Find(blelib.NewCharacteristic(uuid)); u != nil {
err = b.client.WriteCharacteristic(u.(*blelib.Characteristic), data, b.withoutReponses)
err = b.client.WriteCharacteristic(u.(*blelib.Characteristic), data, b.withoutResponses)
}
return

View File

@ -5,23 +5,23 @@ import "sync"
var _ BLEConnector = (*bleTestClientAdaptor)(nil)
type bleTestClientAdaptor struct {
name string
address string
mtx sync.Mutex
withoutReponses bool
name string
address string
mtx sync.Mutex
withoutResponses 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) WithoutReponses(use bool) { t.withoutReponses = use }
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) WithoutResponses(use bool) { t.withoutResponses = use }
func (t *bleTestClientAdaptor) ReadCharacteristic(cUUID string) (data []byte, err error) {
t.mtx.Lock()