bulat-icon  Articles  
 
 

[+]  Articles

 
     
   

Core Bluetooth (CB)

1.The Core Bluetooth framework provides the classes needed for your Mac and iOS apps to communicate with devices that are equipped with Bluetooth low energy wireless technology.

2.Core Bluetooth framework is an abstraction of the Bluetooth 4.0 low energy wireless specifications. 3. In the Core Bluetooth (CB) framework, you have 2 major players:Peripheral and Central.

a.The central: typically defines the logic behind a CB communication. It is able to scan, connect, and disconnect peripherals. Plus, it consumes the information available at each peripheral.

b.Peripheral:a device that has important information to share (heart rate, temperature, etc). The information can be pushed or advertised over the air.

core-bluetooth

Communication between Centrals with Peripherals

4.Advertising is the primary way that peripherals make their presence known via BTLE.

5.Advertising packets contain date related to peripheral, such as peripheral name, peripheral collects etc.

6.Central is to scan for these advertising packets, identify any peripherals it finds relevant, and connect to individual devices for more information.

core-bluetooth

Core Bluetooth Framework Objects

7.Central is represented by the CBCentralManager class, while the Peripheral is represented by the CBPeripheralManager.

8.On the Central, a CBPeripheral object represents the corresponding Peripheral that the Central is connected to. Similarly, on the Peripheral, the CBCentral object represents the client the Peripheral connected to.

9.Besides the Central and the Peripheral, we have to consider the structured data they exchange. These data are structured in Services. Each Service is then composed by different Characteristics. Characteristics are defined attribute types that contain a single logical value.

core-bluetooth

Central role task

10.Core Bluetooth framework to perform the most common types of Bluetooth low energy tasks from the central side.

a.Start up a central manager object.

b.Discover and connect to peripheral devices that are advertising.

c.Explore the data on a peripheral device after you've connected to it.

d.Send read and write requests to a characteristic value of a peripheral's service.

e.Subscribe to a characteristic value to be notified when it is updated.