pw_bluetooth: Replace pw::Vector with pw::span on input parameters

When passing a struct with a set of parameters such as the
LocalServerInfo or AdvertisingData, use a pw::span<const T> instead of a
pw::Vector<T>. The latter can't be directly constructed unless a variant
with a fixed maximum size is used.

Fixed some spelling typos.

Change-Id: Ic012fb9086097fa077b20702f57049150cbbfdbe
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112270
Reviewed-by: Ben Lawson <benlawson@google.com>
Commit-Queue: Alex Deymo <deymo@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/pw_bluetooth/public/pw_bluetooth/gatt/server.h b/pw_bluetooth/public/pw_bluetooth/gatt/server.h
index 04ec360..2cff56f 100644
--- a/pw_bluetooth/public/pw_bluetooth/gatt/server.h
+++ b/pw_bluetooth/public/pw_bluetooth/gatt/server.h
@@ -37,10 +37,10 @@
   Uuid type;
 
   // The characteristics of this service.
-  Vector<Characteristic> characteristics;
+  span<const Characteristic> characteristics;
 
   // Handles of other services that are included by this service.
-  Vector<Handle> includes;
+  span<const Handle> includes;
 };
 
 // Interface for serving a local GATT service. This is implemented by the API
@@ -79,7 +79,7 @@
                                            bool indicate) = 0;
 
   // Called when a peer requests to read the value of a characteristic or
-  // descriptor. It is guaranteed that the peer satisfies the permssions
+  // descriptor. It is guaranteed that the peer satisfies the permissions
   // associated with this attribute.
   //
   // Parameters:
@@ -131,7 +131,7 @@
     // The PeerIds of the peers to signal. The LocalService should respect the
     // Characteristic Configuration associated with a peer+handle when deciding
     // whether to signal it. If empty, all peers are signalled.
-    Vector<PeerId> peer_ids;
+    span<const PeerId> peer_ids;
     // The handle of the characteristic value being signaled.
     Handle handle;
     // The new value for the descriptor/characteristic.
@@ -212,7 +212,7 @@
   // `LocalService` is destroyed or an error occurs
   // (LocalServiceDelegate.OnError), the service will be unpublished.
   virtual void PublishService(
-      LocalServiceInfo info,
+      const LocalServiceInfo& info,
       LocalServiceDelegate* delegate,
       Function<
           void(Result<PublishServiceError, std::unique_ptr<LocalService>>)>&&
diff --git a/pw_bluetooth/public/pw_bluetooth/gatt/types.h b/pw_bluetooth/public/pw_bluetooth/gatt/types.h
index 3a2b2ea..df399fc 100644
--- a/pw_bluetooth/public/pw_bluetooth/gatt/types.h
+++ b/pw_bluetooth/public/pw_bluetooth/gatt/types.h
@@ -17,7 +17,7 @@
 #include <optional>
 
 #include "pw_bluetooth/types.h"
-#include "pw_containers/vector.h"
+#include "pw_span/span.h"
 
 namespace pw::bluetooth::gatt {
 
@@ -68,7 +68,7 @@
 
   // Specifies the security requirements for a client to subscribe to
   // notifications or indications on a characteristic. A characteristic's
-  // support for notifications or indiciations is specified using the NOTIFY and
+  // support for notifications or indications is specified using the NOTIFY and
   // INDICATE characteristic properties. If a local characteristic has one of
   // these properties then this field can not be null. Otherwise, this field
   // must be left as null.
@@ -103,8 +103,8 @@
   // The UUID that identifies the type of this characteristic.
   Uuid type;
 
-  // The characteristic properties bitfield. See `CharacteristicPropertyBits`
-  // above for possible values.
+  // The characteristic properties bitfield. This is a logic or of any number of
+  // values from `CharacteristicPropertyBits` above.
   CharacteristicPropertyBits properties;
 
   // The attribute permissions of this characteristic. For remote
@@ -113,7 +113,7 @@
   std::optional<AttributePermissions> permissions;
 
   // The descriptors of this characteristic.
-  Vector<Descriptor> descriptors;
+  span<const Descriptor> descriptors;
 };
 
 }  // namespace pw::bluetooth::gatt
\ No newline at end of file
diff --git a/pw_bluetooth/public/pw_bluetooth/low_energy/advertising_data.h b/pw_bluetooth/public/pw_bluetooth/low_energy/advertising_data.h
index aa79598..8724832 100644
--- a/pw_bluetooth/public/pw_bluetooth/low_energy/advertising_data.h
+++ b/pw_bluetooth/public/pw_bluetooth/low_energy/advertising_data.h
@@ -16,7 +16,6 @@
 #include <cstdint>
 
 #include "pw_bluetooth/types.h"
-#include "pw_containers/vector.h"
 #include "pw_span/span.h"
 
 namespace pw::bluetooth::low_energy {
@@ -42,11 +41,11 @@
   // The appearance of the local device.
   Appearance appearance = Appearance::kUnknown;
 
-  Vector<Uuid> service_uuids;
+  span<const Uuid> service_uuids;
 
-  Vector<ServiceData> service_data;
+  span<const ServiceData> service_data;
 
-  Vector<ManufacturerData> manufacturer_data;
+  span<const ManufacturerData> manufacturer_data;
 
   // String representing a URI to be advertised, as defined in IETF STD 66:
   // https://tools.ietf.org/html/std66. Each entry should be a UTF-8 string
@@ -56,7 +55,7 @@
   // https://www.bluetooth.com/specifications/assigned-numbers/uri-scheme-name-string-mapping
   // for code-points used by the system to compress the scheme to save space in
   // the payload.
-  Vector<std::string_view> uris;
+  span<const std::string_view> uris;
 
   // Indicates whether the current TX power level should be included in the
   // advertising data.
diff --git a/pw_bluetooth/public/pw_bluetooth/low_energy/peripheral.h b/pw_bluetooth/public/pw_bluetooth/low_energy/peripheral.h
index 8a77492..d48c776 100644
--- a/pw_bluetooth/public/pw_bluetooth/low_energy/peripheral.h
+++ b/pw_bluetooth/public/pw_bluetooth/low_energy/peripheral.h
@@ -138,7 +138,7 @@
   // `result_callback` - Called once advertising has started or failed. On
   //     success, called with an `AdvertisedPeripheral` that models the lifetime
   //     of the advertisement. Destroying it will stop advertising.
-  virtual void Advertise(AdvertisingParameters parameters,
+  virtual void Advertise(const AdvertisingParameters& parameters,
                          AdvertiseCallback&& result_callback) = 0;
 };