tag | 696d2fb95440d37f316764317e006aacafd34fcc | |
---|---|---|
tagger | Xin Li <delphij@google.com> | Wed Apr 24 19:37:49 2024 -0700 |
object | 6dfed7ef27b4f5b8148af5de67eefef9721bef1d |
aml_hef_341613000 (11465779,com.google.android.healthfitness)
commit | 6dfed7ef27b4f5b8148af5de67eefef9721bef1d | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Jul 08 04:35:19 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Jul 08 04:35:19 2023 +0000 |
tree | 452fda2fd6ca489d6cdb06a61a2dbac7cdf3989d | |
parent | 30a4a1ac6fcb7bc9b4bbf24a7040c09ac26c6b2b [diff] | |
parent | abcbec25a5549e01286d3dae91c88e9fc3e07605 [diff] |
Snap for 10460766 from abcbec25a5549e01286d3dae91c88e9fc3e07605 to mainline-healthfitness-release Change-Id: If08480996f615d8b9eb1c300e13391e1fecd8a22
Pica is a virtual UWB Controller implementing the FiRa UCI specification. It has been designed for testing UWB ranging capabilities. Pica supports the following features:
$> git clone https://github.com/google/pica.git $> cd pica/ $> cargo run
You should receive the following output:
Pica: Listening on: 7000 Pica: Web server started on http://0.0.0.0:3000
You can now open the web interface at http://0.0.0.0:3000
and the HTTP commands documentation at http://0.0.0.0:3000/openapi
. The scene should be empty and look like this:
A command line tool is available to trigger some action such as creating an anchor. Run pica in a terminal then open a new one and do:
$> cd pica/ $> python3 scripts/console.py
If you hit Enter
, the console will list you all the available commands:
device_reset Reset the UWBS. get_device_info Retrieve the device information like (UCI version and other vendor specific info). get_caps_info Get the capability of the UWBS. session_init Initialize the session session_deinit Deinitialize the session session_set_app_config set APP Configuration Parameters for the requested UWB session. session_get_app_config retrieve the current APP Configuration Parameters of the requested UWB session. session_get_count Retrieve number of UWB sessions in the UWBS. session_get_state Query the current state of the UWB session. range_start start a UWB session. range_stop Stop a UWB session. get_ranging_count Get the number of times ranging has been attempted during the ranging session.. pica_create_anchor Create a Pica anchor pica_destroy_anchor Destroy a Pica anchor pica_get_state Return the internal Pica state pica_init_uci_device Initialize an uci device pica_set_position Set the position of a Device
If you wish to create a virtual anchor:
$> cd pica/ && python3 scripts/console.py # If the console is not started yet $> --> pica_create_anchor 00:00 # pica_create_anchor <mac_address> $> --> pica_create_anchor 00:01 # Create another one
┌────────────────────┐ │ Web │ │ │ └─────┬─────────▲────┘ │ │ HTTP localhost:3000 ┌────────────────────▼─────────┴───────┐ │ │ │ Pica │ │ │ │ ┌────────┐ ┌────────┐ ┌────────┐ │ │ │Anchor1 │ │Device1 │ │Device2 │ │ │ ├────────┤ │ │ │ │ │ │ │Anchor2 │ ├────────┤ ├────────┤ │ │ ├────────┤ │Session1│ │Session1│ │ │ │... │ ├────────┤ ├────────┤ │ │ │ │ │Session2│ │Session2│ │ │ └────────┘ └──▲──┬──┘ └──▲──┬──┘ │ │ │ │ │ │ │ └─────────────────┼──┼────────┼──┼─────┘ │ │ │ │ TCP localhost:7000 ┌──┴──▼──┐ ┌──┴──▼──┐ │Client1 │ │Client2 │ │ │ │ │ ├────────┤ ├────────┤ │VirtIO │ │ │ ├────────┤ │ │ │UWB HAL │ │ │ ├────────┤ │Python │ │Cuttle │ │console │ │fish │ │ │ └────────┘ └────────┘
Pica also implements HTTP commands, the documentation is available at http://0.0.0.0:3000/openapi
. The set of HTTP commands let the user interact with Pica amd modify its scene.
If you haven't use bluetooth_packetgen before, it is a tool from Android. You can build it and use it and build it that way:
# Build bluetooth_packetgen cd $AOSP_DIR source build/envsetup.sh lunch <target> # Use target 1 if in doubt m bluetooth_packetgen export PATH=$PATH:${AOSP_DIR}/out/host/linux-x86/bin/ # Generate the source cd $PICA_DIR bluetooth_packetgen \ --rust \ --include=src/ \ --out=src/ \ src/uci_packets.pdl
Then edit the uci_packet.rs to add clippy guards
#![allow(clippy::all)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(unused)] #![allow(missing_docs)]