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 SENSOR_SERVICE_PROXY_H
17 #define SENSOR_SERVICE_PROXY_H
18 
19 #include "errors.h"
20 #include "i_medical_sensor_service.h"
21 #include "iremote_proxy.h"
22 #include "nocopyable.h"
23 #include "medical_native_type.h"
24 
25 namespace OHOS {
26 namespace Sensors {
27 class MedicalSensorServiceProxy : public IRemoteProxy<IMedicalSensorService> {
28 public:
29     explicit MedicalSensorServiceProxy(const sptr<IRemoteObject> &impl);
30     virtual ~MedicalSensorServiceProxy() = default;
31     ErrCode EnableSensor(uint32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) override;
32     ErrCode DisableSensor(uint32_t sensorId) override;
33     ErrCode SetOption(uint32_t sensorId, uint32_t opt) override;
34     int32_t GetSensorState(uint32_t sensorId) override;
35     ErrCode RunCommand(uint32_t sensorId, uint32_t cmdType, uint32_t params) override;
36     std::vector<MedicalSensor> GetSensorList() override;
37     ErrCode TransferDataChannel(const sptr<MedicalSensorBasicDataChannel> &sensorBasicDataChannel,
38                                 const sptr<IRemoteObject> &sensorClient) override;
39     ErrCode DestroySensorChannel(sptr<IRemoteObject> sensorClient) override;
40 
41 private:
42     DISALLOW_COPY_AND_MOVE(MedicalSensorServiceProxy);
43     static inline BrokerDelegator<MedicalSensorServiceProxy> delegator_;
44 };
45 }  // namespace Sensors
46 }  // namespace OHOS
47 #endif  // SENSOR_SERVICE_PROXY_H
48