device: Fix endianness of published UCI,PHY,MAC,TEST versions

Major version is in first byte, minor version and maintenance
number in second byte.

Change-Id: Id84d97aa950f8ccd3ec97fcb824eeefb06a599d3
1 file changed
tree: ff458d202dbb615f3c2472827eef9d530509d2c8
  1. scripts/
  2. src/
  3. static/
  4. .gitignore
  5. Cargo.lock
  6. Cargo.toml
  7. README.md
README.md

Pica

Pica is a virtual UWB Controller implementation supporting UWB ranging sessions. It has been designed for testing UWB ranging capabilities. Pica supports the following features:

  • Pica keeps an internal representation of a 3-D scene.
  • Pica lets multiple clients connect through TCP sockets. Each new connection spawns an attached UWB subsystem. Connected hosts can interact together as if they existed in a single 3-D scene.
  • Pica implements a nice GUI through a web server.
  • Pica provides additional vendor commands to create and configure virtual beacons.

Project

To follow the project development, go to our Table workspace.

The android UWB HAL will soon link to Pica. For now, if you wish to use Pica as the Android virtual controller, please follow this document.

Build and run

$> git clone sso://blueberry/pica
$> cd pica/
$> cargo run

You should have 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

Command line

A command line tool is available to trigger some action such as creating a beacon. 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_beacon              Create a Pica beacon

If you wish to create a virtual beacon:

$> cd pica/ && python3 scripts/console.py # If the console is not started yet
$> --> pica_create_beacon 22 # pica_create_beacon <mac_address>
$> --> pica_create_beacon 56 # Create another one

Architecture

  • Device UWB subsystem created for a connected host.
  • Session UWB ranging session opened by a connected host.
  • Beacon virtual UWB host, responding to ranging requests from connected hosts.
                 ┌────────────────────┐
                 │ Web                │
                 │                    │
                 └─────┬─────────▲────┘
                       │         │    HTTP localhost:3000
  ┌────────────────────▼─────────┴───────┐
  │                                      │
  │                 Picaaaaaaaaaa        │
  │                                      │
  │  ┌────────┐  ┌────────┐  ┌────────┐  │
  │  │Beacon1 │  │Device1 │  │Device2 │  │
  │  ├────────┤  │        │  │        │  │
  │  │Beacon2 │  ├────────┤  ├────────┤  │
  │  ├────────┤  │Session1│  │Session1│  │
  │  │...     │  ├────────┤  ├────────┤  │
  │  │        │  │Session2│  │Session2│  │
  │  └────────┘  └──▲──┬──┘  └──▲──┬──┘  │
  │                 │  │        │  │     │
  └─────────────────┼──┼────────┼──┼─────┘
                    │  │        │  │  TCP localhost:7000
                 ┌──┴──▼──┐  ┌──┴──▼──┐
                 │Client1 │  │Client2 │
                 │        │  │        │
                 ├────────┤  ├────────┤
                 │VirtIO  │  │        │
                 ├────────┤  │        │
                 │UWB HAL │  │        │
                 ├────────┤  │Python  │
                 │Cuttle  │  │console │
                 │fish    │  │        │
                 └────────┘  └────────┘

Vendor commands

Pica implements vendor commands in the group 0x09 to let hosts report their MAC address and current position. Other commands allow the hosts to create and modify beacons.

Position

The position encodes the physical localization and orientation of an UWB device.

Position FieldsLengthValue/Description
X2 OctetsX Coordinate
Y2 OctetsY Coordinate
Z2 OctetsZ Coordinate
Yaw2 OctetsYaw angle (Y-axis) in degrees (-180 to 180)
Pitch1 OctetPitch angle (X-axis) in degrees (-90 to 90)
Roll2 OctetsRoll angle (Z-axis) in degrees (-180 to 180)

PICA_INIT_DEVICE_CMD (0x00)

Payload FieldsLengthValue/Description
Mac Address8 OctetsReplace the generated mac address for the UWB subsystem. The default mac address is a counter incremented for each new connection.
Position11 OctetsReport the initial position of the UWB device.

PICA_INIT_DEVICE_RSP (0x00)

Payload FieldsLengthValue/Description
Status1 OctetStatus code

PICA_SET_DEVICE_POSITION_CMD (0x01)

Payload FieldsLengthValue/Description
Position11 OctetsReport the current position of the UWB device.

PICA_SET_DEVICE_POSITION_RSP (0x01)

Payload FieldsLengthValue/Description
Status1 OctetStatus code

PICA_CREATE_BEACON_CMD (0x02)

Payload FieldsLengthValue/Description
Mac Address8 OctetsSelected mac address for the UWB beacon.
Position11 OctetsReport the initial position of the UWB beacon.

PICA_CREATE_BEACON_RSP (0x02)

Payload FieldsLengthValue/Description
Status1 OctetStatus code

PICA_SET_BEACON_POSITION_CMD (0x03)

Payload FieldsLengthValue/Description
Mac Address8 OctetsMac address of the UWB beacon to edit.
Position11 OctetsReport the current position of the UWB beacon.

PICA_SET_BEACON_POSITION_RSP (0x03)

Payload FieldsLengthValue/Description
Status1 OctetStatus code

PICA_DESTROY_BEACON_CMD (0x04)

Payload FieldsLengthValue/Description
Mac Address8 OctetsMac address of the UWB beacon to remove.

PICA_DESTROY_BEACON_RSP (0x04)

Payload FieldsLengthValue/Description
Status1 OctetStatus code