aboutsummaryrefslogtreecommitdiff
path: root/pw_bluetooth
diff options
context:
space:
mode:
authorWyatt Hepler <hepler@google.com>2024-01-16 20:54:52 +0000
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-01-16 20:54:52 +0000
commitdb66e1ef97700adddd6bee304252576cb25fa963 (patch)
tree849cbeb57d08403aebea534af245e5cd9cb1760e /pw_bluetooth
parent9ad961bb7bbd3767c4b0798f2c9553413fc962a2 (diff)
downloadpigweed-db66e1ef97700adddd6bee304252576cb25fa963.tar.gz
pw_containers: Make Vector<T> destructor protected
- Make the destructor protected to prevent both delete calls and direct destructor calls (as used with placement new). This prevents unusable declarations such as std::optional<Vector<T>>. - Fix a struct in pw_bluetooth with a generic-capcity vector member, which resulted in a compiler error with this change. - Add negative compilation tests for deleting generic-capacity vectors. Change-Id: I841897cd63a68654b2065dad51ee42a9631f815e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/187801 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com> Reviewed-by: Taylor Cramer <cramertj@google.com> Reviewed-by: Aaron Green <aarongreen@google.com>
Diffstat (limited to 'pw_bluetooth')
-rw-r--r--pw_bluetooth/public/pw_bluetooth/gatt/client.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/pw_bluetooth/public/pw_bluetooth/gatt/client.h b/pw_bluetooth/public/pw_bluetooth/gatt/client.h
index e12de22be..47e4b2038 100644
--- a/pw_bluetooth/public/pw_bluetooth/gatt/client.h
+++ b/pw_bluetooth/public/pw_bluetooth/gatt/client.h
@@ -46,7 +46,8 @@ class RemoteService {
Handle handle;
/// The value of the characteristic or descriptor.
- Vector<std::byte> value;
+ // TODO: b/320482584 - Consider changing capacity or making it configurable
+ Vector<std::byte, 20> value;
/// True if `value` might be truncated (the buffer was completely filled by
/// the server and the read was a short read). `ReadCharacteristic` or