Hardware Reference
In-Depth Information
We are using the term battery level , rather than potentiometer , be‐
cause a “battery level” peripheral is one of the predefined services and
associated characteristics in BLE. Though there is no requirement to
use a predefined profile, doing so is convenient for this discussion.
For this simple application, the key class references within the Core Bluetooth frame‐
work include CBCentralManager (an abstraction of the central manager role in BLE on
the iOS device) and CBPeripheral (an abstraction of the remote peripheral on the iOS
device). The code also includes the supporting classes CBService and CBCharacteris
tic , because you'll need to know which services and related charateristics are available
on the remote peripheral by discovering them (see “Service and Characteristic Discov‐
ery” on page 69 ).
Figure 9-2 shows the relationship between the services and characteristics programmed
into the BLE remote peripheral device and the CBPeripheral objects.
Figure 9-2. Relationship of CBPeripheral, CBServices, and CBCharacteristic objects
For convenience, the code in this example includes a few predefined services and char‐
acteristics (e.g., the Battery Service) from the BLE specification, which use 16-bit UUIDs
instead of vendor-specific 128-bit UUIDs (see “UUIDs” on page 52 ).
For more information on SIG-specified services and characteristics,
the Bluetooth Developer Portal provides a complete list of all prede‐
fined services and adopted characteristics .
 
Search WWH ::




Custom Search