Skip to content

Commit cf0d569

Browse files
authored
Merge pull request #394 from rdkcentral/feature/392-sensor-doc-clarifications
docs: clarify sensor HAL timing semantics, lifecycle model, and shutdown handling (#392)
2 parents fde9131 + 7affdf7 commit cf0d569

3 files changed

Lines changed: 50 additions & 8 deletions

File tree

sensor/current/com/rdk/hal/sensor/motion/IMotionSensor.aidl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@
2424
* The motion sensor can operate in a mode that reports either "motion" events
2525
* or "no-motion" events after an inactivity window. Sensitivity is optional:
2626
* if unsupported, both minSensitivity and maxSensitivity are 0.
27+
*
28+
* @details
29+
* Lifecycle ownership:
30+
* The sensor uses a single-owner lifecycle model. start() and stop()
31+
* operate on the sensor instance directly — there is no per-client
32+
* controller or exclusive open/close pattern. A single middleware
33+
* component (e.g., a power management service) should own the sensor
34+
* lifecycle, while other components register as event listeners only.
35+
*
36+
* Timing controls vs active windows:
37+
* activeStartSeconds/activeStopSeconds (passed to start()) and active
38+
* windows (configured via setActiveWindows()) are independent, layered
39+
* mechanisms:
40+
* - Timing controls govern the sensor hardware lifecycle — whether
41+
* the sensor is active at all.
42+
* - Active windows govern event suppression — whether detected events
43+
* are delivered to listeners.
44+
*
45+
* Timing controls take precedence. Callers are responsible for ensuring
46+
* sensible combinations (e.g., that activeStartSeconds does not exceed
47+
* the remaining window duration).
2748
*/
2849
package com.rdk.hal.sensor.motion;
2950

@@ -70,9 +91,12 @@ interface IMotionSensor {
7091
* @param activeStopSeconds Duration in seconds after which the sensor becomes inactive.
7192
* Use 0 for no automatic stop.
7293
*
94+
* @pre Sensor must be in STOPPED state.
95+
*
7396
* @returns Success flag indicating sensor start status.
7497
* @retval true Sensor accepted the start request.
75-
* @retval false Sensor could not be started (e.g. invalid hw state).
98+
* @retval false Sensor could not be started due to an internal or hardware initialisation failure.
99+
* @exception binder::Status EX_ILLEGAL_STATE if sensor is not STOPPED.
76100
*/
77101
boolean start(in OperationalMode operationalMode,
78102
in int noMotionSeconds,

sensor/current/com/rdk/hal/sensor/motion/hfp-sensor-motion.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,26 @@ sensor:
4141
supportsDeepSleepAutonomy: true # Capabilities.supportsDeepSleepAutonomy
4242

4343
# ========================================================================
44-
# OPERATIONAL CONFIGURATION (Platform-specific defaults and constraints)
44+
# PLATFORM DEFAULTS AND CAPABILITY DECLARATIONS
45+
#
46+
# These values declare the platform's factory defaults and supported
47+
# modes. They are NOT runtime configuration — actual runtime parameters
48+
# are set via IMotionSensor.start() and setActiveWindows().
49+
#
50+
# Used by:
51+
# - VTS test automation to validate against declared capabilities
52+
# - Middleware to query expected defaults without calling the HAL
53+
# - Documentation of platform-specific constraints
4554
# ========================================================================
46-
operational_modes:
55+
operational_modes: # Supported OperationalMode values
4756
- MOTION
4857
- NO_MOTION
49-
default_mode: MOTION
50-
timing:
58+
default_mode: MOTION # Factory default operational mode
59+
timing: # Factory default timing parameters for start()
5160
no_motion_seconds: 5 # Default inactivity window before NO_MOTION event
52-
active_start_seconds: 0 # Activation delay after start()
53-
active_stop_seconds: 0 # Continuous monitoring until stop()
54-
active_windows:
61+
active_start_seconds: 0 # Default activation delay (0 = immediate)
62+
active_stop_seconds: 0 # Default auto-stop (0 = no automatic stop)
63+
active_windows: # Factory default active windows (example values)
5564
# Example: Monitor during business hours (9am-5pm) and evening (8pm-10pm)
5665
- startTimeOfDaySeconds: 32400 # 09:00:00 (9 * 3600)
5766
endTimeOfDaySeconds: 61200 # 17:00:00 (17 * 3600)

sensor/current/com/rdk/hal/sensor/thermal/State.aidl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ enum State {
4444

4545
/**
4646
* @brief Shutdown is imminent due to critical thermal breach.
47+
*
48+
* The HAL thermal policy service initiates the shutdown autonomously.
49+
* Clients receiving this event via IThermalEventListener should
50+
* perform only time-critical cleanup (flush caches, persist critical
51+
* state) and must not attempt to manage the reboot themselves.
52+
*
53+
* The thermal HAL records the shutdown reason so that on the next boot
54+
* it can be reported by the Boot HAL via IBoot.getBootReason() as
55+
* BootReason.THERMAL_RESET.
4756
*/
4857
CRITICAL_SHUTDOWN_IMMINENT = 3
4958
}

0 commit comments

Comments
 (0)