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 42**起始版本:** 3.2 43 44**参数:** 45 46| 名称 | 描述 | 47| -------- | -------- | 48| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion_v10.md#hdfmotiontypetag)。 | 49 50**返回:** 51 52如果操作成功,则返回0。 53 54如果操作失败,则返回负值。 55 56 57### EnableMotion() 58 59``` 60IMotionInterface::EnableMotion ([in] int motionType) 61``` 62 63**描述** 64 65 66使能手势识别。 67 68**起始版本:** 3.2 69 70**参数:** 71 72| 名称 | 描述 | 73| -------- | -------- | 74| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion_v10.md#hdfmotiontypetag)。 | 75 76**返回:** 77 78如果操作成功,则返回0。 79 80如果操作失败,则返回负值。 81 82 83### Register() 84 85``` 86IMotionInterface::Register ([in] IMotionCallback callbackObj) 87``` 88 89**描述** 90 91 92订阅者注册手势识别数据回调函数,如果注册成功,系统会将获取到的手势识别数据上报给订阅者。 93 94**起始版本:** 3.2 95 96**参数:** 97 98| 名称 | 描述 | 99| -------- | -------- | 100| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[IMotionCallback](interface_i_motion_callback_v10.md)。 | 101 102**返回:** 103 104如果注册回调函数成功,则返回0。 105 106如果注册回调函数失败,则返回负值。 107 108 109### Unregister() 110 111``` 112IMotionInterface::Unregister ([in] IMotionCallback callbackObj) 113``` 114 115**描述** 116 117 118订阅者取消注册手势识别数据回调函数。 119 120**起始版本:** 3.2 121 122**参数:** 123 124| 名称 | 描述 | 125| -------- | -------- | 126| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[IMotionCallback](interface_i_motion_callback_v10.md)。 | 127 128**返回:** 129 130如果取消注册回调函数成功,则返回0。 131 132如果取消注册回调函数失败,则返回负值。 133