gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 03:31:38 27 4
gpt4 key购买 nike

我正在创建一个应该连接到自定义 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com