A snapshot of what the robot and the board it runs on are currently doing.
Gathering the values is separated from drawing them so that
BB.NSK.Display.Dashboard stays pure and can be previewed from the host.
temperature_c and humidity_percent come from BB.NSK.Sensor.Environment
rather than from snapshot/1, because they arrive as messages rather than
being there to be read. Whoever is drawing the status fills them in.
access_point_passphrase is set only while the robot is running its own
network, because that is the only time anybody needs it. It is derived from
the board's serial number rather than stored, so the panel is the one place it
can be read from — see BB.NSK.Network.
Every field is nillable, and battery_percent always is: nothing here talks to
the STM32, which is what reads the battery. The SoC cannot — it has no PMIC or
fuel gauge of its own, and gpadc is disabled in the device tree — so the
charger, the current sense and the pack voltage divider all hang off the MCU
and reach Linux over /dev/ttyS2.
That link is available rather than blocked: the boards arrive pre-flashed and the protocol is ASCII. Reading it is left as something to build, not something the hardware refuses.
Summary
Functions
Pick the signal strength for ssid out of a list of access points.
Take a snapshot of the robot and the system.
Types
@type t() :: %BB.NSK.Status{ access_point_passphrase: String.t() | nil, battery_percent: 0..100 | nil, connection: :internet | :lan | :disconnected | nil, firmware_valid?: boolean() | nil, firmware_version: String.t() | nil, hostname: String.t() | nil, humidity_percent: float() | nil, ip: String.t() | nil, load_average: float() | nil, memory_percent: 0..100 | nil, operational_state: atom() | nil, safety_state: atom() | nil, signal_percent: 0..100 | nil, ssid: String.t() | nil, temperature_c: float() | nil, uptime_ms: non_neg_integer() | nil }
Functions
Pick the signal strength for ssid out of a list of access points.
Nothing in the property table says which access point we are associated with, and one network is often served by several — a mesh or a set of repeaters all advertising the same SSID at different strengths. wpa_supplicant associates with the strongest, so that is the one reported here.
Returns nil when the SSID is unknown or isn't among the access points, which
is the normal case for a hidden network: those advertise a blank SSID.
Take a snapshot of the robot and the system.