95 : address(address_), addressType(addressType_), rssi(rssi_), tx_power(tx_power_), max_tx_power(max_tx_power_) {}
99 int8_t
getRSSI() const noexcept {
return rssi; }
117 std::string short_name;
120 void setName(std::string v)
noexcept { name = std::move(v); }
121 void setShortName(std::string v)
noexcept { short_name = std::move(v); }
125 : name(), short_name() {}
128 : name(std::move(name_)), short_name(std::move(short_name_)) {}
130 std::string
getName() const noexcept {
return name; }
165 return static_cast<AdapterSetting> ( ~static_cast<uint32_t>(rhs) );
168 return static_cast<AdapterSetting> (
static_cast<uint32_t
>(lhs) ^
static_cast<uint32_t
>(rhs) );
171 return static_cast<AdapterSetting> (
static_cast<uint32_t
>(lhs) |
static_cast<uint32_t
>(rhs) );
174 return static_cast<AdapterSetting> (
static_cast<uint32_t
>(lhs) &
static_cast<uint32_t
>(rhs) );
177 return static_cast<uint32_t
>(lhs) ==
static_cast<uint32_t
>(rhs);
180 return !( lhs == rhs );
212 std::atomic<AdapterSetting> current_setting;
215 std::string short_name;
219 const uint8_t version_,
const uint16_t manufacturer_,
221 const uint32_t dev_class_, std::string name_, std::string short_name_) noexcept
224 supported_setting(supported_setting_),
225 current_setting(current_setting_), dev_class(dev_class_),
226 name( std::move(name_) ), short_name( std::move(short_name_) )
232 supported_setting(o.supported_setting),
233 current_setting(o.current_setting.load()), dev_class(o.dev_class),
234 name(o.name), short_name(o.short_name)
241 supported_setting = o.supported_setting;
242 current_setting = o.current_setting.load();
243 dev_class = o.dev_class;
245 short_name = o.short_name;
252 supported_setting(o.supported_setting),
253 current_setting(o.current_setting.load()), dev_class(o.dev_class),
254 name(std::move(o.name)), short_name(std::move(o.short_name))
264 const AdapterSetting _current_setting = new_setting & supported_setting;
265 current_setting = _current_setting;
266 return _current_setting;
269 supported_setting = supported_setting_;
270 current_setting = current_setting_;
273 void setName(std::string v)
noexcept { name = std::move(v); }
274 void setShortName(std::string v)
noexcept { short_name = std::move(v); }
279 return setting == ( setting & supported_setting );
288 std::string
getName() const noexcept {
return name; }
295 "], name '"+name+
"', shortName '"+short_name+
"']";
std::string toString() const noexcept
AdapterInfo & operator=(const AdapterInfo &o)
AdapterSetting setCurrentSettingMask(const AdapterSetting new_setting) noexcept
Assigns the given 'new_setting & supported_setting' to the current_setting.
void setSettingMasks(const AdapterSetting supported_setting_, const AdapterSetting current_setting_) noexcept
std::string getName() const noexcept
BTMode getCurrentBTMode() const noexcept
Map getCurrentSettingMask() to BTMode.
std::string getShortName() const noexcept
const BDAddressAndType addressAndType
The adapter's address initially reported by the system is always its public address,...
AdapterInfo & operator=(AdapterInfo &&o) noexcept=delete
AdapterInfo(AdapterInfo &&o) noexcept
void setName(std::string v) noexcept
constexpr const AdapterSetting & get_supportedSetting() const noexcept
AdapterInfo(const AdapterInfo &o) noexcept
const uint16_t manufacturer
bool isSettingMaskSupported(const AdapterSetting setting) const noexcept
bool isCurrentSettingBitSet(const AdapterSetting bit) const noexcept
void setShortName(std::string v) noexcept
AdapterSetting getCurrentSettingMask() const noexcept
void setDevClass(const uint32_t v) noexcept
uint32_t getDevClass() const noexcept
AdapterInfo(const uint16_t dev_id_, BDAddressAndType addressAndType_, const uint8_t version_, const uint16_t manufacturer_, const AdapterSetting supported_setting_, const AdapterSetting current_setting_, const uint32_t dev_class_, std::string name_, std::string short_name_) noexcept
Unique Bluetooth EUI48 address and BDAddressType tuple.
std::string toString() const noexcept
BTAdapter represents one local Bluetooth Controller.
A thread safe singleton handler of the BTAdapter manager, e.g.
~BTObject() noexcept override
std::atomic_bool instance_valid
bool isValidInstance() const noexcept
Returns whether the object's reference is valid and in a general operational state.
std::string toString() const noexcept override
void checkValidInstance() const override
Throws an IllegalStateException if instance is not valid.
mgmt_addr_info { EUI48, uint8_t type }, int8_t rssi, int8_t tx_power, int8_t max_tx_power;
int8_t getMaxTxPower() const noexcept
int8_t getTxPower() const noexcept
BDAddressType getAddressType() const noexcept
ConnectionInfo(const jau::EUI48 &address_, BDAddressType addressType_, int8_t rssi_, int8_t tx_power_, int8_t max_tx_power_) noexcept
static jau::nsize_t minimumDataSize() noexcept
std::string toString() const noexcept
int8_t getRSSI() const noexcept
const jau::EUI48 getAddress() const noexcept
NameAndShortName(std::string name_, std::string short_name_) noexcept
std::string getName() const noexcept
void setName(std::string v) noexcept
void setShortName(std::string v) noexcept
std::string toString() const noexcept
std::string getShortName() const noexcept
NameAndShortName() noexcept
Sharing the anonymous Java object (JavaAnon), i.e.
constexpr LE_Features operator^(const LE_Features lhs, const LE_Features rhs) noexcept
bool operator==(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
BTMode getAdapterSettingsBTMode(const AdapterSetting settingMask) noexcept
Maps the given AdapterSetting to BTMode.
BTMode
Bluetooth adapter operating mode.
std::string to_string(const DiscoveryPolicy v) noexcept
constexpr void setAdapterSettingMaskBit(AdapterSetting &mask, const AdapterSetting bit) noexcept
constexpr AdapterSetting getAdapterSettingMaskDiff(const AdapterSetting setting_a, const AdapterSetting setting_b) noexcept
AdapterSetting
Adapter Setting Bits.
constexpr bool isAdapterSettingBitSet(const AdapterSetting mask, const AdapterSetting bit) noexcept
BDAddressType
BT Core Spec v5.2: Vol 3, Part C Generic Access Profile (GAP): 15.1.1.1 Public Bluetooth address.
constexpr ScanType operator~(const ScanType val) noexcept
std::string to_string(const AdapterInfo &a) noexcept
bool operator!=(const BTAdapter &lhs, const BTAdapter &rhs) noexcept
constexpr void clrAdapterSettingMaskBit(AdapterSetting &mask, const AdapterSetting bit) noexcept
@ LE
LE only Bluetooth mode.
@ BREDR
BREDR only Bluetooth mode.
constexpr BTGattChar::PropertyBitVal operator&(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
constexpr BTGattChar::PropertyBitVal operator|(const BTGattChar::PropertyBitVal lhs, const BTGattChar::PropertyBitVal rhs) noexcept
uint_fast32_t nsize_t
Natural 'size_t' alternative using uint_fast32_t as its natural sized type.
std::string to_hexstring(value_type const &v) noexcept
Produce a lower-case hexadecimal string representation of the given pointer.
A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Med...
std::string toString() const noexcept