2

I have a little hw with a BLE module that communicates with an iOS device.

I would like to perform a discovery using iBeacon (so using iBeacon advertisement packets) and - obviously - connection (and data exchange) using CoreBluetooth, but there are some issues.

Before describing the issues, I have to tell you that I need to provide these information in discovery phase:

  1. Serial number (needed for internal purposes) - 6 characters and 10 numbers.

  2. A "hw version" to specify what type of product it is (each product uses a different protocol).

The problem I have is basically how to perform the discovery phase and then connect to a particular discovered object:

A. In the iBeacon adv packet, I should use UUID field for serial number and major/minor field for the hw version, but if I do so, the devices will be basically not discoverable (iBeacon SDK for iOS needs to know the UUID to look for before starting the monitoring phase, so it cannot be different for every device).

B. In iOS, the iBeacon features are available through CoreLocation libraries, the standard BLE features are instead available through CoreBluetooth. If I use an iBeacon advertisement packet, the objects discovered by CoreBluetooth libraries do not see any information of the package (so, the problem is: "How do I know which is the object with serial XYZ?").

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
The Good Giant
  • 1,740
  • 2
  • 19
  • 35

2 Answers2

2

I realized that a possible solution for my problem would be advertising both iBeacon and standard BLE packages, in a "round robin way" let's say.

I tried it (I advertised for 500msec the iBeacon Package and for 500msec the standard BLE one) and Standard BLE seems to be ok.

I still need to investigate more about how iBeacon discovery reacts to this, but as said it could be a solution.

The Good Giant
  • 1,740
  • 2
  • 19
  • 35
  • Hey, What did you find out as the best solution for this? Have the same problem now and looking how to connect to standart BLE after beacon is found. Your 500msec solution sounds possible, but maybe there is any better way? – JInn May 19 '16 at 10:55
  • 1
    Hi, me and my team tested the "500msec" solution for a while and found that it seems stable enough to consider it "a definitive solution". Obviously, this hardly depends on the hw you're using (not hundred percent sure, but I guess we were using a Bluegiga module) We honestly tried to find out some other solutions for a while, without any success :( (also here, this hardly depends on how many information you do need to advertise) – The Good Giant May 20 '16 at 11:18
0

OPTION 1: If you want to use an iBeacon advertisement, forget about encoding any info directly in the ProximityUUID. As you mention, you need to know this up front in iOS. Instead, make a lookup table to convert the iBeacon identifiers to Hardware Number / Serial Number. Like this:

Proximity UUID                       Major Minor  HW/N  S/N
2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 10001 10001  0001  abcdef0000000001
2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 10001 10002  0001  abcdef0000000002

This system would let you have 65536*65536 different serial numbers for a single UUID. You would need to store this table server-side and have a web service to look up the Hardware Number and Serial Number based on the UUID/Major/Minor.

My company offers a cloud service at http://www.proximitykit.com that lets you do exactly this. You can even use our web service API to programmatically add items to your lookup table. (It will probably be big.)

OPTION 2: Since you need CoreBluetooth after a connection is established, you might consider using CoreBluetooth for the whole thing. Your advertisement would be identical for all hardware types, but after connecting, the first data transfer to iOS from the device would contain the hardware number and serial number. You could then adjust the communication as needed based on the hardware number.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • First of all thanks for the reply. I tried to do something similiar to option 1 (sorry but I don't want to use external services), putting my serial number inside the major/minor (it's 4294967295 possible serial numbers!), and hide the hw version inside that. It's a bit tricky and I don't like it a lot, but it works. I tend to exclude option 2 because it basically means connecting to every BLE device in range. – The Good Giant Apr 08 '14 at 07:10