2014-12-03 72 views
5

我正在開發一個iBeacon項目,我希望將文本信息與iBeacon數據一起發送。我現在使用iPhone作爲iBeacon。我無法找到一種方法來定製數據傳輸以及使用CoreLocation進行接收。在iBeacon中發送更多數據

如果發送者和接收者都是藍牙模式,我可以做到這一點。我經歷了類似的問題(Question,Question2),這些與我想要的不同。

+0

你正在使用哪家公司的信標? – 2014-12-03 06:16:31

+0

如果固件傳輸這些數據,我是否可以讀取附加數據? – krishnanunni 2014-12-03 10:07:10

+0

他們會爲您提供自己的sdk來訪問該數據。一些其他信標提供者提供這些信息。 – 2014-12-03 10:10:30

回答

3

你不能單獨使用iBeacon來做到這一點。您將需要您的設備充當iBeacon和BLE外設。一旦進入信標區域,您將需要使用Core Bluetooth啓動與BLE外設的連接,以便讀取附加特性。

+0

謝謝@ Paulw11。這將幫助我實現我想要的。 – krishnanunni 2014-12-03 10:02:46

+0

這是正確的。有兩個原因,您不能將額外字段添加到iBeacon廣告並閱讀iOS上的字段:1. BLE廣告的長度有限,而iBeacon格式只會在添加最大長度之前減慢一個額外字節的添加。 2. CoreLocation和CoreBluetooth不允許您讀取iBeacon廣告的原始字節。 – davidgyoung 2014-12-03 11:07:41

+0

我會將信標標識符(uuid/major/minor)作爲單獨的GATT特性公開,以便在通過CoreBluetooth連接時識別每個信標。 – davidgyoung 2014-12-03 12:31:30

0

我已經在jaalee beacon上工作,它的工作方式也像推送通知一樣。

//start Monitoring for beacon 

locationManager:(JLEBeaconManager *)manager didStartMonitoringForRegion:(JLEBeaconRegion *)region 
{ 

    [manager requestStateForRegion:region]; 
    [beaconManager startRangingBeaconsInRegion:region]; 
} 

//Enter method 

beaconManager:(JLEBeaconManager *)manager didEnterRegion:(JLEBeaconRegion *)region 

//Exit method 

beaconManager:(JLEBeaconManager *)manager didExitRegion:(JLEBeaconRegion *)region