Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send data to an iphone which is turned into a iBeacon?

how is it possible to send data to an iPhone which acts as an iBeacon? I am looking for an process as the following:

  1. Search nearby iBeacons
  2. Connect to some iBeacon
  3. Exchange data between the devices

Does anybody know how to put the different bluetooth functions together to make this possible?

thx in advance

like image 464
ErdyMurphy Avatar asked Nov 01 '13 11:11

ErdyMurphy


3 Answers

Standard iBeacons are transmit-only devices that can be seen by mobile devices, but don't actually "connect" to them or exchange data.

But you can still do what you are asking if you have an app on all devices as well as a web service to do the data transfer. This would allow devices A and B to detect each other when they are nearby and exchange data. Here's how:

  1. Your app on devices A and B alternates between acting as an iBeacon (advertising its presence with an application-specific identifier and a phone-specific identifier) and ranging for iBeacon signals including the application-specific identifier.
  2. During its ranging cycle, your app on device A will detect an iBeacon transmission from device B, which includes both your application identifier and the device identifier of B.
  3. App A then makes a "write" call to the web service with a source of "A" and a destination of "B", along with any data you want to transfer, like "Device A says hello to device B."
  4. The app would also periodically make a "read" call to the web service. In this example, device B would read any information destined for B, and the web service would return a record that device A had send it a message with the data "Device A says hello to device B."

Because the same process is also running on both phones, this communication can happen both ways.

like image 126
davidgyoung Avatar answered Nov 14 '22 19:11

davidgyoung


iBeacon is a proximity technology and isn't designed for data interchange. However, since the Bluetooth stack is going to be active on your iPhone acting as the beacon (so it can advertise its proximity UUID), you can use Core Bluetooth to connect to the beacon and exchange data between the devices.

like image 23
neilco Avatar answered Nov 14 '22 19:11

neilco


Does it specifically need to use iBeacon technology? The reason I ask is that from reading your description of the process, you could achieve the same thing using iOS 7's Multipeer Connectivity. It's able to abstract out all the technical complexities of connecting 2 iOS devices together regardless of the interface, be it WiFi or Bluetooth. I've managed to build something similar using MCNearbyServiceBrowser, MCNearbyServiceAdvertiser, and MCSession classes.

like image 29
Yazid Avatar answered Nov 14 '22 20:11

Yazid