BGXpressScanner

BGXpressScanner is used to detect changes to the Bluetooth hardware and scan for devices. More...

Classes

protocol  <BGXpressScanDelegate >
 A protocol for keeping track of goings on with your BGXpressScanner. More...
 
class  BGXpressScanner
 

Enumerations

enum  ScanState : NSUInteger { CantScan, Idle, Scanning }
 

Detailed Description

BGXpressScanner is used to detect changes to the Bluetooth hardware and scan for devices.

It also contains a list of devices.

It has a delegate property using the BGXpressScanDelegate protocol.


Class Documentation

◆ BGXpressScanDelegate -p

protocol BGXpressScanDelegate -p

A protocol for keeping track of goings on with your BGXpressScanner.

Inherits <NSObject>.

Instance Methods

(void) - bluetoothStateChanged:
 bluetoothStateChanged This is called to indicate that system state of bluetooth changed. More...
 
(void) - deviceDiscovered:
 This is called to indicate that the scanner has found a device. More...
 
(void) - scanStateChanged:
 This method is called when the scanState has changed. More...
 

Method Documentation

◆ bluetoothStateChanged:()

- (void BGXpressScanDelegate) bluetoothStateChanged: (CBManagerState)  state
optional

bluetoothStateChanged This is called to indicate that system state of bluetooth changed.

◆ deviceDiscovered:()

- (void BGXpressScanDelegate) deviceDiscovered: (BGXDevice *)  device
optional

This is called to indicate that the scanner has found a device.

You can access each device as its discovered (via the parameter) or access them all using the devicesDiscovered property which is an array of BGXDevice objects.

◆ scanStateChanged:()

- (void BGXpressScanDelegate) scanStateChanged: (ScanState scanState
optional

This method is called when the scanState has changed.

◆ BGXpressScanner

class BGXpressScanner

Inherits NSObject, and <CBCentralManagerDelegate>.

Instance Methods

(BOOL) - startScan
 Call this method to start scanning for devices. More...
 
(BOOL) - stopScan
 Call this method to stop scanning for devices. More...
 

Protected Attributes

ScanState _scanState
 

Properties

NSObject< BGXpressScanDelegate > * delegate
 Assign this property to be your scan delegate. More...
 
NSMutableArray * devicesDiscovered
 This is an array of BGXDevice objects discovered by the scanner. More...
 
ScanState scanState
 The current state of the scanner. More...
 

Method Documentation

◆ startScan()

- (BOOL) startScan

Call this method to start scanning for devices.

Returns
Boolean value to indicate if scanning will start.
Remarks
Calling this method will clear the contents of the devicesDiscovered mutable array property.

◆ stopScan()

- (BOOL) stopScan

Call this method to stop scanning for devices.

Returns
Boolean value to indicate if scanning will stop.

Member Data Documentation

◆ _scanState

- (ScanState) _scanState
protected

Property Documentation

◆ delegate

- (NSObject<BGXpressScanDelegate>*) delegate
readwritenonatomicstrong

Assign this property to be your scan delegate.

◆ devicesDiscovered

- (NSMutableArray*) devicesDiscovered
readwritenonatomicstrong

This is an array of BGXDevice objects discovered by the scanner.

This property will be made readonly and immutable in the future.

◆ scanState

- (ScanState) scanState
readnonatomicassign

The current state of the scanner.

Enumeration Type Documentation

◆ ScanState

enum ScanState : NSUInteger
Enumerator
CantScan 

Scanning cannot occur. Calls to startScan will fail. Wait for Bluetooth to be enabled.

Idle 

Not currently scanning.

Scanning 

Currently scanning.