1 /*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "input_host_callback.h"
16 #include <iostream>
17 #include "hdf_log.h"
18
19 #define HDF_LOG_TAG InputReportEventCallback
20
21 namespace OHOS {
22 namespace Input {
ReportEventPkgCallback(const EventPackage * pkgs,uint32_t count,uint32_t devIndex)23 void InputReportEventCallback::ReportEventPkgCallback(const EventPackage *pkgs, uint32_t count, uint32_t devIndex)
24 {
25 HDF_LOGD("device action pkgs[%{public}p] = count:%{public}d", pkgs, count);
26 if (pkgs == NULL) {
27 HDF_LOGI("pkgs nulll,");
28 return;
29 }
30 for (uint32_t i = 0; i < count; i++) {
31 printf("device action pkgs[%u] = type:0x%x, code:0x%x, value:%d\n",
32 i, (pkgs + i)->type, (pkgs + i)->code, (pkgs + i)->value);
33 }
34 }
35
ReportHotPlugEventCallback(const HotPlugEvent * msg)36 void InputHostReportEventCallback::ReportHotPlugEventCallback(const HotPlugEvent *msg)
37 {
38 if (msg == NULL) {
39 return;
40 }
41 HDF_LOGD("hogplug action status =%{public}d devId=%{public}d type =%{public}d",
42 msg->status, msg->devIndex, msg->devType);
43 }
44 } // namespace Input
45 } // namespace OHOS
46