iOS蓝牙相关
2017-01-20 本文已影响33人
4164fccdcf1c
CoreBluetooth1 初识
CoreBluetooth2 作为 Central 时的数据读写
CoreBluetooth3 作为 Central 时的数据读写(补充)
CoreBluetooth4 作为 Central 时的数据读写(最佳实践)
CoreBluetooth5 作为 Central 时的数据读写(OTA 固件升级与文件传输)
CoreBluetooth6 作为 Peripheral 时的请求响应
CoreBluetooth7 作为 Peripheral 时的请求响应(最佳实践)
CoreBluetooth8 后台运行蓝牙服务
蓝牙写数据权限问题
根据蓝牙writeCharacteristic.properties判断,CBCharacteristicWriteWithoutResponse
还是CBCharacteristicWriteWithResponse
[_peripheral writeValue:data forCharacteristic:_writeCharacteristic type:CBCharacteristicWriteWithoutResponse];
[_peripheral writeValue:data forCharacteristic:_writeCharacteristic type:CBCharacteristicWriteWithResponse];
CBCharacteristicWriteWithResponse
会响应CBPeripheral
的代理方法
/*!
* @method peripheral:didUpdateValueForCharacteristic:error:
*
* @param peripheral The peripheral providing this information.
* @param characteristic A <code>CBCharacteristic</code> object.
* @param error If an error occurred, the cause of the failure.
*
* @discussion This method is invoked after a @link readValueForCharacteristic: @/link call, or upon receipt of a notification/indication.
*/
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error;


iOS Bluetooth 打印小票(一)
iOS Bluetooth 打印小票(二)
iOS如何完成蓝牙打印机功能
蓝牙RSSI计算距离
获取蓝牙外设Mac地址