Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

swift - Is there any way access manufacturer data from iOS device

Maybe this question duplicate but my situation is different from others. I have a own bluetooth kit. It puts manufacturer spesific data when click button on kit. I'm getting manufacturer data from android. But I cannot access from ios app.

I listen advertising data as below :

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {

        for (key,value) in advertisementData{
            print("key:(key) value:(value)")     
           }

 }

And log result :

key:kCBAdvDataIsConnectable value:1
key:kCBAdvDataServiceUUIDs value:(1802)
key:kCBAdvDataLocalName value: R009

By the way, I tried CoreLocation api for seeing my ble devices.

func startScanBeacons() {
    let uuid = UUID(uuidString: "b9407f30-f5f8-466e-aff9-25556b57fe6d")!
    let beaconRegion =   CLBeaconRegion(proximityUUID: uuid, identifier: "mybeacon")
    beaconRegion.notifyOnEntry = true
    beaconRegion.notifyOnExit = true
    locationManager.startMonitoring(for:beaconRegion)
    locationManager.startRangingBeacons(in: beaconRegion)
}

But it didn't work. My device doesn't show as beacon. After some research on stackoverlow, some people say : this is not possible. You can look at this answer : https://stackoverflow.com/a/46373130/3170065. But there must be a workaround getting manufacturer data. What should I do to overcome this problem ? We can customize ble firmware.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...