aboutsummaryrefslogtreecommitdiffstats
path: root/api/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-28 12:08:11 +0200
committerSven Gothel <[email protected]>2023-10-28 12:08:11 +0200
commitbe7bb35a3c1c908278bb732743a23c6d85a5f853 (patch)
treede37ff910c1c0e490f5590b3c259641ed4357cc4 /api/direct_bt
parent9fb8e4008d2ae0b1ef0dd7d428acc64ba8a8a7bf (diff)
DBGattServer/Value: Add convenience make[_gatt]() for initializer list (byte array)
Diffstat (limited to 'api/direct_bt')
-rw-r--r--api/direct_bt/DBGattServer.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/direct_bt/DBGattServer.hpp b/api/direct_bt/DBGattServer.hpp
index e2fc23a6..d32de77a 100644
--- a/api/direct_bt/DBGattServer.hpp
+++ b/api/direct_bt/DBGattServer.hpp
@@ -32,6 +32,7 @@
#include <cstdint>
#include <mutex>
#include <atomic>
+#include <initializer_list>
#include <jau/java_uplink.hpp>
#include <jau/octets.hpp>
@@ -529,6 +530,11 @@ namespace direct_bt {
return p;
}
+ /** Convenience jau::POctets ctor function to create DBGattChar or DBGattDesc values. */
+ inline jau::POctets make_gvalue(std::initializer_list<uint8_t> sourcelist) {
+ return jau::POctets(sourcelist, jau::endian::little);
+ }
+
/**
* Representing a Gatt Service object from the ::GATTRole::Server perspective.
*