aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTAdapter.hpp78
-rw-r--r--api/direct_bt/DBTDevice.hpp68
-rw-r--r--api/direct_bt/DBTManager.hpp8
3 files changed, 77 insertions, 77 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp
index f9803839..93f2b76c 100644
--- a/api/direct_bt/DBTAdapter.hpp
+++ b/api/direct_bt/DBTAdapter.hpp
@@ -161,9 +161,9 @@ namespace direct_bt {
{
private:
/** Returns index >= 0 if found, otherwise -1 */
- static int findDeviceIdx(std::vector<std::shared_ptr<DBTDevice>> & devices, EUI48 const & mac, const BDAddressType macType);
- static std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, EUI48 const & mac, const BDAddressType macType);
- std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, DBTDevice const & device);
+ static int findDeviceIdx(std::vector<std::shared_ptr<DBTDevice>> & devices, EUI48 const & mac, const BDAddressType macType) noexcept;
+ static std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, EUI48 const & mac, const BDAddressType macType) noexcept;
+ std::shared_ptr<DBTDevice> findDevice(std::vector<std::shared_ptr<DBTDevice>> & devices, DBTDevice const & device) noexcept;
const bool debug_event;
DBTManager& mgmt;
@@ -209,18 +209,18 @@ namespace direct_bt {
friend HCIStatusCode DBTDevice::connectBREDR(const uint16_t pkt_type, const uint16_t clock_offset, const uint8_t role_switch);
friend std::vector<std::shared_ptr<GATTService>> DBTDevice::getGATTServices();
- bool addConnectedDevice(const std::shared_ptr<DBTDevice> & device);
- bool removeConnectedDevice(const DBTDevice & device);
+ bool addConnectedDevice(const std::shared_ptr<DBTDevice> & device) noexcept;
+ bool removeConnectedDevice(const DBTDevice & device) noexcept;
int disconnectAllDevices(const HCIStatusCode reason=HCIStatusCode::REMOTE_USER_TERMINATED_CONNECTION );
- std::shared_ptr<DBTDevice> findConnectedDevice (EUI48 const & mac, const BDAddressType macType);
+ std::shared_ptr<DBTDevice> findConnectedDevice (EUI48 const & mac, const BDAddressType macType) noexcept;
- bool addDiscoveredDevice(std::shared_ptr<DBTDevice> const &device);
- bool removeDiscoveredDevice(const DBTDevice & device);
+ bool addDiscoveredDevice(std::shared_ptr<DBTDevice> const &device) noexcept;
+ bool removeDiscoveredDevice(const DBTDevice & device) noexcept;
- bool addSharedDevice(std::shared_ptr<DBTDevice> const &device);
- std::shared_ptr<DBTDevice> getSharedDevice(const DBTDevice & device);
- void removeSharedDevice(const DBTDevice & device);
- std::shared_ptr<DBTDevice> findSharedDevice (EUI48 const & mac, const BDAddressType macType);
+ bool addSharedDevice(std::shared_ptr<DBTDevice> const &device) noexcept;
+ std::shared_ptr<DBTDevice> getSharedDevice(const DBTDevice & device) noexcept;
+ void removeSharedDevice(const DBTDevice & device) noexcept;
+ std::shared_ptr<DBTDevice> findSharedDevice (EUI48 const & mac, const BDAddressType macType) noexcept;
bool mgmtEvDeviceDiscoveringMgmt(std::shared_ptr<MgmtEvent> e);
bool mgmtEvNewSettingsMgmt(std::shared_ptr<MgmtEvent> e);
@@ -244,27 +244,27 @@ namespace direct_bt {
/**
* Using the default adapter device
*/
- DBTAdapter();
+ DBTAdapter() noexcept;
/**
* @param[in] mac address
*/
- DBTAdapter(EUI48 &mac);
+ DBTAdapter(EUI48 &mac) noexcept;
/**
* @param[in] dev_id an already identified HCI device id
*/
- DBTAdapter(const int dev_id);
+ DBTAdapter(const int dev_id) noexcept;
/**
* Releases this instance after HCISession shutdown().
*/
- ~DBTAdapter();
+ ~DBTAdapter() noexcept;
- std::string get_java_class() const override {
+ std::string get_java_class() const noexcept override {
return java_class();
}
- static std::string java_class() {
+ static std::string java_class() noexcept {
return std::string(JAVA_DBT_PACKAGE "DBTAdapter");
}
@@ -277,12 +277,12 @@ namespace direct_bt {
}
}
- bool hasDevId() const { return 0 <= dev_id; }
+ bool hasDevId() const noexcept { return 0 <= dev_id; }
/**
* Returns true if the device is powered.
*/
- bool isPowered() {
+ bool isPowered() noexcept {
return isAdapterSettingSet(adapterInfo->getCurrentSetting(), AdapterSetting::POWERED);
}
@@ -293,18 +293,18 @@ namespace direct_bt {
return isPowered() && nullptr != getHCI(); // implies 'checkValidAdapter()'
}
- EUI48 const & getAddress() const { return adapterInfo->address; }
- std::string getAddressString() const { return adapterInfo->address.toString(); }
+ EUI48 const & getAddress() const noexcept { return adapterInfo->address; }
+ std::string getAddressString() const noexcept { return adapterInfo->address.toString(); }
/**
* Returns the system name.
*/
- std::string getName() const { return adapterInfo->getName(); }
+ std::string getName() const noexcept { return adapterInfo->getName(); }
/**
* Returns the short system name.
*/
- std::string getShortName() const { return adapterInfo->getShortName(); }
+ std::string getShortName() const noexcept { return adapterInfo->getShortName(); }
/**
* Returns the local friendly name and short_name. Contains empty strings if not set.
@@ -312,7 +312,7 @@ namespace direct_bt {
* The value is being updated via SET_LOCAL_NAME management event reply.
* </p>
*/
- const NameAndShortName & getLocalName() const { return localName; }
+ const NameAndShortName & getLocalName() const noexcept { return localName; }
/**
* Sets the local friendly name.
@@ -321,27 +321,27 @@ namespace direct_bt {
* The corresponding management event will be received separately.
* </p>
*/
- std::shared_ptr<NameAndShortName> setLocalName(const std::string &name, const std::string &short_name);
+ std::shared_ptr<NameAndShortName> setLocalName(const std::string &name, const std::string &short_name) noexcept;
/**
* Set the power state of the adapter.
*/
- void setPowered(bool value);
+ void setPowered(bool value) noexcept;
/**
* Set the discoverable state of the adapter.
*/
- void setDiscoverable(bool value);
+ void setDiscoverable(bool value) noexcept;
/**
* Set the bondable (aka pairable) state of the adapter.
*/
- void setBondable(bool value);
+ void setBondable(bool value) noexcept;
/**
* Returns a reference to the used singleton DBTManager instance.
*/
- DBTManager& getManager() const { return mgmt; }
+ DBTManager& getManager() const noexcept { return mgmt; }
/**
* Returns the already open or newly opened HCIHandler or {@code nullptr} if not available.
@@ -351,7 +351,7 @@ namespace direct_bt {
/**
* Returns true, if the adapter's device is already whitelisted.
*/
- bool isDeviceWhitelisted(const EUI48 &address);
+ bool isDeviceWhitelisted(const EUI48 &address) noexcept;
/**
* Add the given device to the adapter's autoconnect whitelist.
@@ -474,21 +474,21 @@ namespace direct_bt {
/**
* Returns the meta discovering state. It can be modified through startDiscovery(..) and stopDiscovery().
*/
- ScanType getDiscoveringScanType() const {
+ ScanType getDiscoveringScanType() const noexcept {
return currentMetaScanType;
}
/**
* Returns the adapter's native discovering state. It can be modified through startDiscovery(..) and stopDiscovery().
*/
- ScanType getNativeDiscoveringScanType() const {
+ ScanType getNativeDiscoveringScanType() const noexcept{
return currentNativeScanType;
}
/**
* Returns the meta discovering state. It can be modified through startDiscovery(..) and stopDiscovery().
*/
- bool getDiscovering() const {
+ bool getDiscovering() const noexcept {
return ScanType::NONE != currentMetaScanType;
}
@@ -502,21 +502,21 @@ namespace direct_bt {
* use 'DeviceStatusListener::deviceFound(..)' callback.
* </p>
*/
- std::vector<std::shared_ptr<DBTDevice>> getDiscoveredDevices() const;
+ std::vector<std::shared_ptr<DBTDevice>> getDiscoveredDevices() const noexcept;
/** Discards all discovered devices. Returns number of removed discovered devices. */
- int removeDiscoveredDevices();
+ int removeDiscoveredDevices() noexcept;
/** Returns shared DBTDevice if found, otherwise nullptr */
- std::shared_ptr<DBTDevice> findDiscoveredDevice (EUI48 const & mac, const BDAddressType macType);
+ std::shared_ptr<DBTDevice> findDiscoveredDevice (EUI48 const & mac, const BDAddressType macType) noexcept;
- std::string toString() const override;
+ std::string toString() const noexcept override;
/**
* This is a debug facility only, to observe consistency
* of the internally maintained lists of shared_ptr<DBTDevice>.
*/
- void printSharedPtrListOfDevices();
+ void printSharedPtrListOfDevices() noexcept;
};
} // namespace direct_bt
diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp
index d4d43d5e..5a40a0e7 100644
--- a/api/direct_bt/DBTDevice.hpp
+++ b/api/direct_bt/DBTDevice.hpp
@@ -76,19 +76,19 @@ namespace direct_bt {
DBTDevice(DBTAdapter & adapter, EInfoReport const & r);
/** Add advertised service (GAP discovery) */
- bool addAdvService(std::shared_ptr<uuid_t> const &uuid);
+ bool addAdvService(std::shared_ptr<uuid_t> const &uuid) noexcept;
/** Add advertised service (GAP discovery) */
- bool addAdvServices(std::vector<std::shared_ptr<uuid_t>> const & services);
+ bool addAdvServices(std::vector<std::shared_ptr<uuid_t>> const & services) noexcept;
/**
* Find advertised service (GAP discovery) index
* @return index >= 0 if found, otherwise -1
*/
- int findAdvService(std::shared_ptr<uuid_t> const &uuid) const;
+ int findAdvService(std::shared_ptr<uuid_t> const &uuid) const noexcept;
- EIRDataType update(EInfoReport const & data);
- EIRDataType update(GenericAccess const &data, const uint64_t timestamp);
+ EIRDataType update(EInfoReport const & data) noexcept;
+ EIRDataType update(GenericAccess const &data, const uint64_t timestamp) noexcept;
- void releaseSharedInstance() const;
+ void releaseSharedInstance() const noexcept;
void notifyDisconnected();
void notifyConnected(const uint16_t handle);
@@ -105,12 +105,12 @@ namespace direct_bt {
/**
* Releases this instance after calling {@link #remove()}.
*/
- ~DBTDevice();
+ ~DBTDevice() noexcept;
- std::string get_java_class() const override {
+ std::string get_java_class() const noexcept override {
return java_class();
}
- static std::string java_class() {
+ static std::string java_class() noexcept {
return std::string(JAVA_DBT_PACKAGE "DBTDevice");
}
@@ -118,39 +118,39 @@ namespace direct_bt {
DBTAdapter & getAdapter() const { return adapter; }
/** Returns the shared pointer of this instance managed by the adapter. */
- std::shared_ptr<DBTDevice> getSharedInstance() const;
+ std::shared_ptr<DBTDevice> getSharedInstance() const noexcept;
/**
* Returns the timestamp in monotonic milliseconds when this device instance has been created,
* either via its initial discovery or its initial direct connection.
* @see BasicTypes::getCurrentMilliseconds()
*/
- uint64_t getCreationTimestamp() const { return ts_creation; }
+ uint64_t getCreationTimestamp() const noexcept { return ts_creation; }
/**
* Returns the timestamp in monotonic milliseconds when this device instance has
* discovered or connected directly the last time.
* @see BasicTypes::getCurrentMilliseconds()
*/
- uint64_t getLastDiscoveryTimestamp() const { return ts_last_discovery; }
+ uint64_t getLastDiscoveryTimestamp() const noexcept { return ts_last_discovery; }
/**
* Returns the timestamp in monotonic milliseconds when this device instance underlying data
* has been updated the last time.
* @see BasicTypes::getCurrentMilliseconds()
*/
- uint64_t getLastUpdateTimestamp() const { return ts_last_update; }
+ uint64_t getLastUpdateTimestamp() const noexcept { return ts_last_update; }
/**
* @see getLastUpdateTimestamp()
*/
- uint64_t getLastUpdateAge(const uint64_t ts_now) const { return ts_now - ts_last_update; }
+ uint64_t getLastUpdateAge(const uint64_t ts_now) const noexcept { return ts_now - ts_last_update; }
- EUI48 const & getAddress() const { return address; }
- std::string getAddressString() const { return address.toString(); }
- BDAddressType getAddressType() const { return addressType; }
- bool isLEAddressType() const { return BDADDR_LE_PUBLIC == addressType || BDADDR_LE_RANDOM == addressType; }
- bool isBREDRAddressType() const { return BDADDR_BREDR == addressType; }
+ EUI48 const & getAddress() const noexcept { return address; }
+ std::string getAddressString() const noexcept { return address.toString(); }
+ BDAddressType getAddressType() const noexcept { return addressType; }
+ bool isLEAddressType() const noexcept { return BDADDR_LE_PUBLIC == addressType || BDADDR_LE_RANDOM == addressType; }
+ bool isBREDRAddressType() const noexcept { return BDADDR_BREDR == addressType; }
/**
* Returns the {@link BLERandomAddressType}.
@@ -164,21 +164,21 @@ namespace direct_bt {
* </p>
* @since 2.0.0
*/
- BLERandomAddressType getBLERandomAddressType() const { return leRandomAddressType; }
+ BLERandomAddressType getBLERandomAddressType() const noexcept { return leRandomAddressType; }
/** Return RSSI of device as recognized at discovery and connect. */
- int8_t getRSSI() const { return rssi; }
+ int8_t getRSSI() const noexcept { return rssi; }
/** Return Tx Power of device as recognized at discovery and connect. */
- int8_t getTxPower() const { return tx_power; }
+ int8_t getTxPower() const noexcept { return tx_power; }
/** Return AppearanceCat of device as recognized at discovery, connect and GATT discovery. */
- AppearanceCat getAppearance() const { return appearance; }
+ AppearanceCat getAppearance() const noexcept { return appearance; }
- std::string const getName() const;
+ std::string const getName() const noexcept;
/** Return shared ManufactureSpecificData as recognized at discovery, pre GATT discovery. */
- std::shared_ptr<ManufactureSpecificData> const getManufactureSpecificData() const;
+ std::shared_ptr<ManufactureSpecificData> const getManufactureSpecificData() const noexcept;
/**
* Return a list of advertised services as recognized at discovery, pre GATT discovery.
@@ -187,11 +187,11 @@ namespace direct_bt {
* use {@link #getGATTServices()}.
* </p>
*/
- std::vector<std::shared_ptr<uuid_t>> getAdvertisedServices() const;
+ std::vector<std::shared_ptr<uuid_t>> getAdvertisedServices() const noexcept;
- std::string toString() const override { return toString(false); }
+ std::string toString() const noexcept override { return toString(false); }
- std::string toString(bool includeDiscoveredServices) const;
+ std::string toString(bool includeDiscoveredServices) const noexcept;
/**
* Retrieves the current connection info for this device and returns the ConnectionInfo reference if successful,
@@ -201,12 +201,12 @@ namespace direct_bt {
* and therefore all DBTAdapterStatusListener's deviceUpdated(..) method called for notification.
* </p>
*/
- std::shared_ptr<ConnectionInfo> getConnectionInfo();
+ std::shared_ptr<ConnectionInfo> getConnectionInfo() noexcept;
/**
* Return true if the device has been successfully connected, otherwise false.
*/
- bool getConnected() { return isConnected.load(); }
+ bool getConnected() noexcept { return isConnected.load(); }
/**
* Establish a HCI BDADDR_LE_PUBLIC or BDADDR_LE_RANDOM connection to this device.
@@ -292,7 +292,7 @@ namespace direct_bt {
/** Return the HCI connection handle to the LE or BREDR peer, zero if not connected. */
- uint16_t getConnectionHandle() const { return hciConnHandle; }
+ uint16_t getConnectionHandle() const noexcept { return hciConnHandle; }
/**
* Disconnect the LE or BREDR peer's GATT and HCI connection.
@@ -444,13 +444,13 @@ namespace direct_bt {
int removeAllCharacteristicListener();
};
- inline bool operator<(const DBTDevice& lhs, const DBTDevice& rhs)
+ inline bool operator<(const DBTDevice& lhs, const DBTDevice& rhs) noexcept
{ return lhs.address < rhs.address; }
- inline bool operator==(const DBTDevice& lhs, const DBTDevice& rhs)
+ inline bool operator==(const DBTDevice& lhs, const DBTDevice& rhs) noexcept
{ return lhs.address == rhs.address && lhs.addressType == rhs.addressType; }
- inline bool operator!=(const DBTDevice& lhs, const DBTDevice& rhs)
+ inline bool operator!=(const DBTDevice& lhs, const DBTDevice& rhs) noexcept
{ return !(lhs == rhs); }
} // namespace direct_bt
diff --git a/api/direct_bt/DBTManager.hpp b/api/direct_bt/DBTManager.hpp
index 7ee97eb8..a4fe5a60 100644
--- a/api/direct_bt/DBTManager.hpp
+++ b/api/direct_bt/DBTManager.hpp
@@ -232,19 +232,19 @@ namespace direct_bt {
static DBTManager s(defaultBTMode);
return s;
}
- ~DBTManager() { close(); }
+ ~DBTManager() noexcept { close(); }
void close() noexcept;
- std::string get_java_class() const override {
+ std::string get_java_class() const noexcept override {
return java_class();
}
- static std::string java_class() {
+ static std::string java_class() noexcept {
return std::string(JAVA_DBT_PACKAGE "DBTManager");
}
/** Returns the default {@link BTMode}, adapters are tried to be initialized. */
- BTMode getDefaultBTMode() { return defaultBTMode; }
+ BTMode getDefaultBTMode() noexcept { return defaultBTMode; }
/** Returns true if this mgmt instance is open and hence valid, otherwise false */
bool isOpen() const noexcept {