1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! GATT UUIDs and constants for the Mendi headband BLE protocol (V4).
//!
//! The Mendi headband exposes a custom GATT service with six characteristics,
//! each carrying protobuf-encoded messages as defined in `device_v4.proto`.
//!
//! # UUID namespaces
//!
//! Mendi uses a **vendor-specific** UUID base: `fc3eXXXX-c6c4-49e6-922a-6e551c455af5`.
//! The short codes `ABB0`–`ABB6` are embedded into this base, **not** the
//! standard Bluetooth Base UUID (`0000XXXX-0000-1000-8000-00805f9b34fb`).
//!
//! Standard BLE characteristics (firmware/hardware revision) still use the
//! Bluetooth Base UUID.
use Uuid;
// ── UUID helpers ─────────────────────────────────────────────────────────────
/// Build a full 128-bit UUID from a 16-bit short code using the **Mendi
/// vendor** base UUID: `fc3eXXXX-c6c4-49e6-922a-6e551c455af5`.
pub const
/// Build a full 128-bit UUID from a 16-bit short code using the **standard
/// Bluetooth Base UUID**: `0000XXXX-0000-1000-8000-00805f9b34fb`.
const
// ── Service ──────────────────────────────────────────────────────────────────
/// Primary GATT service UUID: `fc3eabb0-c6c4-49e6-922a-6e551c455af5`.
pub const MENDI_SERVICE_UUID: Uuid = mendi_uuid;
// ── Characteristics ──────────────────────────────────────────────────────────
/// Frame characteristic: `fc3eabb1-c6c4-49e6-922a-6e551c455af5`.
///
/// Real-time fNIRS sensor data: accelerometer, gyroscope, temperature, and
/// 3 optical channels (left, right, pulse) each with IR, red, and ambient
/// light readings. Subscribe to notifications to stream data.
///
/// Protobuf message: [`Frame`](crate::wire::Frame)
pub const FRAME_CHARACTERISTIC: Uuid = mendi_uuid;
/// Sensor register access characteristic: `fc3eabb2-c6c4-49e6-922a-6e551c455af5`.
///
/// Low-level read/write access to the optical sensor's registers.
/// Write a [`Sensor`](crate::wire::Sensor) message to read or write;
/// subscribe to notifications to receive register read responses.
///
/// Protobuf message: [`Sensor`](crate::wire::Sensor)
pub const SENSOR_CHARACTERISTIC: Uuid = mendi_uuid;
/// IMU register access characteristic: `fc3eabb3-c6c4-49e6-922a-6e551c455af5`.
///
/// Low-level read/write access to the IMU (accelerometer/gyroscope) registers.
///
/// Protobuf message: [`Imu`](crate::wire::Imu)
pub const IMU_CHARACTERISTIC: Uuid = mendi_uuid;
/// ADC / Battery characteristic: `fc3eabb4-c6c4-49e6-922a-6e551c455af5`.
///
/// Battery voltage, charging status, and USB connection status.
/// Subscribe to notifications to monitor battery level.
///
/// Protobuf message: [`Adc`](crate::wire::Adc)
pub const ADC_CHARACTERISTIC: Uuid = mendi_uuid;
/// Diagnostics characteristic: `fc3eabb5-c6c4-49e6-922a-6e551c455af5`.
///
/// Self-test results read at power-on: ADC snapshot, IMU ok, sensor ok.
///
/// Protobuf message: [`Diagnostics`](crate::wire::Diagnostics)
pub const DIAGNOSTICS_CHARACTERISTIC: Uuid = mendi_uuid;
/// Calibration characteristic: `fc3eabb6-c6c4-49e6-922a-6e551c455af5`.
///
/// LED current offsets for left, right, and pulse channels.
/// Auto-calibration enable/disable and low-power mode status.
/// Subscribe to notifications to receive calibration updates.
///
/// Protobuf message: [`Calibration`](crate::wire::Calibration)
pub const CALIBRATION_CHARACTERISTIC: Uuid = mendi_uuid;
// ── Device info (standard BLE characteristics) ───────────────────────────────
/// Standard BLE Firmware Revision String characteristic (`0x2A26`).
pub const FIRMWARE_REVISION: Uuid = bt_uuid;
/// Standard BLE Hardware Revision String characteristic (`0x2A27`).
pub const HARDWARE_REVISION: Uuid = bt_uuid;
// ── Optical channel names ────────────────────────────────────────────────────
/// Human-readable names for the three optical channels.
///
/// Each channel measures IR, red LED, and ambient light:
/// - **Left**: left side of the forehead
/// - **Right**: right side of the forehead
/// - **Pulse**: central / pulse oximetry channel
pub const OPTICAL_CHANNEL_NAMES: = ;
// ── Device name prefix ───────────────────────────────────────────────────────
/// Default BLE advertised name prefix for Mendi headbands.
pub const MENDI_NAME_PREFIX: &str = "Mendi";