Commit Graph

4762 Commits

Author SHA1 Message Date
Victor Berchet
8aac1c7bb6 build: Add Android.bp for pw_rpc
Also update/add all required dependencies

Change-Id: I2239fcb1226cb1d2a9213b55a8003e9271c4dedd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115890
Reviewed-by: Anthony Stange <stange@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Victor Berchet <berchet@google.com>
2022-10-28 19:14:20 +00:00
Wyatt Hepler
567b398fff pw_tokenizer: Concatenate duplicate sections in elf_reader.py
When processing an archive file, multiple object files may have sections
with the same name. Have the dump_sections() and dump_section_contents()
commands concatenate sections with the same name across object files.

Bug: b/254925614
Change-Id: I03dcd9c801afb8c944229d53570427d921327243
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116211
Reviewed-by: Anthony Stange <stange@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
2022-10-28 17:16:23 +00:00
Rob Mohr
bfb646256b pw_env_setup: Update most invalid TODOs
Change-Id: I280baed8d83425a5403f5ca0e41fd79073a2dd12
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115250
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2022-10-28 16:51:36 +00:00
Armando Montanez
4a2d8b56f6 pw_transfer: Fix larger than intended port numbers
Some port numbers added a zero in the middle, making them larger than
expected. This puts those ports back into the intended range.

Change-Id: I1383ee9b3d26e0ac585e7e3caccd57dbc9cb7dbb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116253
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-28 16:22:04 +00:00
Ted Pudlik
ea74326f17 targets/stm32f429i_disc1: Add BUILD.bazel file
Bug: 256040948

Change-Id: I919a7239ddd1e6e8c590d22a716fb3dd33506f31
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116370
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-28 01:06:04 +00:00
Ben Lawson
7579724a3c pw_bluetooth: Add vendor & SCO support to Hci
Rename Hci to "Controller".

Add Controller::GetFeatures() method that returns a bitmask of
features supported by the controller.

Add Controller::EncodeVendorCommand() method and associated types.

Add Controller::Initialize() method to enable implementations
to run initialization code and the Bluetooth stack to be
notified of errors.

Rename DataCallback to DataFunction to more accurately describe
the type it is aliasing.

Add support for sending/receiving SCO data to Controller.

Change-Id: Iafbac262ee5d1a920508da97b58e8d06aab1c15b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/111751
Commit-Queue: Ben Lawson <benlawson@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Marie Janssen <jamuraa@google.com>
2022-10-27 22:41:32 +00:00
Ben Lawson
29110cc273 pw_function: pw::Callback aliases fit::callback
Add pw::Callback and pw::InlineCallback aliases for fit::callback and
fit::inline_callback.

Update pw_function docs to describe pw::Callback.

Change-Id: Idb695770830c6c237f7834c281ad3cadaf375794
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116061
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ben Lawson <benlawson@google.com>
2022-10-27 20:53:05 +00:00
Anthony DiGirolamo
8fc3cc0096 pw_console: Serve logs over websockets
Adds a LogPane option to view logs in a web browser.

Change-Id: I606a7d8a20ed69632a069e168e8e6949eb22109b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/109714
Reviewed-by: Asad Memon <asadmemon@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2022-10-27 20:25:57 +00:00
Wyatt Hepler
332c88b6c1 pw_string: pw::InlineString / pw::StringBuilder integration
Allow the pw::StringBuilder class to use a pw::InlineString as its
buffer.

Change-Id: If75169d6a4839b19187e21e01e00ef5d23adcc12
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/103365
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2022-10-27 18:50:44 +00:00
Nathaniel Brough
d5dfbb13d9 pw_protobuf: Add fuzzing harness for decoder
Change-Id: I80afcfde69f4e6bd0e151639ae05a4f847b22f3f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115912
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2022-10-27 00:51:04 +00:00
Yvonne Yip
0a4778199e pw_transfer: Fix pw_thread_stl header dependency in tests
The tests include pw_thread_stl headers. If the host toolchain uses a
different thread backend it causes gn check errors.

