Re: iOS peripheral as GATT Client
Re: iOS peripheral as GATT Client
- Subject: Re: iOS peripheral as GATT Client
- From: Martijn The <email@hidden>
- Date: Mon, 12 Jan 2015 08:42:19 -0800
>
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.
Unfortunately, there is no "-centralDidConnect:" delegate method. So just letting the other device connect to the iOS device is not enough to get any delegate methods fired on your CBPeripheralManagerDelegate.
But... once you do get hold of a CBCentral object -- either through -peripheralManager:central:didSubscribeToCharacteristic: or via the CBATTRequest's `central` property that you get when receiving a read/write -- you can use the identifier of that CBCentral object and use it with CBCentralManager's -retrievePeripheralsWithIdentifiers: to get the CBPeripheral for the same device. Once you've got that you can do service discovery and read/write etc.
Agree it's extremely clumsy, but not impossible :)
_______________________________________________
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