diff options
author | Sven Gothel <[email protected]> | 2022-01-01 16:48:06 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-01-01 16:48:06 +0100 |
commit | c1abcb4ee486af49feaab7c6e74ddac3e4a9ea9f (patch) | |
tree | 83802e69145bad37d9c9fa590ec3d3787b8bcfa6 /api/direct_bt/DBGattServer.hpp | |
parent | 285123765cf9b5cf9a490366ff8351d95e80474d (diff) |
Fix DBGattServer::max_att_mtu setup: Constrain over minimum of 512+1, value - not maximum (duh!)
Diffstat (limited to 'api/direct_bt/DBGattServer.hpp')
-rw-r--r-- | api/direct_bt/DBGattServer.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/direct_bt/DBGattServer.hpp b/api/direct_bt/DBGattServer.hpp index 2515e105..144592b7 100644 --- a/api/direct_bt/DBGattServer.hpp +++ b/api/direct_bt/DBGattServer.hpp @@ -728,7 +728,7 @@ namespace direct_bt { * Method can only be issued before passing instance to BTAdapter::startAdvertising() * @see BTAdapter::startAdvertising() */ - void setMaxAttMTU(const uint16_t v) noexcept { max_att_mtu = std::max<uint16_t>(512+1, v); } + void setMaxAttMTU(const uint16_t v) noexcept { max_att_mtu = std::min<uint16_t>(512+1, v); } /** List of Services */ jau::darray<DBGattServiceRef>& getServices() noexcept { return services; } @@ -753,7 +753,7 @@ namespace direct_bt { { } DBGattServer(uint16_t max_att_mtu_, jau::darray<DBGattServiceRef> && services_) - : max_att_mtu(std::max<uint16_t>(512+1, max_att_mtu_)), services( std::move( services_ ) ) + : max_att_mtu(std::min<uint16_t>(512+1, max_att_mtu_)), services( std::move( services_ ) ) { } /** |