Change-Id: I3f97c9b17cd5551daa7142e3970b55b5a80d262c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116151
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Yvonne Yip <ykyyip@google.com>
2022-10-27 00:05:25 +00:00
Armando Montanez
b90363bd11 pw_transfer: Add v1 protocol integration tests
Adds integration tests that specifically request transfers are performed
using the v1 protocol to verify v1 protocol compatibility across the
same client/server version.

Cq-Include-Trybots: luci.pigweed.try:pigweed-integration-transfer
Change-Id: Ifa4b304f88e3790f168c8766ea63cec17212458e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/114133
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
2022-10-26 23:05:39 +00:00
Anthony DiGirolamo
f8444cc8dd docs: Update pw_console and pw_system quickstarts
Change-Id: Ifba6d7ee5644f97b3a1a2fd0477a43ab9dc38b81
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116014
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Chad Norvell <chadnorvell@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-26 22:32:28 +00:00
Armando Montanez
f025dbbcb7 Bazel build: Update rules_cc_toolchain repo
Rolls the rules_cc_toolchain repo to address issues with non-hermetic
linking against system libraries.

Fixes: b/254518544
Change-Id: Ia86c3ee09f7fdd0ee21edef69c65d0c3f48bee4d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116130
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-26 18:38:59 +00:00
Alexei Frolov
8241967118 pw_bloat: Extend CLI command with diff support
This updates the `pw bloat` command to allow specifying a base binary to
run a size diff report against.

Change-Id: I1219679c3f98a5cec1d8992a626ce54fc624da3f
Requires: pigweed-internal:32581
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112318
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2022-10-26 18:34:06 +00:00
Eashan Singh
01d3894996 pw_software_update: Added generate-key handler
Added a handler function for `generate-key` which calls
the keys.py module and handles IO for successful key generation

Bug: 254524996
Change-Id: I1c61c3f7a46e80d6238d218d86bfc623c0cbdab3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116011
Commit-Queue: Eashan Singh <eashansingh@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
2022-10-25 20:22:01 +00:00
Ted Pudlik
123f150b42 pw_bluetooth: Remove unused include
Bug: 234877642
Change-Id: If151c8c973384cfdc9ad00a62e5c81c6e520095e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115911
Reviewed-by: Ben Lawson <benlawson@google.com>
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-25 19:47:06 +00:00
Rob Mohr
10d82c6928 pw_env_setup: Split buildifier into a new file
This allows buildifier to be included without pulling in bazel, but also
for projects using bazel to always get buildifier.

Bug: b/254510918
Change-Id: Iabc41a2b61ccb4cc177e6d5c66884de4a322d613
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116013
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Max Koopman <koopman@google.com>
2022-10-25 19:21:30 +00:00
Nathaniel Brough
58d06ab1a7 third_party: Adds Bazel rules for boringssl
We already depend on boringssl in the gn build, so there's nothing new
here. This is required to get the targets in pw_software_update that
depend on boringssl to build.

Change-Id: I156275abe145b42d0e973ff9614ab5c230ddb258
Signed-off-by: Nathaniel Brough <nathaniel.brough@gmail.com>
Bug: 232427554
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/91051
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
2022-10-25 18:52:23 +00:00
Tom Craig
34309e40b4 pw_package: Bump stm32cube.py versions
Bumps all stm32cube_xx configurations to the latest version from ST.

The immediate motivation is access to ST's significantly improved/fixed
Ethernet HAL in recent versions.

Change-Id: Ifbe0aa57f65830fc86428f4474c5213d87e4f9c0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115872
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
2022-10-25 17:59:52 +00:00
Rob Mohr
613ffdf81a pw_env_setup: Drop bazel from downstream envs
No longer include bazel by default in downstream projects.

Bug: b/254510918
Change-Id: I507161bc1226d559cb49637b502a80765433f709
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116010
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
2022-10-25 17:17:39 +00:00
Rob Mohr
70684c615a pw_env_setup: Reduce CIPD packages for downstream
Reduce the CIPD packages that are pulled in by default for downstream
projects. Break out non-essential packages into separate files that can
be included or not in downstream projects.

Bug: b/254510918
Change-Id: I98603ba21726dd1320eae6c77122c663e5d38f11
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115531
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Chad Norvell <chadnorvell@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2022-10-25 14:58:29 +00:00
Dennis Kormalev
83d13fb0dd pw_intrusive_ptr: Add IntrusivePtr implementation
IntrusivePtr is similar to std::shared_ptr, but has three main
differences:
1. It requires pointed-at object to do the reference counting (can be
   achieved by subclassing RefCounted).
2. Control block is always atomic.
3. No weak_ptr support.

Change-Id: I4fbb69ea875b1f8d84d05d749f7b79a88f8bbcdc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115252
Pigweed-Auto-Submit: Dennis Kormalev <denk@google.com>
Commit-Queue: Dennis Kormalev <denk@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-10-24 22:53:00 +00:00
Wyatt Hepler
49e432d7c1 pw_rpc: Configure container type for dynamic allocation
Support specifying a container type and a #include for it for pw_rpc
endpoints to use. The default type is std::vector, but any compatible
type may be used. This container is only used when dynamic allocation is
enabled.

Fixes: b/243403830
Change-Id: Ib41431fea10d7b7700bc82dee4ba1d80e6d16bc9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115089
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
2022-10-24 22:49:45 +00:00
Dennis Kormalev
9145e73183 pw_intrusive_ptr: Create new module
This module will contain IntrusivePtr which can be used instead of the
std::shared_ptr construct in cases when memory allocation is still
allowed but code is compiled with toolchains that have threading
disabled (which results in non-atomic control blocks in
std::shared_ptr).

Change-Id: Ib06b4421dae7b90df6c665e7dfd750584ae90296
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115251
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Dennis Kormalev <denk@google.com>
2022-10-24 22:37:47 +00:00
Eashan Singh
4f8b6b1d48 pw_software_update: Parse generate-key arguments
Add parser for `pw update generate-key` subcommand.

Bug: 254524996
Change-Id: I72d13c23bef7ad7a8a90181b6b5e17c3816ea8e6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115533
Reviewed-by: Yecheng Zhao <zyecheng@google.com>
Commit-Queue: Eashan Singh <eashansingh@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
2022-10-24 22:16:18 +00:00
Dmitry Kotov
213caae49d pw_protobuf_compiler: Add other_deps argument to pw_proto_library
This argument may be used when proto definitions are generated by
other targets.

Update related docs.

Change-Id: I96e77efb6c5060e96cf853ed52025e23435f4cb7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115810
Commit-Queue: Dmitry Kotov <dkotov@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-10-24 22:12:23 +00:00
Rob Mohr
147dc07fef pw_env_setup: Remove kythe from pigweed CIPD file
Bug: b/254510918
Change-Id: I9030dc3f022aa8bc6557eed3cb1c2877cf0a24f0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115537
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2022-10-24 20:39:41 +00:00
Rob Mohr
388873f852 pw_env_setup: Fix kythe CIPD file
Also, temporarily add it to default.json.

Bug: b/254510918
Change-Id: I979cc0a5f3cdebb523a2dd746d3c5b219d4da43e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115536
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2022-10-24 16:29:06 +00:00
Anqi Dong
5ba213783f pw_protobuf: codegen: Make all enum classes based on uint32_t
The proto enum translations were already declared explicitly as
uint32_t. Declare the proto fields list enum classes to also use
uint32_t, so that users can feel confident about casting to underlying
type when using a checked field number.

Update docs to match that fact that the enum classes are not using the
default underlying type of `int`.

Change-Id: I212b48a851990931fa2533c6b9273585da5c1c3e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/114850
Commit-Queue: Anqi Dong <anqid@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2022-10-22 06:21:24 +00:00
Alexei Frolov
e31b93c6a4 pw_bloat: Simple pw bloat CLI command
This adds a command to the Pigweed CLI which can be used to run size
reports on binaries without having to go through the GN build.

The command initially supports single binary size reports on ELF files
which are linked using pw_bloat memory region symbols. Additional data
sources can be specified to be displayed hierarchically under the root
memoryregions.

Example usage (no child data sources):

$ pw bloat out/docs/obj/pw_result/size_report/bin/ladder_and_then.elf

 ▒█████▄   █▓  ▄███▒  ▒█    ▒█ ░▓████▒ ░▓████▒ ▒▓████▄
  ▒█░  █░ ░█▒ ██▒ ▀█▒ ▒█░ █ ▒█  ▒█   ▀  ▒█   ▀  ▒█  ▀█▌
  ▒█▄▄▄█░ ░█▒ █▓░ ▄▄░ ▒█░ █ ▒█  ▒███    ▒███    ░█   █▌
  ▒█▀     ░█░ ▓█   █▓ ░█░ █ ▒█  ▒█   ▄  ▒█   ▄  ░█  ▄█▌
  ▒█      ░█░ ░▓███▀   ▒█▓▀▓█░ ░▓████▒ ░▓████▒ ▒▓████▀

+----------------------+---------+
|     memoryregions    |  sizes  |
+======================+=========+
|FLASH                 |1,048,064|
|RAM                   |  196,608|
|VECTOR_TABLE          |      512|
+======================+=========+
|Total                 |1,245,184|
+----------------------+---------+

Change-Id: Icc34a085cc62ce3fcf0697f04aaed50c6d559024
Requires: pigweed-internal:32580
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112314
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2022-10-21 21:21:35 +00:00
Rob Mohr
d88195017a pw_env_setup: Add empty CIPD files
Add empty CIPD files for compatibility. These files will be populated in
a follow-up commit, but adding them now lets downstream projects start
to reference them before they're required.

Bug: b/254510918
Change-Id: Ib2f15b5cee57391d8ec8a883c859d3d4a8203fcf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115530
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2022-10-21 20:49:33 +00:00
Dennis Kormalev
bfe9f609a2 pw_stream: Add missing includes
This file uses limits header but didn't include it before.

Change-Id: Ibb172fa9565df5deda012fb978e6141574532b9e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115491
Pigweed-Auto-Submit: Dennis Kormalev <denk@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-21 15:15:42 +00:00
Dennis Kormalev
96bf828434 pw_ring_buffer: Add missing includes
This file uses limits header but didn't include it before.

Change-Id: I4c727accc31dcbe3f8e79249c71bfe6bfbd07ce6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115490
Pigweed-Auto-Submit: Dennis Kormalev <denk@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-21 15:14:31 +00:00
Alex Deymo
faa1bea66d pw_bluetooth: Specify the Deleter when using std::unique_ptr
In several cases we use std::unique_ptr<T> to return an object with RAII
semantics, meaning that some action is needed by the backend to release
the resource when the object goes out of scope. However, using using
std::unique_ptr<T> with the default deleter forces the pw_bluetooth
backend to use new/delete to allocate the T interface implementation.

This patch introduces a RaiiPtr<Api, void (Api::*OnDestroy)()> template
class as an alias of std::unique_ptr with a custom deleter that calls
the Api::OnDestroy parametric method instead of calling "delete". This
template class is used instead of the plain std::unique_ptr when
returning objects from the pw_bluetooth API for the all the "Api"
classes with only pure virtual methods.

In all 5 cases where this pattern was used the abstract class has one
more private pure virtual method (the one used as Api::OnDestroy
parameter) which must be implemented by the backend.

This allows a backend to manage the memory for the returned objects with
something other than new/delete, for example it can return a RaiiPtr to
a std::optional instance or to one of the existing pre-allocated objects
and re-use them  when needed. This is particularly useful in cases where
there can only be a fixed small number of objects for the given type,
like in the Scan or AdvertisingParameters case where there is only one
object at a time.

Bug: 250930246
Change-Id: I724ff5135e0f73f5fb74c7fc92abdffa6a9e2d2d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/113210
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alex Deymo <deymo@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
2022-10-21 11:29:03 +00:00
Alex Deymo
6c593d73db pw_bluetooth: Make Address a class with constructors and helper methods
Similar to pw::bluetooth::Uuid, this patch makes pw::bluetooth::Address
with helper constructors and methods to convert to and from its binary
representation (6-byte array) and hexadecimal representation, such as
"00:11:22:33:44:55".

Test: Added unittests.
Change-Id: I198a1c1f924f7b7901d56e064a5482c62810e2b4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112933
Reviewed-by: Ben Lawson <benlawson@google.com>
Reviewed-by: Marie Janssen <jamuraa@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alex Deymo <deymo@google.com>
2022-10-21 11:11:22 +00:00
Alex Deymo
cc55c96a88 pw_bluetooth: Make Uuid a class with constructors and helper methods
The Bluetooth Core Spec defines 16-bit, 32-bit and full 128-bit
representations of 128-bit UUID values. In several cases the protocol
allows to set a 128-bit value or shorter 16-bit value when using one of
the pre-assigned short 16-bit values.

This patch makes Uuid a class of the same 128-bit size as before but
adds constructors and helper methods to easily handle these
representations as well as printing and parsing human-readable hex
representations of the same.

Test: Added unittests for the new methods.
Change-Id: I93607b58a85eb8a3388a8e2f462aa0245b812c00
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112932
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
Reviewed-by: Marie Janssen <jamuraa@google.com>
Commit-Queue: Alex Deymo <deymo@google.com>
2022-10-21 10:32:26 +00:00
Medha Kini
7009bed127 pw_metric: Share MetricWalker
Moves the MetricWalker to a private header and introduces a virtual
MetricWriter interface to share code common between the pwpb and nanopb
MetricService implementations.

Change-Id: Ibcb173e7ce5cb178a0ec66d07de6c44d1101b3b4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/101380
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
2022-10-21 09:53:23 +00:00
Rob Mohr
b5f2fd746c pw_{env_setup,pw_presubmit}: Remove renode
Bug: b/254510918
Change-Id: I24ce8191d98bdf15f90973596a901fc60d86a3c7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115233
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Chad Norvell <chadnorvell@google.com>
2022-10-21 09:10:34 +00:00
Rob Mohr
51b0e627d6 pw_presubmit: Add ignore-prefix to keep-sorted
Add an option to ignore prefixes in keep-sorted blocks, so, for example,
"'CMakeLists.txt'," is placed next to "'*.cmake'," (with
"ignore-prefix='*.,'").

Bug: b/250875082
Change-Id: I2179585708ce950750cdd4cfc475075e181fd2b9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115231
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-21 01:34:03 +00:00
Chad Norvell
f488ae95fe pw_ide: Process multiple comp DBs
Some tools and build systems can output multiple compilation databases
instead of just one. Now you can provide either a path to a single file
or a glob to multiple files to process. The result will still be a set
of consistent target-specific compilation databases.

Change-Id: I6fb6e412292ee0a4ec1a5fcbd61c5da3c6e7876f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/113312
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Chad Norvell <chadnorvell@google.com>
2022-10-20 23:08:40 +00:00
Alex Deymo
45dd95ba07 pw_bluetooth: Convert Host's initial bonds to pw::span
As with other data passed to the pw_bluetooth backend, the
PersistentData struct needs to use a pw::span instead of pw::Vector so
we can construct it and pass it to the backend.

Drive by spelling fix included.

