From be7bb35a3c1c908278bb732743a23c6d85a5f853 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 28 Oct 2023 12:08:11 +0200 Subject: DBGattServer/Value: Add convenience make[_gatt]() for initializer list (byte array) --- api/direct_bt/DBGattServer.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api/direct_bt') 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 #include #include +#include #include #include @@ -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 sourcelist) { + return jau::POctets(sourcelist, jau::endian::little); + } + /** * Representing a Gatt Service object from the ::GATTRole::Server perspective. * -- cgit v1.2.3