record,ios, xcode, object-c, central,peripheral ,GATT service and GATT client.
background:
if you need the basic knowledge you can reference previsour information that about the BLE (Bluetooth low energy 4.0 *1).
1. explain
First , every device have only one role (central or peripheral).;
central:
A central typically uses the information served up by peripherals to accomplish some particular task
work scan function and interaction with peripheral.
discovering,
Explore the data,
Send read and write requests
Subscribe to a characteristic’s value).
peripheral:
a peripheral typically has data that is needed by other devices.
which task has
Advertise your services ,
Respond to read and write requests from a connected central
Send updated characteristic values to subscribed centrals
Secode , you should see the Bluetooth Core Special .about the GAP and GATT layer information.
I will map Core Bluetooth ios between Bluetooth Core Special. and the Bluetooth Core Special reference ……….
At BLE 4.0 ,every device only have one role (central or peripheral); which GAP role
about the GATT Service and Client(Bluetooth Core special) ,in which the Group data struct . the role (central and peripheral) can conatin GATT client/service .
but in Core Bluetooth ios ,which not distruction GATT client/service.
the characteristic read/write properties setting is by client .
the central ,should be GATT client ;
another, peripheral is GATT sevice.
you can see next section about this;
2. Implement
A. Perpheral (GATT service)
how to
- Start up a peripheral manager object
- initWithDelegate:queue: method of the CBPeripheralManager class
- peripheralManagerDidUpdateState: method of its delegate object
- Set up services and characteristics on your local peripheral
- Build Your Tree of Characteristics
- Services
- associate the characteristic with it by setting the service
- THE properties and permissions,seeCBMutableCharacteristic Class Reference.
- Publish your services and characteristics to your device’s local database
- Advertise your services
- CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey
- When you start advertising some of the data on your local peripheral, the peripheral manager calls the
peripheralManagerDidStartAdvertising:error: method of its delegate object - ** when you advertise the services 128 bit uuid ,which is not …
- Respond to read and write requests from a connected central
- receive a simple request to read the value of a characteristic
- central sends a request to write the value of one or more of your characteristics
- ** if you have multi characteristics to read/write
- Send updated characteristic values to subscribed centrals
how to:
- Start up a central manager object
- initWithDelegate:queue:
method of the CBCentralManager class - When you create a central manager, the central manager calls the centralManagerDidUpdateState:
method of its delegate object - Discover and connect to peripheral devices that are advertising
- scanForPeripheralsWithServices:options: method of the CBCentralManager class
- when a interest get
- stop scan
- connectPeripheral:options: method of the
CBCentralManager class - connection request is successful
- Explore the data on a peripheral device after you’ve connected to it
- you may discover that a peripheral has more services than
what it advertises (in its advertising packets). You can discover all of the services that a peripheral offers by
calling the discoverServices: method of the CBPeripheral class - specified services are discovered
- Discovering the Characteristics of a Service
- characteristics of the specified service are discovered.
- Send read and write requests to a characteristic value of a peripheral’s service
- delegate object to retrieve the
value. If the value is successfully retrieved, you can access it through the characteristic’s value property - write its value with some data (an
instance of NSData) by calling the writeValue:forCharacteristic:type: method of the CBPeripheral
class - The peripheral responds to write requests that are specified as CBCharacteristicWriteWithResponse by
calling the peripheral:didWriteValueForCharacteristic:error: method of its delegate object - Subscribe to a characteristic’s value to be notified when it is updated
* BLE 4.0 ;
every device only have one role action. (central/peripheral); next BLE 4.1 which can work currently .
http://blog.csdn.net/jimoduwu/article/details/8917104








