Inherits from NSObject
Conforms to CBCentralManagerDelegate
CBPeripheralDelegate
CBPeripheralManagerDelegate
Declared in SBBluetooth.h

Tasks

Class Methods

sharedManager

+ (instancetype)sharedManager
Discussion

Singleton instance of the SBBluetooth, CoreBluetooth wrapper

Return Value

SBBluetooth instance (singleton)

Declared In

SBBluetooth.h

Instance Methods

authorizationStatus

Returns a @SBBluetoothStatus value

- (SBBluetoothStatus)authorizationStatus

Return Value

One of SBBluetoothUnknown, SBBluetoothOff, SBBluetoothOn

Availability

2.0

Declared In

SBBluetooth.h

cancelConnection:

- (void)cancelConnection:(CBPeripheral *)peripheral
Discussion

Cancel a connection attempt.

Parameters

peripheral

A CBPeripheral object to connect

Declared In

SBBluetooth.h

connectPeripheral:

- (void)connectPeripheral:(CBPeripheral *)peripheral
Discussion

Attempts connection to peripheral.

Parameters

peripheral

A CBPeripheral to connect

Declared In

SBBluetooth.h

devices

- (NSArray *)devices
Discussion

Currently visible devices

Return Value

NSArray containing a list of SBDevice objects

Declared In

SBBluetooth.h

disconnectPeripheral:

- (void)disconnectPeripheral:(CBPeripheral *)peripheral
Discussion

Cancels a connection to (or disconnects) a peripheral

Parameters

peripheral

A CBPeripheral object; If the CBCentralManager is connected to this peripheral, it will attempt to disconnect

Declared In

SBBluetooth.h

requestAuthorization

Call this method before using any Bluetooth functionality

- (void)requestAuthorization

Availability

2.0

Declared In

SBBluetooth.h

startAdvertising:major:minor:name:

Advertise a software emulated beacon

- (void)startAdvertising:(NSString *)proximityUUID major:(int)major minor:(int)minor name:(NSString *)name

Parameters

proximityUUID

The proximity UUID of the emulated beacon

major

Value for the major identifier

minor

Value for the minor identifier

name

Name for the emulated beacon

Availability

2.0

Declared In

SBBluetooth.h

startServiceScan:

- (void)startServiceScan:(NSArray<NSString*> *)services
Discussion

Starts scanning for Bluetooth devices. If you pass an empty array it will attempt to find all devices. You can pass a service identifier as a NSString and the CBCentralManager will only scan for devices that broadcast that service (see https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx )

Parameters

services

Array of service identifiers, as NSString (@“0x180F” or @“180F”) - these will automatically be converted to NSUUID/CBUUID

Declared In

SBBluetooth.h

stopAdvertising

Stops advertising the emulated iBeacon

- (void)stopAdvertising

Availability

2.0

Declared In

SBBluetooth.h

stopServiceScan

- (void)stopServiceScan
Discussion

Stops scanning for Bluetooth devices

Declared In

SBBluetooth.h

subscribeToCharacteristic:

- (void)subscribeToCharacteristic:(CBCharacteristic *)characteristic

unsubscribeFromCharacteristic:

- (void)unsubscribeFromCharacteristic:(CBCharacteristic *)characteristic