iOS 蓝牙

本文详细介绍如何使用CBCentralManager和CBPeripheral进行蓝牙4.0设备的搜索、连接及数据交互,包括设置代理、发现服务、发送接收数据等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

首先导入框架 

#importCoreBluetooth/CoreBluetooth.h

我们需要一个管理者来管理蓝牙设备,CBCentralManager 

首先创建管理者 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#0088;box-sizing: border-box;">self</span>.manager = [[<span style="box-sizing: border-box;">CBCentralManager</span> alloc]<span style="color:#06666;box-sizing: border-box;">initWithDelegate:</span><span style="color:#0088;box-sizing: border-box;">self</span> <wbr></wbr></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#06666;box-sizing: border-box;">queue:</span>[<span style="box-sizing: border-box;">NSOperationQueue</span> mainQueue] <wbr></wbr></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#06666;box-sizing: border-box;">options:</span><span style="color:#0088;box-sizing: border-box;">nil</span>]; <span style="color:#0880;box-sizing: border-box;">//options</span>是筛选设备的条件</code>

创建完管理者后 会执行代理方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>centralManagerDidUpdateS<wbr>tate:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCentralManager</span> *)</span>central</wbr></span></code>

可以查看manager的一个属性 : state 来识别蓝牙的状态 ,该属性是一个枚举值CBCentralManagerState

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#0088;box-sizing: border-box;">typedef</span> NS_ENUM(<span style="color:#66066;box-sizing: border-box;">NSInteger</span>, CBCentralManagerState) {

CBCentralManagerStateUnk<wbr>nown = <span style="color:#06666;box-sizing: border-box;">0</span>,   <span style="color:#8800;box-sizing: border-box;">//初始的时候是未知的(刚刚创建的时候)</span>

CBCentralManagerStateRes<wbr>etting,     <span style="color:#8800;box-sizing: border-box;">//正在重置状态</span>

CBCentralManagerStateUns<wbr>upported,   <span style="color:#8800;box-sizing: border-box;">//设备不支持的状态</span>

CBCentralManagerStateUna<wbr>uthorized,  <span style="color:#8800;box-sizing: border-box;">//设备未授权状态</span>

CBCentralManagerStatePow<wbr>eredOff,    <span style="color:#8800;box-sizing: border-box;">//设备关闭状态</span>

CBCentralManagerStatePow<wbr>eredOn,     <span style="color:#8800;box-sizing: border-box;">//设备开启状态 -- 可用状态</span>

};</wbr></wbr></wbr></wbr></wbr></wbr></code>

如果是处于 CBCentralManagerStatePoweredOn 状态,就可以开始搜索设备

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">[<span style="color:#0088;box-sizing: border-box;">self</span>.manager <span style="color:#06666;box-sizing: border-box;">scanForPeripheralsWithSe<wbr>rvices:</wbr></span><span style="color:#0088;box-sizing: border-box;">nil</span> <span style="color:#06666;box-sizing: border-box;">options:</span><span style="color:#0088;box-sizing: border-box;">nil</span>];</code>

可以设置一个计时器 在一段时间后停止搜索,避免耗电

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"> <span style="color:#06666;box-sizing: border-box;">[self.manager stopScan]</span><span style="color:#8800;box-sizing: border-box;">;</span></code>

如果搜索到了设备,那么会调用代理方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>centralManager:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCentralManager</span> *)</span>central <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didDiscoverPeripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">advertisementData:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSDictionary</span><<span class="hljs-variable" style="box-sizing: border-box;">NSString</span> *,id> *)</span>advertisementData <wbr></wbr></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">RSSI:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSNumber</span> *)</span>RSSI</code>

其中 peripheral是搜索到的设备,advertisementData是关于设备的一些信息,RSSI是设备的信号强度

可以根据 advertisementData 里面的 kCBAdvDataServiceUUIDs 的值UUID来筛选某种设备 

搜索到设备后就可以进行连接了,蓝牙4.0支持一对多连接。

连接设备

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">[<span style="color:#0088;box-sizing: border-box;">self</span>.manager <span style="color:#06666;box-sizing: border-box;">connectPeripheral:</span>peripheral <span style="color:#06666;box-sizing: border-box;">options:</span><span style="color:#0088;box-sizing: border-box;">nil</span>];  </code>

连接成功后 会执行代理方法

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>centralManager:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCentralManager</span> *)</span>central <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didConnectPeripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral</span></code>

如果需要断开某个设备,则调用方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#06666;box-sizing: border-box;">[self.manager cancelPeripheralConnecti<wbr>on:peripheral]</wbr></span><span style="color:#8800;box-sizing: border-box;">;</span></code>

