简体   繁体   English

ios CoreBluetooth [警告]未知错误:1309

[英]ios CoreBluetooth[WARNING] Unknown error: 1309

当我正在开发运行BlueTooth应用程序时,我偶尔会在控制台上收到消息“CoreBluetooth [WARNING] Unknown error:1309”。即使消息声明它是一个警告,它也会停止执行应用程序。我已经能够通过关闭蓝牙设置然后重新打开来解决这个问题。任何人都可以告诉我是什么导致这个以及我应该做些什么来避免它?

That's a known issue, It's caused due to deadlock in CoreBluetooth (Apple's bug), 1309 error is mostly appears when your app operates as a Central and Peripheral, and when the operations are overlapping each other, in that case deadlock will be produced (which can be resolved by rebooting device). 这是一个已知的问题,它是由于CoreBluetooth(Apple的bug)中的死锁引起的,1309错误主要出现在你的应用程序作为中心和外围设备运行时,并且当操作相互重叠时,在这种情况下将产生死锁(其中可以通过重启设备来解决)。

Seems BLE stack gets corrupted in some other cases too (iOS 7 and lower), on iOS 7.1 stack is much more stable, and doesn't have issues like this. 似乎BLE堆栈在其他一些情况下也会被破坏(iOS 7及更低版本),在iOS 7.1堆栈上更稳定,并且没有这样的问题。
How we resolve issues like this? 我们如何解决这样的问题?
Showing troubleshoot screen where user can fix problem himself/herself. 显示用户可以自行解决问题的故障排除屏幕。

You can find known iOS issues here http://help.getpebble.com/customer/portal/articles/957568-troubleshooting#Pair 你可以在这里找到已知的iOS问题http://help.getpebble.com/customer/portal/articles/957568-troubleshooting#Pair

Anyway I think you can start using https://github.com/l0gg3r/LGBluetooth which will reduce chance having bugs on your side, and make your job much more effective. 无论如何,我认为你可以开始使用https://github.com/l0gg3r/LGBluetooth ,这将减少你身边的错误,并使你的工作更有效。
Here are read/write examples 这是读/写示例

Read

[LGUtils readDataFromCharactUUID:@"f045"
                     serviceUUID:@"5ec0"
                      peripheral:peripheral
                      completion:^(NSData *data, NSError *error) {
                          NSLog(@"Data : %s Error : %@", (char *)[data bytes], error);
                      }];

Write

int8_t dataToWrite = 0xFF;
[LGUtils writeData:[NSData dataWithBytes:&dataToWrite length:sizeof(dataToWrite)]
       charactUUID:@"cef9"
       serviceUUID:@"5ec0"
        peripheral:peripheral 
        completion:^(NSError *error) {
            NSLog(@"Error : %@", error);
        }];

Since the CoreBluetooth is issuing this “warning”, there has to be someone at Apple or in the Bluetooth community who wrote the code or at least knows what situation is triggering the message. 由于CoreBluetooth正在发出此“警告”,因此Apple或蓝牙社区必须有人编写代码或至少知道触发消息的情况。 Can anyone tell me what is causing this and what I should do to avoid it, or point me to some material that will help me in this endeavor? 任何人都可以告诉我是什么导致了这个以及我应该做些什么来避免它,或者指出一些能帮助我完成这项工作的材料?

If I had to hazard a guess, I'd say that the primary reason you haven't received much of a response is because you've given no description of your issue beyond “sometimes I see error 1309 and things stop working”. 如果我不得不冒险猜测,我会说你没有收到太多回复的主要原因是因为除了“有时我看到错误1309并且事情停止工作”之外你没有给出任何描述。

If you haven't already, please file a bug on bugreporter.apple.com and include as much detail as possible - a description of what you're trying to do, repro steps that lead to the issue, even a test app. 如果你还没有,请在bugreporter.apple.com上提交一个错误,并尽可能详细地说明 - 你要做的事情的描述,导致问题的重复步骤,甚至测试应用程序。 Respond to me directly with the bug number, and I will follow-up 直接用bug号码回复我,我会跟进

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM