Android phone can't discover services advertised from MacOS

I'm writing a MacOS Application to mimic some real hardware for debugging purposes.

The application acts as a peripheral (using CBPeripheralManager). It advertises a single service, the primary service, with two characteristics.

I have both iOS and Android applications that connect to the MacOS app. For the iOS application, everything works. I can connect to the app, discover services, and manipulate characteristics.

The Android application does a BLE scan for peripherals with the service ID and the MacOS application shows up as being available. After connecting to the peripheral, however, when the Android application asks to discover the services of the peripheral, the one service my peripheral offers does not show up. Somehow the service makes it into the advertisement but does not show up during service discovery.

Can anyone explain why my services would be advertised, but then not discoverable?

Replies

I am having exact the same problems. Did you find any fix? I think it has to do with the way Apple supports pairing. CBPeripheralManager should actually get some love from Apple engineers...

  • Yes. Eventually it did work, but I don't think it was ever the result of a dedicated effort so I'm not sure what solved the problem. Our Android engineers did some refactoring of their code, and as I recall I made some changes to reduce the amount of advertisement data . I wish I had a single thing I could point to and say "that fixed it" but I don't.

Add a Comment