func (b *BLEClientAdaptor) ReadCharacteristic(sUUID string, cUUID string) (data []byte, err error) {
	if !b.connected {
		log.Fatalf("Cannot read from BLE device until connected")
		return
	}
	characteristic := b.lookupCharacteristic(sUUID, cUUID)
	if characteristic == nil {
		log.Println("Cannot read from unknown characteristic")
		return
	}
	val, err := b.peripheral.ReadCharacteristic(characteristic)
	if err != nil {
		fmt.Printf("Failed to read characteristic, err: %s\n", err)
		return nil, err
	}
	return val, nil
}
ReadCharacteristic returns bytes from the BLE device for the
requested service and characteristic
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
}
func (b *BLEClientAdaptor) Finalize() (errs []error) {
	return b.Disconnect()
}