Change-Id: I800a81ac1da780d0258c54a60d0ebb599e9d3e3f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115410
Commit-Queue: Alex Deymo <deymo@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2022-10-20 22:16:23 +00:00
Brian Barcenas
fbd6d5d792 pw_perf_test: Added internal timing facade + backend
pw_perf_test now has a backend for which it will use
to time the tested components. This update includes
an implementation with pw_chrono, which will be used
for time-based measurements(nanoseconds).

Change-Id: I9a1bb9cf0964caa4d911a1c7c016bab3a41f1e32
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/113890
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Brian Barcenas <bbarcenas@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
2022-10-20 21:24:39 +00:00
Prabhu Karthikeyan Rajasekaran
e2a224838d pw_thread: Match function signature with declaration
Change-Id: I754be91d5f9c44a28d8a12a796e6ff62641bd4e4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115315
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Prabhu Karthikeyan Rajasekaran <prabhukr@google.com>
2022-10-20 21:05:19 +00:00
Rob Mohr
291f4c8608 python: Start enforcing mypy --no-implicit-optional
Also, add mypy.ini for each module.

Change-Id: Ied1d0dc990beb6436b35c5bc0cbbfbcd5aa3b9e0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115373
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-20 21:03:29 +00:00
Tom Craig
f8d6a80362 pw_doctor: Add PW_DISABLE_ROOT_GIT_REPO_CHECK
pw_doctor currently throws an error during the PW_ROOT check if
the pigweed root is not in its own git repo (or submodule). In my case,
for reasons I'd rather not revisit, pigweed is intentionally vendored
rather than being in a submodule.

This commit adds support for suppressing the anti-vendoring portion of
the PW_ROOT check by setting PW_DISABLE_ROOT_GIT_REPO_CHECK=1 in a
user's bootstrap script.

Change-Id: I5eb8c791fd3444f56103536e7bd4a4a551f711ca
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115370
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
2022-10-20 20:44:05 +00:00
Eashan Singh
2273bc7c0d pw_software_update: Register a skeleton CLI
Register a new `pw update` command eventually for the
pw_software_update CLI (currently just a skeleton).

Bug: 254524996

Test: Manual invocation of `pw update` works.

Change-Id: If9f8da55aa315296289a4062a4d69b204da99790
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115297
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: Yecheng Zhao <zyecheng@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Eashan Singh <eashansingh@google.com>
2022-10-20 17:59:05 +00:00
Chad Norvell
c5910db7f1 pw_ide: Embed GN and Ninja
When using GN as the build system, instead of running a separate
`gn gen` command to generate the compilation database, this can be done
in one step along with `pw ide cpp`. Likewise, you can generate a
compilation database directly from Ninja (or something else that
generates Ninja, like CMake) and process it in a single command.

To support all of this automatic magic, pw_ide does a lot more
work to intelligently (IMHO) infer information it needs even if it's not
provided. For example, if no target is specified and no default target
is defined in settings, we find the target with the most compilation
unit coverage. This also includes much more flexible inference of target
name from build directory structure to support more esoteric choices.

Change-Id: Ibdbeb9385a4610a3e3f1b3f80abbe672a883e0ab
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/112522
Commit-Queue: Chad Norvell <chadnorvell@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
2022-10-20 07:51:25 +00:00
Alexei Frolov
67fd10e57d pw_transfer: Add lifetime retry limit
This adds a lifetime retry limit to the C++ and Python transfer
implementations. If the total number of retries over the duration
of the transfer exceeds this limit, the transfer is canceled. This
is done to avoid situtations where transfer could end up in an
infinite retry loop.

Change-Id: I8572a84a323e1517b7d422e6a19d094c03a88974
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/114490
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2022-10-19 19:13:02 +00:00
Rob Mohr
22f023e67a pw_presubmit: Add blocking todo check
Add a blocking TODO check with exclusions for existing issues
("todo_check_with_exceptions"). Leave pre-existing "todo_check" to help
reduce the number of exceptions.

Change-Id: I8b9e01fb9cce5444fecab52d58e8ead3c0e6f65d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/115254
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2022-10-19 17:42:45 +00:00