• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# IMotionInterface
2
3
4## 概述
5
6提供Motion设备基本控制操作接口。
7
8接口提供使能/去使能手势识别、订阅/取消订阅手势识别数据功能。
9
10**起始版本:** 3.2
11
12**相关模块:**[Motion](_motion_v10.md)
13
14
15## 汇总
16
17
18### Public 成员函数
19
20| 名称 | 描述 |
21| -------- | -------- |
22| [EnableMotion](#enablemotion) ([in] int motionType) | 使能手势识别。 |
23| [DisableMotion](#disablemotion) ([in] int motionType) | 去使能手势识别。 |
24| [Register](#register) ([in] [IMotionCallback](interface_i_motion_callback_v10.md) callbackObj) | 订阅者注册手势识别数据回调函数,如果注册成功,系统会将获取到的手势识别数据上报给订阅者。 |
25| [Unregister](#unregister) ([in] [IMotionCallback](interface_i_motion_callback_v10.md) callbackObj) | 订阅者取消注册手势识别数据回调函数。 |
26
27
28## 成员函数说明
29
30
31### DisableMotion()
32
33```
34IMotionInterface::DisableMotion ([in] int motionType)
35```
36
37**描述**
38
39去使能手势识别。
40
41**起始版本:** 3.2
42
43**参数:**
44
45| 名称 | 描述 |
46| -------- | -------- |
47| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion_v10.md#hdfmotiontypetag)。 |
48
49**返回:**
50
51如果操作成功,则返回0。
52
53如果操作失败,则返回负值。
54
55
56### EnableMotion()
57
58```
59IMotionInterface::EnableMotion ([in] int motionType)
60```
61
62**描述**
63
64使能手势识别。
65
66**起始版本:** 3.2
67
68**参数:**
69
70| 名称 | 描述 |
71| -------- | -------- |
72| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion_v10.md#hdfmotiontypetag)。 |
73
74**返回:**
75
76如果操作成功,则返回0。
77
78如果操作失败,则返回负值。
79
80
81### Register()
82
83```
84IMotionInterface::Register ([in] IMotionCallback callbackObj)
85```
86
87**描述**
88
89订阅者注册手势识别数据回调函数,如果注册成功,系统会将获取到的手势识别数据上报给订阅者。
90
91**起始版本:** 3.2
92
93**参数:**
94
95| 名称 | 描述 |
96| -------- | -------- |
97| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[IMotionCallback](interface_i_motion_callback_v10.md)。 |
98
99**返回:**
100
101如果注册回调函数成功,则返回0。
102
103如果注册回调函数失败,则返回负值。
104
105
106### Unregister()
107
108```
109IMotionInterface::Unregister ([in] IMotionCallback callbackObj)
110```
111
112**描述**
113
114订阅者取消注册手势识别数据回调函数。
115
116**起始版本:** 3.2
117
118**参数:**
119
120| 名称 | 描述 |
121| -------- | -------- |
122| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[IMotionCallback](interface_i_motion_callback_v10.md)。 |
123
124**返回:**
125
126如果取消注册回调函数成功,则返回0。
127
128如果取消注册回调函数失败,则返回负值。
129