星期一, 6月 09, 2014

[iOS] ibeacon 試玩

本文記錄一些ibeacon的筆記


beacon的種類

  • beacon的device
  • 讓電腦透過beacon USB變成一個beacon
  • iphone可透過iOS內的程式模擬成一個beacon裝置

支援的裝置

目前發現自已的iphone4 完全不能動
iphone 5 以上搭配iOS7都能工作正常

如何偵測ibeacons

必需於APP內指定裝置的UUID才能掃描此區域內的所有含此UUID裝置,
基本上跟廠商採買的beacons裝置都會有一致的UUID,只差在Major/Minor版號不同。
可以透過這UUID與這二個號碼識為一個Region識別的識別碼

http://stackoverflow.com/questions/18784285/search-for-all-ibeacons-and-not-just-with-specific-uuid



An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID. After you find one or more with a specific UUID, you can figure out which is closest using the delegate callbacks, where the beacons are stored in an array ordered by distance.

***

iBeacons are higher-level constructs than regular BLE peripherals. From what can be determined from the Apple docs, beacons are tied to their service UUID. i.e., a family of beacons is a "region" and a you go into and out of a region based on the range and visibility of a beacon to YOU, not the other way around. Unfortunately Apple has used the term region, which most of us probably associate with MapKit, so this is adding to the general confusion

Here's the bad news: You can only scan for ProximityUUIDs that you know, there is no "wildcard" proximityUUID. Additionally, CLBeacons don't expose the much in the way of lower level CoreBluetooth guts so if you want to find all beacons that happen to be near you, you'll have to use CoreBluetooth, scan for peripherals, then look though the returned peripheries and query each one them to find beacons. Of course Apple has neither registered (with the Bluetooth SIG) or (yet) published the iBeacon characteristics so, you'll need a BT sniffer to reverse engineer what constitutes an iBeacon from any other BLE device.

Android是否相容

Android 4.3支援ibeacon

目前蠻多人用的ibeacon函式庫
http://developer.radiusnetworks.com/ibeacon/android/index.html

實作

  • Monitoring - this refers to a low-power region-monitoring, you get didEnterRegion: and didExitRegion: delegate messages
  • Ranging - this means a higher-power activity where you get the signal strength from individual iBeacons and can estimate distance to them from this

參考資料
http://joris.kluivers.nl/blog/2013/09/27/playing-with-ibeacon/
https://github.com/nicktoumpelis/HiBeacons
http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/
http://www.appcoda.com/ios7-programming-ibeacons-tutorial/
http://developer.radiusnetworks.com/2013/11/13/ibeacon-monitoring-in-the-background-and-foreground.html
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW1
http://www.cocoanetics.com/2013/11/can-you-smell-the-ibeacon/

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails