summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorChing-Kang Yen <chingkang@chromium.org>2020-10-14 15:57:21 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-13 06:29:13 +0000
commitb0f1017dd711f095efdac3db4c743e128c499056 (patch)
treef9c4218183062a4f37ddaf64b0ac6c4cd4ba2c83 /include/ec_commands.h
parent412ace563010211981c83f9063fb2e0ed9c6df3b (diff)
downloadchrome-ec-b0f1017dd711f095efdac3db4c743e128c499056.tar.gz
common: motion_sense: Add spoofing activity
make spoof command able to spoof activity state: ectool motionsense spoof -- NUM activity ACT [EN] [0/1] This commit also remove unused parameter |sensor_num| from list_activities, set_activity, get_activity in ectool. BRANCH=None BUG=b:123434029 TEST=buildall TEST=ectool motionsense spoof 4 activity 4 1 0 ectool motionsense spoof 4 activity 4 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 1 1 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 0 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 1 ectool motionsense get_activity 4 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: I819c156ae7fe50c5cf6216d0f44012d192fb528e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2477393 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 190f44f981..ebef2b69dd 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -2877,8 +2877,19 @@ struct ec_params_motion_sense {
/* Ignored, used for alignment. */
uint8_t reserved;
- /* Individual component values to spoof. */
- int16_t components[3];
+ union {
+ /* Individual component values to spoof. */
+ int16_t components[3];
+
+ /* Used when spoofing an activity */
+ struct {
+ /* enum motionsensor_activity */
+ uint8_t activity_num;
+
+ /* spoof activity state */
+ uint8_t activity_state;
+ };
+ };
} spoof;
/* Used for MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE. */