aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-25 04:06:18 +0200
committerSven Gothel <[email protected]>2020-09-25 04:06:18 +0200
commitcba57aba1f1739f0ca308bf49e9d86c357a27834 (patch)
tree15a26e5d04c0197aa2f1cbe4a9bb07d0c5680781 /api
parent8e8fb67e048db165d5b30720192d4caa82032487 (diff)
DBTDevice, GATTHandler, ..: Ensure take-down (dtor, disconnect, remove*) code path is fully noexcept.
Note that the default dtor is noexcept by specification since C++11. GATTService and childs were marked noexcept earlier.
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTAdapter.hpp4
-rw-r--r--api/direct_bt/DBTDevice.hpp14
-rw-r--r--api/direct_bt/GATTHandler.hpp8
3 files changed, 13 insertions, 13 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp
index 4d211c4d..f0d34744 100644
--- a/api/direct_bt/DBTAdapter.hpp
+++ b/api/direct_bt/DBTAdapter.hpp
@@ -216,7 +216,7 @@ namespace direct_bt {
bool addDiscoveredDevice(std::shared_ptr<DBTDevice> const &device) noexcept;
bool removeDiscoveredDevice(const DBTDevice & device) noexcept;
- void removeDevice(DBTDevice & device);
+ void removeDevice(DBTDevice & device) noexcept;
bool addSharedDevice(std::shared_ptr<DBTDevice> const &device) noexcept;
std::shared_ptr<DBTDevice> getSharedDevice(const DBTDevice & device) noexcept;
@@ -232,7 +232,7 @@ namespace direct_bt {
bool mgmtEvDeviceDiscoveringHCI(std::shared_ptr<MgmtEvent> e);
bool mgmtEvDeviceConnectedHCI(std::shared_ptr<MgmtEvent> e);
bool mgmtEvConnectFailedHCI(std::shared_ptr<MgmtEvent> e);
- bool mgmtEvDeviceDisconnectedHCI(std::shared_ptr<MgmtEvent> e);
+ bool mgmtEvDeviceDisconnectedHCI(std::shared_ptr<MgmtEvent> e) noexcept;
void startDiscoveryBackground();
void checkDiscoveryState();
diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp
index 0b940fc3..807e4cc2 100644
--- a/api/direct_bt/DBTDevice.hpp
+++ b/api/direct_bt/DBTDevice.hpp
@@ -87,8 +87,8 @@ namespace direct_bt {
EIRDataType update(EInfoReport const & data) noexcept;
EIRDataType update(GattGenericAccessSvc const &data, const uint64_t timestamp) noexcept;
- void notifyDisconnected();
- void notifyConnected(const uint16_t handle);
+ void notifyDisconnected() noexcept;
+ void notifyConnected(const uint16_t handle) noexcept;
void disconnectGATT() noexcept;
@@ -389,7 +389,7 @@ namespace direct_bt {
* in use by another thread due to discovery post disconnect!
* </p>
*/
- void remove();
+ void remove() noexcept;
/**
* Returns a newly established GATT connection or an already open GATT connection.
@@ -404,7 +404,7 @@ namespace direct_bt {
std::shared_ptr<GATTHandler> connectGATT();
/** Returns already opened GATTHandler or nullptr, see connectGATT(), getGATTServices() and disconnect(). */
- std::shared_ptr<GATTHandler> getGATTHandler();
+ std::shared_ptr<GATTHandler> getGATTHandler() noexcept;
/**
* Returns a list of shared GATTService available on this device if successful,
@@ -473,7 +473,7 @@ namespace direct_bt {
* @param listener A {@link GATTCharacteristicListener} instance
* @return true if the given listener is an element of the list and has been removed, otherwise false.
*/
- bool removeCharacteristicListener(std::shared_ptr<GATTCharacteristicListener> l);
+ bool removeCharacteristicListener(std::shared_ptr<GATTCharacteristicListener> l) noexcept;
/**
* Remove all {@link GATTCharacteristicListener} from the list, which are associated to the given {@link GATTCharacteristic}.
@@ -484,13 +484,13 @@ namespace direct_bt {
* @param associatedCharacteristic the match criteria to remove any GATTCharacteristicListener from the list
* @return number of removed listener.
*/
- int removeAllAssociatedCharacteristicListener(std::shared_ptr<GATTCharacteristic> associatedCharacteristic);
+ int removeAllAssociatedCharacteristicListener(std::shared_ptr<GATTCharacteristic> associatedCharacteristic) noexcept;
/**
* Remove all {@link GATTCharacteristicListener} from the list.
* @return number of removed listener.
*/
- int removeAllCharacteristicListener();
+ int removeAllCharacteristicListener() noexcept;
};
inline bool operator<(const DBTDevice& lhs, const DBTDevice& rhs) noexcept
diff --git a/api/direct_bt/GATTHandler.hpp b/api/direct_bt/GATTHandler.hpp
index 87412f7b..913355c0 100644
--- a/api/direct_bt/GATTHandler.hpp
+++ b/api/direct_bt/GATTHandler.hpp
@@ -445,7 +445,7 @@ namespace direct_bt {
* otherwise false.
* </p>
*/
- bool removeCharacteristicListener(std::shared_ptr<GATTCharacteristicListener> l);
+ bool removeCharacteristicListener(std::shared_ptr<GATTCharacteristicListener> l) noexcept;
/**
* Remove the given listener from the list.
@@ -454,7 +454,7 @@ namespace direct_bt {
* otherwise false.
* </p>
*/
- bool removeCharacteristicListener(const GATTCharacteristicListener * l);
+ bool removeCharacteristicListener(const GATTCharacteristicListener * l) noexcept;
/**
@@ -466,9 +466,9 @@ namespace direct_bt {
* @param associatedCharacteristic the match criteria to remove any GATTCharacteristicListener from the list
* @return number of removed listener.
*/
- int removeAllAssociatedCharacteristicListener(std::shared_ptr<GATTCharacteristic> associatedCharacteristic);
+ int removeAllAssociatedCharacteristicListener(std::shared_ptr<GATTCharacteristic> associatedCharacteristic) noexcept;
- int removeAllAssociatedCharacteristicListener(const GATTCharacteristic * associatedCharacteristic);
+ int removeAllAssociatedCharacteristicListener(const GATTCharacteristic * associatedCharacteristic) noexcept;
/**
* Remove all event listener from the list.