设备不管是自己断开还是手动断开,都会调用代理方法

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>centralManager:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCentralManager</span> *)</span>central <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didDisconnectPeripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral error:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSError</span> *)</span>error</span></code>

在这里可以判断一下,如果不是手动断开的连接,则可以再连接断开的设备,实现断开设备自动连接的功能

CBCentralManager就是用来做以上这些事情的,要给设备发送数据和接受数据 则要用到 CBPeripheral

首先设置设备的代理

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">peripheral.<span style="color:#0088;box-sizing: border-box;">delegate</span> = <span style="color:#0088;box-sizing: border-box;">self</span>;</code>

然后开始搜索设备服务 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#06666;box-sizing: border-box;">[peripheral discoverServices:nil]</span><span style="color:#8800;box-sizing: border-box;">;</span></code>

搜索成功后会执行代理方法

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>peripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didDiscoverServices:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSError</span> *)</span>error</span></code>

在这里 设备的 services属性里面就有设备服务的数据了,可以遍历这个数组来匹配到我们需要的服务,这个一般跟硬件厂商协商,这里我们假如需要UUID为FF00的服务

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">    <span style="color:#0088;box-sizing: border-box;">for</span>(CBService *s <span style="color:#0088;box-sizing: border-box;">in</span> peripheral.services){
        <span style="color:#0088;box-sizing: border-box;">if</span>([s.UUID isEqual:[CBUUID UUIDWithString:@<span style="color:#0880;box-sizing: border-box;">"FF00"</span>]]){
            [peripheral discoverCharachteristics<wbr>:nil <span style="color:#0088;box-sizing: border-box;">for</span>Service:s];
        }
    }</wbr></code>

如果成功匹配到服务,那么调用方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="color:#06666;box-sizing: border-box;">[peripheral discoverCharacteristics:nil forService:s]</span><span style="color:#8800;box-sizing: border-box;">;  </span></code>

成功后会执行代理方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>peripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didDiscoverCharacteristi<wbr>csForService:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBService</span> *)</span>service error:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSError</span> *)</span>error</wbr></span></code>

在这个方法里面,服务的属性 characteristics ,会是一组的CBCharacteristic,是服务的一些特征,在这里,我们假设发送数据需要用到特征的UUID为 FF02

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">for</span> (<span style="color:#66066;box-sizing: border-box;">CBCharacteristic</span> *c <span style="color:#0088;box-sizing: border-box;">in</span> service.characteristics){
        <span style="color:#0088;box-sizing: border-box;">if</span>([c.<span style="color:#66066;box-sizing: border-box;">UUID</span> isEqual:[<span style="color:#66066;box-sizing: border-box;">CBUUID</span> <span style="color:#66066;box-sizing: border-box;">UUIDWithString</span>:@<span style="color:#0880;box-sizing: border-box;">"FF02"</span>]]){
        <span style="color:#66066;box-sizing: border-box;">NSData</span> *<span style="box-sizing: border-box;"><span style="color:#0088;box-sizing: border-box;">data</span> = [self stringToHex:@"550504010101AA"];</span>
        [peripheral writeValue:<span style="box-sizing: border-box;"><span style="color:#0088;box-sizing: border-box;">data</span> <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">forCharacteristic:c <span style="color:#0088;box-sizing: border-box;">type</span>:<span style="color:#66066;box-sizing: border-box;">CBCharacteristicWriteWit<wbr>houtResponse</wbr></span>];</span>
    }
}</code>

发送的数据为 550504010101AA,我们将其转换为 NSData 类型 调用方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">[peripheral writeValue:<span style="box-sizing: border-box;"><span style="color:#0088;box-sizing: border-box;">data</span> <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">forCharacteristic:ctype:<span style="color:#66066;box-sizing: border-box;">CBCharacteristicWriteWit<wbr>houtResponse</wbr></span>]  //将数据发送给设备</span></code>

发送成功后会执行代理方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>peripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didWriteValueForCharacte<wbr>ristic:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCharacteristic</span> *)</span>characteristic error:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSError</span> *)</span>error</wbr></span></code>

如果是读取设备的数据 那么使用方法 

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;">[peripheral readValueForCharacterist<wbr>ic:c] </wbr></code>

读取数据后会执行代理方法

<code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">- <span style="color:#66066;box-sizing: border-box;">(void)</span>peripheral:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBPeripheral</span> *)</span>peripheral <wbr></wbr></span></code><code style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'source Code pro', monospace;font-size:undefined; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal; background-position: initial initial; background-repeat: initial initial;"><span style="box-sizing: border-box;">didUpdateValueForCharact<wbr>eristic:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">CBCharacteristic</span> *)</span>characteristic error:<span style="color:#66066;box-sizing: border-box;">(<span style="box-sizing: border-box;">NSError</span> *)</span>error</wbr></span></code>

完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值