Peripheral ( peripheral) is a device that has been or has stored data ,
Central is thedevice that uses this data .
All the availableIOS devices can also be used as a peripheral (Per ipheral) or as central , but cannot be both peripheral and central .
Peripheral Equipment: As a service side, to provide services to the outside world, send data to the central equipment.
Central equipment: As a client, scan peripheral devices, and then Connect, find the appropriate services and features provided by peripheral equipment , receive data.
One peripheral equipment (peripheral, service side)
Need to follow proxy methods
<CBPeripheralManagerDelegate>
The main classes are:
Peripheral Equipment Management
@property (strong,nonatomic) Cbperipheralmanager *peripheramanager;
Characteristics
@property (strong,nonatomic) cbmutablecharacteristic *customercharacteristic;
Service
@property (strong,nonatomic) Cbmutableservice *customerservice;
- Create a feature
- Create a service
- Loading features onto the service
- Start the broadcast service
- Waiting for connections and subscriptions
- Send data to a central device
Two Center devices (Central, client)
Proxy methods to follow
<CBCentralManagerDelegate,CBPeripheralDelegate>
The main classes are:
Central Device Management
@property (strong,nonatomic) Cbcentralmanager *centralmanager;
Variant data
@property (strong,nonatomic) Nsmutabledata *mutabledata;
Peripheral equipment
@property (strong,nonatomic) cbperipheral *peripheral;
- Create a central Device Manager
- Scan peripheral Devices
- Connecting peripheral devices
- Services for Scanning peripherals
- Matching features for scanning peripheral services
- Receive data
- Disconnect Connection
IOS Bluetooth 4.0 Learning