Documentation
¶
Overview ¶
Package ble provides the Gobot drivers for several Bluetooth LE Services.
For more information refer to the README: https://github.com/hybridgroup/gobot/blob/release/drivers/ble/README.md
Index ¶
- type BatteryDriver
- type DeviceInformationDriver
- func (d *DeviceInformationDriver) GetFirmwareRevision() (string, error)
- func (d *DeviceInformationDriver) GetHardwareRevision() (string, error)
- func (d *DeviceInformationDriver) GetManufacturerName() (string, error)
- func (d *DeviceInformationDriver) GetModelNumber() (string, error)
- func (d *DeviceInformationDriver) GetPnPId() (string, error)
- type Driver
- type GenericAccessDriver
- type OptionApplier
- type SerialPortDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatteryDriver ¶
type BatteryDriver struct { *Driver gobot.Eventer }
BatteryDriver represents the battery service for a BLE peripheral
func NewBatteryDriver ¶
func NewBatteryDriver(a gobot.BLEConnector, opts ...OptionApplier) *BatteryDriver
NewBatteryDriver creates a new driver
func (*BatteryDriver) GetBatteryLevel ¶
func (d *BatteryDriver) GetBatteryLevel() (uint8, error)
GetBatteryLevel reads and returns the current battery level
type DeviceInformationDriver ¶
type DeviceInformationDriver struct { *Driver gobot.Eventer }
DeviceInformationDriver represents the device information service for a BLE peripheral
func NewDeviceInformationDriver ¶
func NewDeviceInformationDriver(a gobot.BLEConnector, opts ...OptionApplier) *DeviceInformationDriver
NewDeviceInformationDriver creates a new driver
func (*DeviceInformationDriver) GetFirmwareRevision ¶
func (d *DeviceInformationDriver) GetFirmwareRevision() (string, error)
GetFirmwareRevision returns the firmware revision for the BLE Peripheral
func (*DeviceInformationDriver) GetHardwareRevision ¶
func (d *DeviceInformationDriver) GetHardwareRevision() (string, error)
GetHardwareRevision returns the hardware revision for the BLE Peripheral
func (*DeviceInformationDriver) GetManufacturerName ¶
func (d *DeviceInformationDriver) GetManufacturerName() (string, error)
GetManufacturerName returns the manufacturer name for the BLE Peripheral
func (*DeviceInformationDriver) GetModelNumber ¶
func (d *DeviceInformationDriver) GetModelNumber() (string, error)
GetModelNumber returns the model number for the BLE Peripheral
func (*DeviceInformationDriver) GetPnPId ¶
func (d *DeviceInformationDriver) GetPnPId() (string, error)
GetPnPId returns the PnP ID for the BLE Peripheral
type Driver ¶
type Driver struct { gobot.Commander // contains filtered or unexported fields }
Driver implements the interface gobot.Driver.
func NewDriver ¶
func NewDriver( a interface{}, name string, afterStart func() error, beforeHalt func() error, opts ...OptionApplier, ) *Driver
NewDriver creates a new basic BLE gobot driver.
func (*Driver) Adaptor ¶
func (d *Driver) Adaptor() gobot.BLEConnector
Adaptor returns the BLE adaptor
func (*Driver) Connection ¶
func (d *Driver) Connection() gobot.Connection
Connection returns the connection of the driver.
func (*Driver) SetName ¶
SetName sets the name of the driver. Deprecated: Please use option ble.WithName instead.
type GenericAccessDriver ¶
type GenericAccessDriver struct { *Driver gobot.Eventer }
GenericAccessDriver represents the Generic Access Service for a BLE Peripheral
func NewGenericAccessDriver ¶
func NewGenericAccessDriver(a gobot.BLEConnector, opts ...OptionApplier) *GenericAccessDriver
NewGenericAccessDriver creates a GenericAccessDriver
func (*GenericAccessDriver) GetAppearance ¶
func (d *GenericAccessDriver) GetAppearance() (string, error)
GetAppearance returns the appearance string for the BLE Peripheral
func (*GenericAccessDriver) GetDeviceName ¶
func (d *GenericAccessDriver) GetDeviceName() (string, error)
GetDeviceName returns the device name for the BLE Peripheral
type OptionApplier ¶
type OptionApplier interface {
// contains filtered or unexported methods
}
OptionApplier needs to be implemented by each configurable option type
func WithName ¶
func WithName(name string) OptionApplier
WithName is used to replace the default name of the driver.
type SerialPortDriver ¶
type SerialPortDriver struct { *Driver // contains filtered or unexported fields }
SerialPortDriver is a implementation of serial over Bluetooth LE Inspired by https://github.com/monteslu/ble-serial by @monteslu
func NewSerialPortDriver ¶
func NewSerialPortDriver(a gobot.BLEConnector, rid string, tid string, opts ...OptionApplier) *SerialPortDriver
NewSerialPortDriver returns a new serial over Bluetooth LE connection
func (*SerialPortDriver) Address ¶
func (p *SerialPortDriver) Address() string
Address returns the BLE address
func (*SerialPortDriver) Close ¶
func (p *SerialPortDriver) Close() error
Close closes the BLE serial port connection
func (*SerialPortDriver) Open ¶
func (p *SerialPortDriver) Open() error
Open opens a connection to a BLE serial device
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package microbit contains the Gobot drivers for the Microbit platform.
|
Package microbit contains the Gobot drivers for the Microbit platform. |
Package parrot contains the Gobot driver for the Parrot Minidrone platform.
|
Package parrot contains the Gobot driver for the Parrot Minidrone platform. |
Package sphero provides the Gobot drivers for the Sphero BLE based platforms.
|
Package sphero provides the Gobot drivers for the Sphero BLE based platforms. |