mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Unpublish existing L2CAP channel before starting a new server.
PiperOrigin-RevId: 881707142
This commit is contained in:
committed by
Copybara-Service
parent
e7da55b383
commit
a2249dc07a
@@ -86,6 +86,10 @@ static char *const kGNCBLEL2CAPServerQueueLabel = "com.google.nearby.GNCBLEL2CAP
|
||||
_peripheralManager.peripheralDelegate = self;
|
||||
}
|
||||
|
||||
if (_PSM > 0) {
|
||||
GNCLoggerInfo((@"[NEARBY] Unpublish L2CAP channel with PSM: %@"), @(_PSM));
|
||||
[_peripheralManager unpublishL2CAPChannel:_PSM];
|
||||
}
|
||||
if (_peripheralManager.state == CBManagerStatePoweredOn) {
|
||||
// Bluetooth link is already encrypted, however encryption is not required here to avoid getting
|
||||
// insufficient authentication errors due to initialization order.
|
||||
|
||||
Reference in New Issue
Block a user