One CBPeripheralManager instance serving multiple CBCentral instances causing disconnected.
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=TgOKk60cCvsh/Vx1DaRTTEgsO4D8glBM7P1iT9N+L+k=; b=VFWkSdRP9cs9abuYdx0TaeXYUaSdAPRfuF9ALNcODsrwKkKAc59Aq8tWmv7GP/IHf9 Gd1uq9C/ZvQHuyVKCTrIDKmAvXm68ry7GiNPy3l0I+zBCAZN82d36rssGWJLWT62UT+i 9pk6kQUuM21AKMDerEtaAh3P2FDRqAq7ziXewk7S528HlHUJbP8a21pqxlk/fNmTC7fM XWFNRi4RS7U7o2J/BdghD8XIw+mGv1Vckym5ehYVpaffJT4oses+VVjZliXntEVqDFqe 8OwUbxWR/lE3u7woPoivbtUXvoVeLJIEoKJVc2+vvOpCMWgwLGSyFQ5rDDSk9tMROpJb dFcw== Hi everyone, I have an app, which using CoreBluetooth and play both roles Central and Peripherals. This app get the information from an IoT device, and then forward it to other apps via notifying. - App1 has one CBCentralManager instance to connect to IoT device (peripheral) to get data. - App1 also has another CBPeripheralManager instance, to advertising and notifying the data it got from IoT device (via predefined ServiceUUID so App2 and App3 can scan). - App 2 and App 3 play as Central roles, having CBPeripheralManager to connect to App1, subscribe for notification from predefined characteristic. And getting data whenever App1 notify it. When App2 and App3 connect to App1, it causes the connection from App1 to IoT device resetting quite often. I saw centralManager:didDisconnectPeripheral:error: every 5-10minutes. The reason for IoT device disconnected to App1: default 16:31:51.032169 -0600 MyBLEApp Disconnected peripheral (error: Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo={NSLocalizedDescription=The connection has timed out unexpectedly.}) When App2 and App3 don't connect to App1, the connection between App1 and IoT device is pretty stable. I also posted question here with more logs, but no reply yet: https://forums.developer.apple.com/thread/116525 I thought so many data notifying caused this issue, but when I tried to remove all code sending/receiving data between App1, and App2/App3, just connect App2 and App3 to App1 (just call connectPeripheral:options:, stay connected), issue still happened. Is there any idea how that can be happened? Thank you! -- Best, Andy _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
BaThach Nguyen