简体   繁体   English

如何在iOS上搜索和连接附近的经典蓝牙设备(Not BLE)?

[英]How to search and connect nearby bluetooth device classic (Not BLE) on iOS?

I need to search nearby by bluetooth device those are classic Bluetooth (Bluetooth 2.1 or later). 我需要通过蓝牙设备在附近搜索那些经典的蓝牙(蓝牙2.1或更高版本)。 I searched a lot but there are only library and discussion about the BLE any guidance will help me a lot. 我进行了很多搜索,但只有图书馆和关于BLE的讨论,任何指南都对我有很大帮助。

As far as I know, you can't find them until you don't manually pair and connect them. 据我所知,除非不手动配对并连接它们,否则您将找不到它们。 In order to discover the already paired and connected ones, I use this: 为了发现已经配对和连接的对象,我使用以下方法:

import AVFoundation
func example() {
    let session = AVAudioSession.sharedInstance()
    do {
        try session.setCategory(AVAudioSessionCategoryPlayAndRecord, with: AVAudioSessionCategoryOptions.allowBluetooth)
        if let inputs = session.availableInputs { ... } //should contain bluetooth devices aswell
    }
    catch { print("Failed to set category") }
}

` `

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过 BLE(低功耗蓝牙)将 Android 设备连接到 iOS 设备 - How to connect Android device to an iOS device over BLE (Bluetooth Low Energy) 如何将iOS与BLE和蓝牙的早期版本连接 - How to connect iOS with BLE and previous versions of Bluetooth BLE(蓝牙启用设备)iOS - BLE(BlueTooth Enable device) ios 如何清除 iOS 中的 BLE 缓存,连接蓝牙设备 - How to clear BLE cache in iOS, connected Bluetooth device 如何使用iOS版BLE识别通过蓝牙找到的设备 - How to identify a device found via bluetooth using BLE for iOS 如何扫描并连接到 Xamarin forms 中 iOS 的蓝牙经典版? - How to scan and connect to Bluetooth classic for iOS in Xamarin forms? 通过CoreBluetooth成功进行BLE连接后,如何以编程方式连接经典蓝牙 - After Successful BLE connection via CoreBluetooth, how to connect classic Bluetooth programmatically ios核心蓝牙配对到外部BLE设备 - ios Core BlueTooth Pairing to External BLE Device iOS将WIFI设置传递给蓝牙(BLE)设备? - iOS passing WIFI settings to Bluetooth (BLE) device? 我们使用Xcode 4.5.2在IOS 6上开发蓝牙低功耗。 下载到IOS5设备的应用程序可以连接到BLE设备 - We develop Bluetooth Low Energy on IOS 6 with Xcode 4.5.2. The apps downloaded to a IOS5 device can connect to BLE device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM