• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 
16 #include "sensor_client_info.h"
17 #include "sensor_uhdf_log.h"
18 
19 #define HDF_LOG_TAG client
20 
21 namespace OHOS {
22 namespace HDI {
23 namespace Sensor {
24 namespace V3_0 {
25 
SensorClientInfo()26 SensorClientInfo::SensorClientInfo()
27 {
28 }
29 
~SensorClientInfo()30 SensorClientInfo::~SensorClientInfo()
31 {
32     sensorConfigMap_.clear();
33     periodCountMap_.clear();
34     curCountMap_.clear();
35 }
36 
SetReportDataCb(const sptr<V3_0::ISensorCallback> & callbackObj)37 void SensorClientInfo::SetReportDataCb(const sptr<V3_0::ISensorCallback> &callbackObj)
38 {
39     callbackObj_ = callbackObj;
40 }
41 
PrintClientMapInfo(int32_t serviceId,SensorHandle sensorHandle)42 void SensorClientInfo::PrintClientMapInfo(int32_t serviceId, SensorHandle sensorHandle)
43 {
44     HDF_LOGD("%{public}s: service = %{public}d, sensorHandle = %{public}s, curCount/periodCount = "
45              "%{public}d/%{public}d", __func__, serviceId, SENSOR_HANDLE_TO_C_STR(sensorHandle),
46              curCountMap_[sensorHandle], periodCountMap_[sensorHandle]);
47 }
48 
49 } // V3_0
50 } // Sensor
51 } // HDI
52 } // OHOS