objective-cswiftbluetoothjailbreaktheos

How can I retrieve serial number of a connected bluetooth device?


So straight to the point, my headphones broke and I can't listen to music with them. The store I bought them in requires the serial number from me to accept the warranty and I can't get it because I got rid off the package that they were in. Is there any way to use jailbroken iPhone to retrieve such data? Or Windows? Mac? I've tried almost everything, found some android stuff but I don't own any android phone. Device manager in Windows gives me something, but it's not defined properly and I don't really know what's what there.

I know objective-c and swift so if I can combine them or use one of them to modify something in iOS, I'd be helpful for a tip.


Solution

  • Getting this information depends on the device that you have. First you have to connect to your device using the iOS Bluetooth framework.

    If you are not familiar with CoreBluetooth, you can take a look at this tutorial: https://www.raywenderlich.com/231-core-bluetooth-tutorial-for-ios-heart-rate-monitor

    After you have connected to your device, you have to look for the Device Information service (UID 0x180A).

    This service has an optional characteristic called "Serial Number String". If you are lucky, your device will return a value for this characteristic.