mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Add flag to control whether to disconnect the GATT client when exiting the BLE GATT service.
PiperOrigin-RevId: 758474539
This commit is contained in:
committed by
Copybara-Service
parent
30b32e52f2
commit
540f4bac7a
@@ -20,4 +20,7 @@
|
||||
/** Checks whether DCT is enabled in the Nearby Connections SDK. */
|
||||
@property(nonatomic, class, readonly) BOOL dctEnabled;
|
||||
|
||||
/** Checks whether GATT client disconnection is enabled in the Nearby Connections SDK. */
|
||||
@property(nonatomic, class, readonly) BOOL gattClientDisconnectionEnabled;
|
||||
|
||||
@end
|
||||
|
||||
@@ -24,4 +24,10 @@
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::kEnableDct);
|
||||
}
|
||||
|
||||
+ (BOOL)gattClientDisconnectionEnabled {
|
||||
return nearby::NearbyFlags::GetInstance().GetBoolFlag(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableGattClientDisconnection);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -133,9 +133,8 @@ void GattClient::Disconnect() {
|
||||
// not connect to the iOS device if the iOS device disconnects and then attempts to reconnect.
|
||||
// Because of this, we no-op here instead of calling `[gatt_client_ disconnect]`.
|
||||
// See: b/375176623
|
||||
if (GNCFeatureFlags.dctEnabled) {
|
||||
// Avoid to impact GTV functionality, put the disconnect for NC iOS SDK only, so thatGATT client
|
||||
// can reconnect to the GATT server.
|
||||
if (GNCFeatureFlags.gattClientDisconnectionEnabled) {
|
||||
// Avoid to impact GTV functionality, so that GATT client can reconnect to the GATT server.
|
||||
[gatt_client_ disconnect];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user