func (b *BLEClientAdaptor) Finalize() (errs []error) {
	return b.Disconnect()
}
Finalize finalizes the BLEAdaptor
package ble
import (
	"fmt"
	"log"
	"strings"
	"github.com/currantlabs/gatt"
	"github.com/hybridgroup/gobot"
)
var _ gobot.Adaptor = (*BLEClientAdaptor)(nil)
type BLEClientAdaptor struct {
	name       string
	uuid       string
	device     gatt.Device
	peripheral gatt.Peripheral
	services   map[string]*BLEService
	connected  bool
	ready      chan struct{}
}
func NewBLEClientAdaptor(name string, uuid string) *BLEClientAdaptor {
	return &BLEClientAdaptor{
		name:      name,
		uuid:      uuid,
		connected: false,
		ready:     make(chan struct{}),
		services:  make(map[string]*BLEService),
	}
}
func (b *BLEClientAdaptor) Name() string                { return b.name }
func (b *BLEClientAdaptor) UUID() string                { return b.uuid }
func (b *BLEClientAdaptor) Peripheral() gatt.Peripheral { return b.peripheral }
func (b *BLEClientAdaptor) Connect() (errs []error) {
	device, err := gatt.NewDevice(DefaultClientOptions...)
	if err != nil {
		log.Fatalf("Failed to open BLE device, err: %s\n", err)
		return
	}
	b.device = device
	device.Handle(
		gatt.PeripheralDiscovered(b.DiscoveryHandler),
		gatt.PeripheralConnected(b.ConnectHandler),
		gatt.PeripheralDisconnected(b.DisconnectHandler),
	)
	device.Init(b.StateChangeHandler)
	<-b.ready
	return nil
}
func (b *BLEClientAdaptor) Reconnect() (errs []error) {
	if b.connected {
		b.Disconnect()
	}
	return b.Connect()
}
func (b *BLEClientAdaptor) Disconnect() (errs []error) {
	b.peripheral.Device().CancelConnection(b.peripheral)
	return
}