Skip to main content

sim_lib_view_device/
worn_caps.rs

1//! Hardware-free worn capability fixtures for watch bring-up.
2
3use sim_kernel::{Expr, Symbol};
4use sim_value::build;
5
6use crate::RateClass;
7
8/// Namespace for worn capability fixture expressions.
9pub const WORN_CAPS_NAMESPACE: &str = "worn";
10
11/// Kind tag for worn capability fixture expressions.
12pub const WORN_CAPS_KIND: &str = "caps";
13
14/// Baseline fixture name for the 48mm Amazfit T-Rex 3 Pro.
15pub const T_REX_3_PRO_48_CAPS_FIXTURE: &str = "trex3pro-48";
16
17/// Returns the built-in worn capability fixture names.
18pub fn worn_caps_fixture_names() -> [&'static str; 1] {
19    [T_REX_3_PRO_48_CAPS_FIXTURE]
20}
21
22/// Returns the named worn capability fixture.
23pub fn worn_caps_fixture(name: &str) -> Option<Expr> {
24    match name {
25        T_REX_3_PRO_48_CAPS_FIXTURE => Some(trex3pro_48_worn_caps_fixture()),
26        _ => None,
27    }
28}
29
30/// Builds the verified-baseline fixture for the 48mm Amazfit T-Rex 3 Pro.
31///
32/// Claims record vendor-stated capabilities. Verified flags are false in this
33/// hardware-free baseline; hardware bring-up records firmware evidence before
34/// changing them.
35pub fn trex3pro_48_worn_caps_fixture() -> Expr {
36    build::map(vec![
37        (
38            "kind",
39            Expr::Symbol(Symbol::qualified(WORN_CAPS_NAMESPACE, WORN_CAPS_KIND)),
40        ),
41        ("device", build::sym(T_REX_3_PRO_48_CAPS_FIXTURE)),
42        (
43            "claims",
44            build::map(vec![
45                ("size-mm", build::uint(48)),
46                (
47                    "display-px",
48                    build::list(vec![build::uint(480), build::uint(480)]),
49                ),
50                ("keys", build::uint(4)),
51                ("ble-5-2", Expr::Bool(true)),
52                ("wifi-2-4", Expr::Bool(true)),
53                ("zepp-api", build::text("4.2")),
54                ("zepp-os", build::text("5.0")),
55                ("ble-hr", Expr::Bool(true)),
56                ("notification-out", Expr::Bool(true)),
57                ("mini-program", Expr::Bool(true)),
58                ("mic", Expr::Bool(true)),
59                ("speaker", Expr::Bool(true)),
60            ]),
61        ),
62        (
63            "verified",
64            build::map(vec![
65                ("ble-hr", Expr::Bool(false)),
66                ("zepp-export", Expr::Bool(false)),
67                ("notification-out", Expr::Bool(false)),
68                ("mini-program-bridge", Expr::Bool(false)),
69                ("wifi-lan", Expr::Bool(false)),
70                ("mic-relay", Expr::Bool(false)),
71            ]),
72        ),
73        ("rate", RateClass::watch().to_expr()),
74        ("firmware", Expr::Nil),
75        (
76            "notes",
77            build::list(vec![build::text(
78                "verified flags change only with hardware bring-up ledger evidence",
79            )]),
80        ),
81    ])
82}