Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用BLE发布我的数据,以便iOS设备正确拾取_Ios_Bluetooth Lowenergy - Fatal编程技术网

如何使用BLE发布我的数据,以便iOS设备正确拾取

如何使用BLE发布我的数据,以便iOS设备正确拾取,ios,bluetooth-lowenergy,Ios,Bluetooth Lowenergy,我正在处理以下情况: 我想使用BLE广告包,以便使用BLE传输一些数据。我没有使用特定的协议,我只是传输一个31字节的缓冲区,其结构如下: 0x05, 0x03, 0xXX, 0xXX, 0xXX, 0xXX,// Size 5 List of 16-BIT UUID, number of UUIDs:2 0x18, 0xFF, 0x59, 0x00, //Manufacturer data with length 24, using the Nordic manufacturer identi

我正在处理以下情况:

我想使用BLE广告包,以便使用BLE传输一些数据。我没有使用特定的协议,我只是传输一个31字节的缓冲区,其结构如下:

0x05, 0x03, 0xXX, 0xXX, 0xXX, 0xXX,// Size 5 List of 16-BIT UUID, number of UUIDs:2
0x18, 0xFF, 0x59, 0x00, //Manufacturer data with length 24, using the Nordic manufacturer identifier
剩下的11个字节中我要传输的数据

我正在寻找一种方法来构建我的包,使所有31个字节都可以从iOS应用程序中看到


(我不是在开发iOS应用程序,我只知道Android和iOS从BLE读取数据的方式不同。我的设置在Android上工作,但它没有在iOS中显示所有传输的数据)

iOS上没有广告包的原始字节。当调用
centralManager(uux0:didDiscover:advertisementData:rssi:)
时,数据将已经被解析。您的UUID应该在
CBAdvertisementDataServiceUUIDsKey
中可用,而制造数据(您的11个字节)应该在
CBAdvertisementDataManufacturerDataKey
中可用