Posts

Post not yet marked as solved
2 Replies
1.8k Views
Hello,Is there a way to unpair a Bluetooth accessory programmatically instead done by the user to manually "forget" it in Bluetooth Settings? I am using the Core Bluetooth framework.If not so, then how many Bluetooth devices can be there present in the list in Bluetooth Settings?I would really appreciate if someone can help me here.Thanks,Marc.
Posted
by marc12.
Last updated
.
Post not yet marked as solved
14 Replies
9.6k Views
Hi,When I try to save the information provided by the user on the Settings view and come back to the settings again it does not load the previous stored information. This is how I am saving:After entering all the fields and pressing the "submit" button, I save the information using User Defaults:let advancedSettingArray = [self.custCodeTextField.text, self.pcsAddrTextField.text]UserDefaults.standard.set(advancedSettingArray, forKey: "ArrayKey")UserDefaults.standard.synchronize()When I navigate back to the Settings page, I use the following code in ViewDidLoad() :let defaults = UserDefaults.standardif let myArray = defaults.object(forKey: "ArrayKey") as? [String] { print(myArray)}It does not work, somehow. Can someone please tell what I am doing wrong.Thanks,Marc.
Posted
by marc12.
Last updated
.
Post not yet marked as solved
4 Replies
3.7k Views
Hello,I am working on an application where there is an option of "Change Peripheral Device", which discoonects with the respective peripheral and gives the user to choose a new peripheral device from the list and connect. In this case value from characterstic are read more than once, which slows down the ability to perform any operation.Also, peripheral randomly disconnects with an error message:Optional(Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo={NSLocalizedDescription=The connection has timed out unexpectedly.})I have done a thorough research on the same, but haven't found any adaptive solution to mitigate the issue. Nonetheless, I have looked at the harware specifications from Apple for peripheral device and it meets the requirements.Any help will be benificial at this point. I have tried my best.Using Core Bluetooth API. Followed this tutorial :https://www.raywenderlich.com/231-core-bluetooth-tutorial-for-ios-heart-rate-monitorAlso made Bluetooth as a Singleton class.
Posted
by marc12.
Last updated
.