1# InputReporter 2 3 4## 概述 5 6提供Input设备数据上报相关的接口。 7 8此类接口包含Input设备的数据上报回调函数的注册和注销。 9 10**起始版本:** 1.0 11 12**相关模块:**[Input](_input.md) 13 14 15## 汇总 16 17 18### Public 属性 19 20| 名称 | 描述 | 21| -------- | -------- | 22| int32_t(\* [RegisterReportCallback](#registerreportcallback) )(uint32_t devIndex, [InputEventCb](_input_event_cb.md) \*callback) | 注册对应设备的回调函数。 | 23| int32_t(\* [UnregisterReportCallback](#unregisterreportcallback) )(uint32_t devIndex) | 注销对应设备的回调函数。 | 24| int32_t(\* [RegisterHotPlugCallback](#registerhotplugcallback) )([InputHostCb](_input_host_cb.md) \*callback) | 注册Input设备的热插拔回调函数。 | 25| int32_t(\* [UnregisterHotPlugCallback](#unregisterhotplugcallback) )(void) | 注销Input设备的热插拔回调函数。 | 26 27 28## 类成员变量说明 29 30 31### RegisterHotPlugCallback 32 33``` 34int32_t(* InputReporter::RegisterHotPlugCallback) (InputHostCb *callback) 35``` 36**描述** 37注册Input设备的热插拔回调函数。 38 39Input服务通过此接口注册回调函数到hdi中,所有Input设备由此函数进行热插拔事件上报。 40 41**起始版本:** 1.0 42 43**参数:** 44 45| 名称 | 描述 | 46| -------- | -------- | 47| callback | 输入参数,回调函数的函数指针。 | 48 49**返回:** 50 51INPUT_SUCCESS 表示执行成功。 52 53其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 54 55 56### RegisterReportCallback 57 58``` 59int32_t(* InputReporter::RegisterReportCallback) (uint32_t devIndex, InputEventCb *callback) 60``` 61**描述** 62注册对应设备的回调函数。 63 64Input服务通过此接口注册数据回调函数到hdi中,hdi通过此回调函数上报Input事件。 65 66**起始版本:** 1.0 67 68**参数:** 69 70| 名称 | 描述 | 71| -------- | -------- | 72| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 73| callback | 输入参数,回调函数的函数指针。 | 74 75**返回:** 76 77INPUT_SUCCESS 表示执行成功。 78 79其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 80 81 82### UnregisterHotPlugCallback 83 84``` 85int32_t(* InputReporter::UnregisterHotPlugCallback) (void) 86``` 87**描述** 88注销Input设备的热插拔回调函数。 89 90**起始版本:** 1.0 91 92**参数:** 93 94| 名称 | 描述 | 95| -------- | -------- | 96| 无。 | | 97 98**返回:** 99 100INPUT_SUCCESS 表示执行成功。 101 102其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 103 104 105### UnregisterReportCallback 106 107``` 108int32_t(* InputReporter::UnregisterReportCallback) (uint32_t devIndex) 109``` 110**描述** 111注销对应设备的回调函数。 112 113**起始版本:** 1.0 114 115**参数:** 116 117| 名称 | 描述 | 118| -------- | -------- | 119| devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 120 121**返回:** 122 123INPUT_SUCCESS 表示执行成功。 124 125其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 126