Re: How to get the updated advertisementData (kCBAdvDataManufacturerData) value?
We use changing advertisement data just fine in our iOS app. Are you keeping a reference to the peripheral that is given to you? you should get a ton of logs. You need to keep a reference otherwise it discards that peripheral as per the docs in the header: * @discussion This method is invoked while scanning, upon the discovery of <i>peripheral</i> by <i>central</i>. A discovered peripheral must * be retained in order to use it; otherwise, it is assumed to not be of interest and will be cleaned up by the central manager. On Thu, Jan 15, 2015 at 6:33 PM, Hank Li <hank.h.li@gmail.com> wrote:
For my IOS app (on ios8), once it get the advertisementData, it will stay the same, even the data has been changed on the BLE device. How can I get the updated advertisementData in my ios app?
Here is the code, the startScan is called every 5 seconds.
func startScan() { let opts = [CBCentralManagerScanOptionAllowDuplicatesKey:true]; centralManager.scanForPeripheralsWithServices(nil, options:opts); }
func centralManager(central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData: [NSObject : AnyObject]!, RSSI: NSNumber!) { println("\(advertisementData)"); }
Here is the output, [kCBAdvDataLocalName: MyDevice001, kCBAdvDataIsConnectable: 1, kCBAdvDataManufacturerData: <11e467f7 7ec2ed>]
the output will never change. how to get the updated advertisementData value?
Thanks, Hank Li
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/christopher.cotton%40g...
This email sent to christopher.cotton@gmail.com
-- Christopher _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Christopher Cotton