aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt
diff options
context:
space:
mode:
Diffstat (limited to 'api/direct_bt')
-rw-r--r--api/direct_bt/BTAddress.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/direct_bt/BTAddress.hpp b/api/direct_bt/BTAddress.hpp
index eb1a4715..e57a232a 100644
--- a/api/direct_bt/BTAddress.hpp
+++ b/api/direct_bt/BTAddress.hpp
@@ -58,6 +58,12 @@ namespace direct_bt {
/** Undefined */
BDADDR_UNDEFINED = 0xff
};
+ constexpr BDAddressType getBDAddressType(const uint8_t v) noexcept {
+ if( v <= 2 ) {
+ return static_cast<BDAddressType>(v);
+ }
+ return BDAddressType::BDADDR_UNDEFINED;
+ }
constexpr uint8_t number(const BDAddressType rhs) noexcept {
return static_cast<uint8_t>(rhs);
}