iOS peripheral as GATT Client
iOS peripheral as GATT Client
- Subject: iOS peripheral as GATT Client
- From: Roland King <email@hidden>
- Date: Sun, 11 Jan 2015 18:11:39 +0800
On embedded hardware platforms it doesn’t actually matter which device is peripheral and which is central, once they’ve connected either or both can act as GATT server or client. On the Nordic platform I use for instance you can call GATT client and server functions whether you are running as central or peripheral.
I’m reasonably sure however looking at the iOS functions that you cannot have an iOS device be a peripheral and, when a central connects to it, use that connected central as a server, discover its characteristics, read and write to it. The only functions to perform that are on CBPeripheral and the only way to get a CBPeripheral is to be a CBCentralManager. If you are a peripheral, ie a CBPeripheralManager, you get the central (when it asks for something) but there’s no API on CBCentral which allows you to treat it as a GATT server, even though it is one.
Seems that iOS ties Central to Client and Peripheral to Server very tightly. Is this correct or is there a way to be CBPeripheralManager and still, when connected, be a GATT client of the connected central?
Regrettably in this particular instance the device the phone is connecting to has to be a central, so the phone needs to be a peripheral.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden