Share one notification session for all calls between Start/StopNotify

This commit is contained in:
Vibhav Pant
2023-09-11 18:38:48 +05:30
parent 2abd9f4d83
commit d7abb17751
2 changed files with 14 additions and 6 deletions
@@ -45,7 +45,8 @@ class GattCharacteristicServer final
public:
GattCharacteristicServer(const GattCharacteristicServer &) = delete;
GattCharacteristicServer(GattCharacteristicServer &&) = delete;
GattCharacteristicServer &operator=(const GattCharacteristicServer &) = delete;
GattCharacteristicServer &operator=(const GattCharacteristicServer &) =
delete;
GattCharacteristicServer &operator=(GattCharacteristicServer &&) = delete;
GattCharacteristicServer(
@@ -61,7 +62,8 @@ class GattCharacteristicServer final
characteristic_(characteristic),
service_object_path_(service_object_path),
notifying_(false),
confirmed_(false) {
confirmed_(false),
notify_sessions_(0) {
registerAdaptor();
NEARBY_LOGS(VERBOSE)
<< __func__ << "Creating a "
@@ -116,6 +118,8 @@ class GattCharacteristicServer final
absl::Mutex confirmed_mutex_;
bool confirmed_;
std::atomic_size_t notify_sessions_;
};
} // namespace bluez