core-bluetooth

Is it possible to create a Bluetooth Mesh Network with iOS and Android devices

拟墨画扇 提交于 2020-02-05 06:12:32
问题 I'm currently building an app that creates a platform where users can share information on a network but I wanted to create an offline option where users could still communicate on a peer-to-peer network when in close proximity. Is it possible to create a BT mesh network with smart phones? I've seen that Bluetooth has the option to create mesh networks using BLE but after looking into CoreBluetooth I haven't been able to find anything that would support this type of network. I've see some

Registering Bluetooth BR/EDR (Classic) connection in iOS13

蓝咒 提交于 2020-01-25 06:59:44
问题 From iOS 13 it should be possibile to register for connection events of BR/EDR Bluetooth (Classic) devices. I have followed the instructions provided in the WWDC keynote, in particular I init my CBCentralManager in this way: func initCentralManager() { if self.centralManager == nil{ self.centralManager = CBCentralManager.init(delegate: self, queue: nil, options:[CBCentralManagerOptionRestoreIdentifierKey:"myCentralManagerIdentifier"]); if #available(iOS 13.0, *) { let matchingOptions =

init CBCentralManager: Type of expression is ambiguous without more context

我与影子孤独终老i 提交于 2020-01-24 14:37:26
问题 Trying to initialize a CBCentralManager in a Swift 4.2 project. Get the error shown in comment: import CoreBluetooth class SomeClass: NSObject, CBCentralManagerDelegate { // Type of expression is ambiguous without more context let manager: CBCentralManager = CBCentralManager(delegate: self, queue: nil) // MARK: - Functions: CBCentralManagerDelegate func centralManagerDidUpdateState(_ central: CBCentralManager) { } } If I switch self out for nil the error goes away, so I think I'm missing

didDiscoverPeripheral is not called

独自空忆成欢 提交于 2020-01-23 02:38:31
问题 I'm connecting to a Bluetooth device. However, the didDiscoverPeripheral delegate method is never called. I'm scanning for the device with the UUID. This is straight from the TemperatureSensor example code. [centralManager scanForPeripheralsWithServices:uuidArray options:options]; Oddly enough, if I comment out this method, retrieveConnectedPeripherals finds the device just fine. I'm calling retrieveConnectedPeripherals when the device is powered on. Only when didRetrieveConnectedPeripherals

Trying to understand L2CAP channel

点点圈 提交于 2020-01-16 08:49:07
问题 Now facing some challenges using CoreBlueTooth L2CAP channel . In order to better understand how things work. I have taken the L2CapDemo (master) (https://github.com/paulw11/L2CapDemo) from GitHub and tried to experiment with it. Here is what I have done, along with one question. In have replaced the sendTextTapped function, with this one : @IBAction func sendTextTapped(_ sender: UIButton) { guard let ostream = self.channel?.outputStream else { return } var lngStr = "1234567890" for _ in 1..

how can scan bluetooth devices using core bluetooth sdk?

痴心易碎 提交于 2020-01-14 04:06:50
问题 I'm currently creating an iPhone app (Xcode 6.2, IOS 8.2) that could use Bluetooth devices! Main goal of this application is only search the available bluetooth devices and whenever you go to out of range from bluetooth devices one alert message pop up.and when ever you come in range automatically connected. The only solution I see here (to keep my app on AppStore) is to try scan for available bluetooth devices! I tried to use CoreBluetooth framework, but I don't get list of available devices

how can scan bluetooth devices using core bluetooth sdk?

无人久伴 提交于 2020-01-14 04:06:19
问题 I'm currently creating an iPhone app (Xcode 6.2, IOS 8.2) that could use Bluetooth devices! Main goal of this application is only search the available bluetooth devices and whenever you go to out of range from bluetooth devices one alert message pop up.and when ever you come in range automatically connected. The only solution I see here (to keep my app on AppStore) is to try scan for available bluetooth devices! I tried to use CoreBluetooth framework, but I don't get list of available devices

iOS 7 Bluetooth - app that handles events in background even after phone restart

强颜欢笑 提交于 2020-01-13 03:15:28
问题 I want to write a tracking application, which reacts/record when users get in a car and phone automatically pair with Bluetooth hands free. I need also Id of the hands free device. On Android it is easy, using Broadcast Receiver your app listen to broadcasts that device had been paired with phone. It is working even after phone had been restarted and App did not run after restart. Is it possible on iOS(7+) ? 回答1: You can do it by reading the "Performing Long-Term Actions in the Background"

iPhone does not discover Services on a Bluetooth LE tag on reconnection

こ雲淡風輕ζ 提交于 2020-01-12 07:14:11
问题 I am working on a Bluetooth LE application for iOS. I am using the Core Bluetooth framework within iOS to handle all communications. Question & Description: When I use a single tag, despite numerous connections and disconnections, the single tag connects seamlessly and the phone discovers it services. Also, when multiple Bluetooth LE tags connect for the first time, they connect seamlessly and the phone discovers their services. When the tags get disconnected and then reconnect to the phone,

iOS 8.0 bluetooth peripheral manager giving no callback for addService

↘锁芯ラ 提交于 2020-01-11 09:52:07
问题 I have created a bluetooth peripheral manager. I am adding some services to this peripheral manager using [self.peripheralManager addService:myService]. For iOS7.0 I am getting a callback for this method - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error But for iOS8.0 I am not getting any callback for the same method and I am not able to establish a connection. Here are the steps that I followed: Create a peripheral manager