1 /* 2 * Copyright (c) 2022 Chipsea Technologies (Shenzhen) Corp., 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 I_SENSOR_SERVICE_H 17 #define I_SENSOR_SERVICE_H 18 19 #include <vector> 20 21 #include "errors.h" 22 #include "i_medical_sensor_client.h" 23 #include "iremote_broker.h" 24 #include "medical_sensor.h" 25 #include "medical_sensor_basic_data_channel.h" 26 27 namespace OHOS { 28 namespace Sensors { 29 class IMedicalSensorService : public IRemoteBroker { 30 public: 31 IMedicalSensorService() = default; 32 33 virtual ~IMedicalSensorService() = default; 34 35 DECLARE_INTERFACE_DESCRIPTOR(u"IMedicalSensorService"); 36 37 virtual ErrCode EnableSensor(uint32_t sensorId, int64_t samplingPeriodNs, 38 int64_t maxReportDelayNs) = 0; 39 40 virtual ErrCode DisableSensor(uint32_t sensorId) = 0; 41 42 virtual ErrCode SetOption(uint32_t sensorId, uint32_t opt) = 0; 43 44 virtual int32_t GetSensorState(uint32_t sensorId) = 0; 45 46 virtual ErrCode RunCommand(uint32_t sensorId, uint32_t cmdType, uint32_t params) = 0; 47 48 virtual std::vector<MedicalSensor> GetSensorList() = 0; 49 50 virtual ErrCode TransferDataChannel(const sptr<MedicalSensorBasicDataChannel> &sensorBasicDataChannel, 51 const sptr<IRemoteObject> &sensorClient) = 0; 52 53 virtual ErrCode DestroySensorChannel(sptr<IRemoteObject> sensorClient) = 0; 54 55 enum { 56 ENABLE_SENSOR = 0, 57 DISABLE_SENSOR, 58 GET_SENSOR_STATE, 59 RUN_COMMAND, 60 GET_SENSOR_LIST, 61 TRANSFER_DATA_CHANNEL, 62 DESTROY_SENSOR_CHANNEL, 63 SET_OPTION, 64 }; 65 }; 66 } // namespace Sensors 67 } // namespace OHOS 68 #endif // I_SENSOR_SERVICE_H 69