0

I have two apps talking through CoreBluetooth, iOS and Today Extension (peripheral) and OSX (central).

1 - Setup process (iOS app x OSX app): They connect, exchange data that is stored and disconnect.

2 - App's main feature usage (iOS Today Extension x OSX app): They connect, exchange data and disconnect.

Unless I turn my iPhone's bluetooth off and on again between step 1 and 2, OSX app, finds iPhone, connects, but finds 0 services from Today Extension after peripheral.discoverServices is called in OSX app.

If I do turn bluetooth off and on, everything goes as expected. What could it be? Any help is very welcome. Thanks!

UPDATE: After using LightBlue on OSX I was able to confirm that, unless I restart bluetooth, the UUID service used in step 1 continues to be advertised, only when I restart bluetooth, UUID used in step 2 shows up.

Lee Andrew
  • 798
  • 7
  • 28
  • I got the same kind of problems, sometimes on service caching but especially on the readRSSI. (see http://stackoverflow.com/questions/26061359/ios-readrssi-doesnt-trigger-the-reading). If you find a solution for this i'm interested – M to the K Sep 30 '14 at 10:25
  • I have dug all internet but I cant find a solution, Ive opened a bug in Apple's bug reporter and as soon as they reply I'll let you know – Lee Andrew Sep 30 '14 at 15:05

1 Answers1

1

I got the same problem, first thought it might be my fault, but later it turns out to be really weird.

I wrote similar program, using iPhone to connect to a BLE beacon, and use [CBPeripheral readRSSI] to get the signal strength. Everything goes smooth when the BLE beacon is connected to my iPhone for the first time. But if it got disconnected, and reconnect again, the method readRSSI won't get called any more. Only after I restart the bluetooth on my iPhone, the issue will be resolved.

I run the program in debug mode, step by step, to my surprise, I found no problem at all. Even I disconnect for so many times and reconnect again, the method readRSSI can still be called properly.

Hope this may help. I am also waiting for an answer for this strange thing.

Tom Ou
  • 41
  • 1