iOS 8.3似乎没有返回服务的所有特征

时间:2015-04-13 10:31:09

标签: ios core-bluetooth

在我的CBPeripheralDelegate中,我有以下方法

- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error {

    if (error) {
        DDLogError(@"Error discovering services: %@", [error localizedDescription]);
        return;
    }
    // Loop through the newly filled peripheral.services array, just in case there's more than one.
    for (CBService *service in peripheral.services) {
        NSArray *uids = @[[CBUUID UUIDWithString:kSendDataCharacteristicUUID],
                          [CBUUID UUIDWithString:kReceiveDataCharacteristicUUID]];
        [peripheral discoverCharacteristics:uids
                                 forService:service];
    }
}

- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error{
    // Deal with errors (if any)
    if (error) {
        DDLogError(@"Error discovering characteristics: %@", [error localizedDescription]);
        return;
    }

    // Again, we loop through the array, just in case.
    for (CBCharacteristic *characteristic in service.characteristics) {
        if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:kReceiveDataCharacteristicUUID]]) {
            _receiveCharacteristic = characteristic;
            [_peripheral setNotifyValue:YES
                      forCharacteristic:characteristic];
        }

        if ([characteristic.UUID isEqual:[CBUUID UUIDWithString:kSendDataCharacteristicUUID]]) {
            _sendCharacteristic = characteristic;
        }

    }

    if (_sendCharacteristic && _receiveCharacteristic) {
        [self allServicesDiscovered];
    }
}

但是,从ios 8.3开始,不再发现“kReceiveDataCharacteristicUUID”特性。

我已经使用外部BLE发现应用程序对此进行了验证,并给出了相同的结果。\

有没有办法手动添加未发现的服务?

编辑:这是我们工程师的硬件调试日志。看起来ios比以前开始的时间晚1点。

Android(注意ATT从0x0003开始) low level android comms log

iOS 8.3(注意ATT从0x0004开始) low level ios comms log

0 个答案:

没有答案