iOS: Detect the beacon when the beacon is in sleep mode? - swift

I have read a few articles and all of them talk about detecting the beacon when you are in the range and you cannot see the beacon without knowing its UUID. CBCentralManagerDelegate only gives you the ability to detect the beacon when it is active. Is there any way to detect to beacon when it is in sleep mode but still broadcasting?

"Sleep mode" is not a standard concept when it comes to bluetooth beacons. Some beacon manufacturers have proprietary solutions that alter the behavior of their hardware beacons when they are motionless for a period of time. Typically, this makes such beacons stop advertising entirely until motion is again detected, and advertising resumes.
Three possibilities:
If a beacon hardware manufacturer has implemented a sleep mode as described above, it the beacon will not be advertising in sleep mode at all, and it is impossible to detect via any APIs on iOS.
If a beacon hardware manufacturer has implemented a sleep mode in another manner such that it still advertises the same packets (perhaps at a slower interval?) then it will be detectable using the same APIs as used to detect it when it is active.
If a beacon hardware manufacturer has implemented a sleep mode such that it advertises different packets in sleep mode, then different APIs may be needed to detect. But there is no way to know how to do this without documentation from the manufacturer.
Bottom line: you must consult the documentation provided by your beacon manufacturer to see how sleep mode was implemented (1-3 above) and know how to detect when it is in this mode.

Related

Using Beacon as a locating device in retail

how to detect beacon signal and do we need to make any app to manage it or any predefined app or site is available?
I want to know how Beacon works and which Beacon is suitable for retail.
You need a mobile phone with Bluetooth 4.0 to detect beacons. They emit a BLE signal which is a little different from the normal Bluetooth signal. There are many generic apps in the play store and maybe in the app store to detect them.
But if you are looking for real functionality related to that, then you'll be needing the retail store-specific mobile app so that it can show you relevant updates in the app.

Battery drain while transmitting Eddystone beacons

I am trying to use an Android device to transmit Eddystone beacons. I would like to know the approximate battery drain the device consumes to transmit beacons in the background.
Thanks.
Good news! The battery drain of transmitting as a beacon from a mobile phone is negligible. I did some tests on both Android and iOS to measure this drain, and found to my surprise that I couldn't even come up with a number. The drain was so small it was within the margin of error of the test setup.
The Android version of these tests happened to use the Android Beacon Library to transmit an AltBeacon frame, but I have seen similar results using the same library to transmit an Eddystone frame. And since the library simply wraps lower-level Android APIs, these numbers are applicable regardless of what API you are using to set up the transmission.
See this blog post for details.

How do I detect iBeacon device without knowind uuid in iOS?

I would like to develop app which detects a lot of beacon device withoud knowing uuid.
However I cannot find way to do this in internet.
I have to define uuid in code.
So is there way to detect iBeacon without knowing uuid?
I know CoreLocation requires you to know the UUID of the beacon you are CBCentralManager, which handles all of the bluetooth spectrum. It has methods for scanning for bluetooth devices. I don't have an iBeacon handy at the moment to test and see if it picks them up, but it is probably worth a try.
The nomenclature used is quite important here. If you want to detect 'iBeacon', then you need to at least know the UUID of the device or devices you're looking for. That's because, in the iBeacon standard, the ID is the only piece of information included in the advertising packet. iBeacon lets you do two things: monitoring and ranging (detecting whether there is an iBeacon in range, and detecting how close the iBeacon is), and both require you to know the UUID.
If you just want to look for beacons, without including the iBeacon properties and features, you can use Core Bluetooth to do that. SDKs of particular beacon vendors base their beacon maintenance features (firmware updates, settings changing) on that. This method is also used by vendors that use their own protocols alongside Apple's iBeacon. We do that at Estimote with Estimote Stickers, and AFAIK Gimbal does this as well.
Cheers.

Make a simple iphone app that can connect another bluetooth device

I know some basic about iOS programming, now i want to connect my app to another non iphone device e.g. connecting to a bluetooth device that can control a light bulb on and off, or control any furnitures.
My question is, besides iOS xcode, what kind of program i need to learn in order to achieve my goal?
Is there any sources that i can learn from it?
For Bluetooth Low Energy devices, you can use the CoreBluetooth framework to access them.
For Classic Bluetooth devices or accessories that make use of the Dock connector, the protocols are not open, and joining the Made for iPhone (MFi) program is required. I do not suggest this for beginning.
My suggestion is to buy for example a Polar Heart Rate Belt that supports Bluetooth Low Energy. These use standard protocols. Sample code is available from Apple that shows how to read out the heart rate from such a device.
As soon as you have mastered the heart rate monitor example, a next step would be to acquire a programmable Bluetooth Low Energy chip (however, often, the development tools for those are rather expensive!). Those chips can be programmed with custom profiles to listen for Bluetooth Low Energy connections and then performing defined operations (lighting a LED) when writes to characteristics occur. So, you are not limited to heart rate monitors and similar devices.
Keywords that you can search for: GATT protocol, Bluetooth Low Energy, CoreBluetooth.
I know that it's a steep learning curve for beginners, but the area is pretty new. However, I can assure you that it's a fun area.
I also think that you should look in to embedded C programming for the slave device (Heart Rate Monitor)
You could get a tod Smart Beacon Development kit for ~$150 and then use BGScript to code the firmware to control the BLE device from your phone or pc. todhq.com for more info.

Detect Bluetooth answer/end-call button on iPhone

Is it possible to detect and respond to the answer/end-call button presses from an HFP Bluetooth device on iOS? Has anyone seen this? Where should I look for answers? I understand one could get access to lower level bluetooth if you register for the device manufacturer (MFI) program but I'm hoping I don't have to dive this deep. I also know that you can respond to AVRCP commands but I am not wanting to use this option. Can anyone help?
UIResponder has a -remoteControlReceivedWithEvent: method that you can use to receive events from external devices, possibly including Bluetooth headsets. From the docs:
Remote-control events originate as commands from external accessories, including headsets. An application responds to these commands by controlling audio or video media presented to the user. The receiving responder object should examine the subtype of event to determine the intended command—for example, play (UIEventSubtypeRemoteControlPlay)—and then proceed accordingly.
To allow delivery of remote-control events, you must call the beginReceivingRemoteControlEvents method of UIApplication; to turn off delivery of remote-control events, call endReceivingRemoteControlEvents.
It’s not clear whether the answer/end button on a headset is considered equivalent to the play/pause button on, say, the earbuds’ remote, but this might be worth a try.
Sadly, there are no available bluetooth public APIs for developers, so no way to get that access in the conventional means.
As of my research, some person received some event from their bleu-tooth devices via "remoteControlReceivedWithEvent" but not all of them! Some are receiving none! And very few are receiving all of them!
I also tried Core Bluetooth but it only supports LEB (Low Energy Bluetooth devices)!
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothOverview/CoreBluetoothOverview.html#//apple_ref/doc/uid/TP40013257-CH2-SW1
Also, some posts suggest it is possible to use Classic bleutooth instead of "Low Energy":
How to use bluetooth classic instead of le
But it has limitation as well (the post is taking about "MFi accessory"! MFi is it for "made for iphone" ?!?!?!)
from the post above:
"A non-LE Bluetooth device needs to be MFi-approved to be used with the External Accessory framework (it needs to use a specific Apple chip and a proprietary communication protocol). You won't be able to build applications to access this device unless it either uses the more open Bluetooth LE or has this chip in it for standard Bluetooth. There might be ways to do this via jailbreak, but pretty much everyone I know has moved over to Bluetooth LE." !
more post: Connecting to a Bluetooth device from iOS, no MFi
Regards.