Documentation ¶
Overview ¶
Package corebluetooth provides an implementation of ble.Driver using the CoreBluetooth Objective-C API
The bridge rules between the two are as follows:
THREADS: Everything in obj-c runs single threaded on a dedicated Grand Central Dispatch queue (read: thread). Obj-C is responsible for getting itself on that thread in calls from Go. Go is responsible for getting _off_ the obj-c queue via goroutines when calling out to the rest of the stack. MEMORY: Callers retain ownership of their memory -- callee must copy right away. The exception to this is when memory is returned either via the function or via a double pointer (in the case of errorOut following Obj-C semantics of returning BOOL matched with passing of NSError **). In this case ownership is transfered and callee must free.
Index ¶
- func Clean()
- type CoreBluetoothDriver
- func (d *CoreBluetoothDriver) AddService(uuid string, characteristics map[string][]byte) error
- func (d *CoreBluetoothDriver) DebugString() string
- func (d *CoreBluetoothDriver) NumServicesAdvertising() int
- func (d *CoreBluetoothDriver) RemoveService(uuid string)
- func (d *CoreBluetoothDriver) StartScan(uuids []string, baseUuid, maskUuid string, handler ble.ScanHandler) error
- func (d *CoreBluetoothDriver) StopScan()
- type OnDiscovered
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoreBluetoothDriver ¶
type CoreBluetoothDriver struct {
// contains filtered or unexported fields
}
CoreBluetoothDriver provides an abstraction for an underlying mechanism to discover near-by Vanadium services through Bluetooth Low Energy (BLE) with CoreBluetooth.
See Driver for more documentation.
func (*CoreBluetoothDriver) AddService ¶
func (d *CoreBluetoothDriver) AddService(uuid string, characteristics map[string][]byte) error
AddService implements v.io/x/lib/discovery/plugins/ble.Driver.AddService
func (*CoreBluetoothDriver) DebugString ¶
func (d *CoreBluetoothDriver) DebugString() string
DebugString implements v.io/x/lib/discovery/plugins/ble.Driver.DebugString by returning the current state of the CoreBluetooth driver in a string description
func (*CoreBluetoothDriver) NumServicesAdvertising ¶
func (d *CoreBluetoothDriver) NumServicesAdvertising() int
func (*CoreBluetoothDriver) RemoveService ¶
func (d *CoreBluetoothDriver) RemoveService(uuid string)
RemoveService implements v.io/x/lib/discovery/plugins/ble.Driver.RemoveService
func (*CoreBluetoothDriver) StartScan ¶
func (d *CoreBluetoothDriver) StartScan(uuids []string, baseUuid, maskUuid string, handler ble.ScanHandler) error
StartScan implements v.io/x/lib/discovery/plugins/ble.Driver.StartService
func (*CoreBluetoothDriver) StopScan ¶
func (d *CoreBluetoothDriver) StopScan()
StopScan implements v.io/x/lib/discovery/plugins/ble.Driver.StopScan