BLE execute a function near a Bluetooth device - swift

I have a Bluetooth device, and I try to execute a function when my application is near the device.
I read on an iBeacon technology, but I did not really understand if the iBeacon could be used on all Bluetooth devices as long as you have your UUID, or you need the Bluetooth device have a service that sends a special UUID for iBeacon?

If you have access to the firmware on your Bluetooth device, it is generally simple to set up iBeacon advertising. You must enable the Bluetooth controller to emit a manufacturer advertisement with a specific 22 byte payload. The details of how you do this is device-dpecific.
That payload contains three identifiers which you may choose, the Proximity UUID is a 16 byte sequence, the major is a two byte sequence and the minor is also a two byte sequence.
You can see the layout of this payload in my answer here.
You can then use the CoreLocation API on iOS and the Android Beacon Library on Android devices to detect the iBeacon advertisement with the same identifiers and make your app react.

Related

Can I make iPhone/iPad broadcast as Eddystone Beacon?

We can make iOS devices act as a iBeacon transmitter and We can locate nearby iBeacons if we know their Proximity UUID.
With Google's Proximity Beacon API, It's possible to configure and register real Beacon hardware, and we can locate them with Nearby Messaging API.
But is it possible to make iOS devices to broadcast as Eddystone Beacons ? And it needs to be discoverable by apps that scan Eddystone beacons.
Thanks in advance.
Unfortunately, this is not possible. While iOS devices can advertise Bluetooth LE service advertisements(which are the advertisement type used by Eddystone) using CoreBluetooth APIs, you cannot attach the necessary data. This is because the CBAdvertisementDataServiceDataKey that associates service data to an advertisement is read-only on iOS. You can't set the data.
So while you want to make the iOS device advertise something like this to transmit Eddystone-UID:
0201060303aafe1516aafe00e72f234454f4911ba9ffa6000000000001
You end up advertising something like this:
0201060303aafe0316aafe
This leaves off the Eddystone-UID type code (00), the calibrated power (e7), the namespace identifier (2f234454f4911ba9ffa6) and the instance identifier (000000000001). As a result, it won't be recognized as an Eddystone-UID frame.

iBeacon, Is possible to get list of BLE devices?

I have bought 5 BLEs from sensor tag, I Downloaded some iBeacon detection code.
But I do not know UUID of the 5 BLEs. Do I Need to put the UUID in my iBeacon detection code?
How Can I get the bluetooth device list using iBeacon code?
While you can use CoreBluetooth to do an LE scan and see all nearby iBeacons, the info you get back about each iBeacon is not very useful -- iOS blocks you from being able to read the iBeacon identifiers, including the ProximityUUID. See My blog post about this here.
So the bottom line is that while you can see unknown Proximity UUID iBeacon devices with iOS, you cannot even be sure the devices you see are iBeacons at all.
Android and OSX Mavericks do not have this restriction, so if you have access to one of those devices, try my company's iBeacon Locate or ScanBeacon products, which will read your identifiers for you.
Is impossible, at lest no way to get this list via public API, you must know the UUIDs before ranging

How to post Advertisements from an IPhone Device which acts as iBeacon?

i want to know some details about iBeacons. Couple of days back i created a sample project where i turned my iOS Device into an iBeacon and i tracked down that iBeacon with another device, i am also getting the proximity distance between my Device and the beacon.
So my question is Is it possible to post some advertisements from my device which acting as iBeacon?
How to configure that?
All i wanted to know is how the iBeacon Configuration done to send the data?
Some one please help me out
thankYou
An iBeacon "advertisement" is just a constant transmission of a four part identifier that signifies a unique device. It only contains four fields:
proximityUUID (a 16 byte UUID usually expressed in the form 00000000-0000-0000-0000-000000000000)
major (a number from 0 to 65535)
minor (a number from 0 to 65535)
power (a number from 127 to -128)
That's it. You can't make an iBeacon send any more data than that. It doesn't matter if the device acting as an iBeacon is your phone, an iPad, a Mac computer, or a small battery-powered unit.
If you want to tie other data to an iBeacon, you have to do it through another channel, by some kind of lookup that matches the data up with the identifiers above. You can do this with a static lookup table in your app, a web service, or a CoreBluetooth communication channel. But you have to code that yourself.

Is there a way to read data from a Non-Apple Bluetooth Device with the iPhone?

I really searched on this topic for a while now. Especially when iOS 3 was the latest software version on the iPhone.
I wonder if there is a possibility to connect the iPhone to an external device via Bluetooth using the SDK and retrieve measured data?
Thanks for your help!
Greeting!
mary
If the Bluetooth device can masquerade as a Bluetooth keyboard, then it can send data to an iOS device encoded as keystrokes.
If the Bluetooth device is or can masquerade as a headset, then it might be able to send data encoded by an audio modulation scheme, such as FSK. A matching modem/codec will need to be running in the iOS app.
For the newest iOS devices (4S) you can use the new Bluetooth LE protocol to send data (older Bluetooth data communication protocols are not available to apps unless you are in Apple's NDA MFi program).
You have to look into the MFi Program by apple since you want your devices communicating. It provides support on using an external accessory with your iPhone, though you have to register/pay for it.

Bluetooth on iOS

What are the limitations of the Bluetooth on iOS? Can I program a Bluetooth in a way it makes the discovery procedure to find neighbor devices, selects a device from list, pair with it and starts over sockets exchanging some data (e.g. for peer2peer game? Is that possible?
All hardware that can communicate with iOS devices using Bluetooh must comply with the MFI (made for iPhone) program. It requires the vendor to use certain kinds of hardware and require a device certification. The program is under a strict NDA.
It basically means that you can only make a connection between iOS devices or devices with the MFI label and not just connect to a another cellphone -unless your iOS device is Jailbroken of course.
yes it is possible. BTW only iOS devices are supported.
Take a look at GameKit framework in the documentation.