Dav*_*vid 5 iphone bluetooth objective-c ios ios7
我是这个社区的新人.我需要帮助解决Objective-C中的蓝牙问题.我想发现所有可用的蓝牙设备并获取有关现有连接的信息.(不是扫描外围设备!)这在iOS中是否可行?例如,设置>蓝牙中的列表!
是和不是。这取决于您的设置。
\n\n不,使用公共 API 是不可能实现这一点的。
\n\n是的,这在技术上是可行的BluetoothManager.framework。我的演示项目BeeTee \xc2\xb9 展示了如何封装底层部分。
然而,根据AppStore 指南 \xc2\xa72.5关于私有(未记录)功能的内容,不可能使用BeeTee和BluetoothManager.frameworkAppStore 发布应用程序。
如果您决定使用 BeeTee 框架,您可以轻松列出范围内的所有蓝牙设备:
\n\nclass Demo: BeeTeeDelegate {\n let beeTee = BeeTee()\n\n init() {\n beeTee.delegate = self\n beeTee.enableBluetooth()\n beeTee.startScanForDevices()\n }\n\n func receivedBeeTeeNotification(notification: BeeTeeNotification) {\n switch notification {\n case .DeviceDiscovered:\n for device in beeTee.availableDevices {\n print(device)\n }\n default:\n print(notification)\n }\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n如果您使用的是 iOS 11,请同时考虑拉取请求 #16。不幸的是,我现在太忙了,无法合并这个拉取请求。
\n\n\xc2\xb9 我是BeeTee的作者。:-)
\n