iOS BLE 蓝牙 - 发送/接收十六进制数据

标签 ios bluetooth bluetooth-lowenergy

我正在创建一个应该连接到自定义 BLE 设备的 iOS 应用程序。我需要 iOS 应用程序发送 2 个 HEX 命令,一个用于启用设备的一部分,另一个用于请求数据。

除了使用服务和特征之外,iOS 中是否有任何方法可以发送/接收自定义 HEX 数据?

最佳答案

不,那不可能,但这不是 iOS 的原因,而是“服务”和“特性”只是 BLE 协议(protocol)定义方式的一部分。

官方规范: https://developer.bluetooth.org/TechnologyOverview/Pages/BLE.aspx

Generic Attribute Profile

The latest Bluetooth specification uses a service-based architecture based on the attribute protocol (ATT). All communication in low energy takes place over the Generic Attribute Profile (GATT). An application or another profile uses the GATT profile so a client and server can interact in a structured way.

The server contains a number of attributes, and the GATT Profile defines how to use the Attribute Protocol to discover, read, write and obtain indications. These features support a service-based architecture. The services are used as defined in the profile specifications. GATT enables you to expose service and characteristics defined in the profile specification.

关于iOS BLE 蓝牙 - 发送/接收十六进制数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30949165/

相关文章:

ios - 在 Swift 中找不到 Double 类型的初始值设定项

android - 相当于蓝牙 RSSI 的 WifiManager.calculateSignalLevel

Android ble,requestConnectionPriority 不工作

android - 无法从 RS232 蓝牙模块读取 InputStream

web - 从 Web 浏览器发送信标信号

iphone - 使用 Core Bluetooth 在后台获取蓝牙 LE 外设广告

ios - 如何使用GPUImage MotionDetection-swift获取移动物体的坐标

ios - UISearchBar iOS 13 语音听写按钮

ios - ReactNative 与现有应用程序集成而不是 RCT_EXPORT_METHOD 宏

ios - 蓝牙低功耗广告数据包和拓扑