If in our app we are acting as a peripheral mode
. Don't we have anyway to find when we are connected to any device. I want to log the the time when my device connects to another device.
As in central mode
we have this CBPeripheralState
for getting the current state of the peripheral connected to us. But I could not find anything like CBPeripheralState
as a peripheral
.
Asked
Active
Viewed 80 times
1

umairhhhs
- 400
- 6
- 19
-
I don't believe `CBPeripheralState` is really what you mean here. What you're looking for is a peripheral version of `centralManager(_:didConnect:)`. But I don't believe there is such a method (which I agree is somewhat surprising). The closest I know of are the `peripheralManager(_:did...)` methods to check the first time you're read/written/subscribed to. – Rob Napier Oct 09 '17 at 17:17
-
I mean if you are acting as centralManager, you have CBPeripheralState for checking the state of the available peripheral like is it connected, connecting ... , My case is for Peripheral, and i didn't find any thing like that so can log the time for my peripheral as it connects to some device. – umairhhhs Oct 09 '17 at 17:33
-
1Yes; but I don't believe there's any equivalent when you're a peripheral. The closest you can do is note the first time a central asks to access an attribute. – Rob Napier Oct 09 '17 at 17:41
-
This is the result I have in my mind till yet. – umairhhhs Oct 09 '17 at 17:43