iOS BLE蓝牙 – 发送/接收HEX数据

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

iOS中是否有任何方式发送/接收自定义HEX数据,除了使用服务&特点?

解决方法

不,这是不可能的,但其原因不是iOS,而是“服务”和“特征”只是BLE协议定义的一部分.

官方规格:
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.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...