1 /* 2 * Copyright (c) 2021 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 #ifndef SENSOR_CLIENT_ADAPTER_DEF_H 17 #define SENSOR_CLIENT_ADAPTER_DEF_H 18 19 #include <pthread.h> 20 21 #include <iproxy_client.h> 22 #include <iunknown.h> 23 #include "ipc_skeleton.h" 24 #include "samgr_lite.h" 25 #include "sensor_agent_type.h" 26 #include "serializer.h" 27 28 #ifdef __cplusplus 29 #if __cplusplus 30 extern "C" { 31 #endif 32 #endif 33 34 #define SENSOR_SERVICE "sensor_service" 35 #define SENSOR_FEATURE "sensor_feature" 36 #define MAX_DATA_LEN 0x100 37 #define IPC_MAX_OBJECTS 3 38 39 void *GetServiceProxy(); 40 int32_t GetAllSensorsByProxy(const void *proxy, SensorInfo **sensorInfo, int32_t *count); 41 int32_t ActivateSensorByProxy(const void *proxy, int32_t sensorId, const SensorUser *user); 42 int32_t DeactivateSensorByProxy(const void *proxy, int32_t sensorId, const SensorUser *user); 43 int32_t SetBatchByProxy(const void *proxy, int32_t sensorId, const SensorUser *user, int64_t samplingInterval, 44 int64_t reportInterval); 45 int32_t SubscribeSensorByProxy(const void *proxy, int32_t sensorId, const SensorUser *user); 46 int32_t UnsubscribeSensorByProxy(const void *proxy, int32_t sensorId, const SensorUser *user); 47 int32_t SetModeByProxy(const void *proxy, int32_t sensorId, const SensorUser *user, int32_t mode); 48 int32_t SetOptionByProxy(const void *proxy, int32_t sensorId, const SensorUser *user, int32_t option); 49 50 #ifdef __cplusplus 51 #if __cplusplus 52 } 53 #endif 54 #endif 55 #endif