sim_lib_view_device/
worn_caps.rs1use sim_kernel::{Expr, Symbol};
4use sim_value::build;
5
6use crate::RateClass;
7
8pub const WORN_CAPS_NAMESPACE: &str = "worn";
10
11pub const WORN_CAPS_KIND: &str = "caps";
13
14pub const T_REX_3_PRO_48_CAPS_FIXTURE: &str = "trex3pro-48";
16
17pub fn worn_caps_fixture_names() -> [&'static str; 1] {
19 [T_REX_3_PRO_48_CAPS_FIXTURE]
20}
21
22pub 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
30pub 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}