ios - 核心蓝牙 : Send data between 2 iOS devices

标签 ios iphone swift xcode core-bluetooth

我使用 swift 编程已经有一段时间了,但我对 Core Bluetooth 完全陌生。有没有办法使用 Core Bluetooth 将原始数据(整数、字符)从一台 iOS 设备发送到另一台?

提前致谢

最佳答案

是的。 您需要制作一个外围设备和第二个中央设备(或两者)。 在外围设备中,您需要发布数据(peripheralManager.startAdvertising),而在中央设备中,您需要通过特性获取它。 您可以在 https://developer.apple.com/documentation/corebluetooth 中阅读所有相关内容

关于ios - 核心蓝牙 : Send data between 2 iOS devices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43427590/

相关文章:

ios - 对象属性的 Getter 需要返回 UnsafeMutablePointer<T>?

ios - 下次启动应用程序时,如何检查数据是否成功存储在 coredata 中? - iOS swift

iphone - 自定义 UITableViewCell 宽度在 tableview reloadData 上调整大小

ios - 自动调整大小的 tableView 高度错误

iphone - iOS 中如何管理内存

iphone - 如何从 Xcode 4 标记 Git 存储库

arrays - 如何制作包含当前月份和接下来月份的数组。?

ios - 无法从外部viewDidLoad访问Eureka表单对象

ios - 使用闭包作为按钮的 Action

ios - UIPopoverController 内容显得太大