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