1 /* 2 * Copyright (c) 2024 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 INTENTION_STATIONARY_CLIENT_H 17 #define INTENTION_STATIONARY_CLIENT_H 18 19 #include <map> 20 21 #include "nocopyable.h" 22 23 #include "iremote_dev_sta_callback.h" 24 #include "stationary_params.h" 25 26 namespace OHOS { 27 namespace Msdp { 28 namespace DeviceStatus { 29 class StationaryClient final { 30 public: 31 StationaryClient() = default; 32 ~StationaryClient() = default; 33 DISALLOW_COPY_AND_MOVE(StationaryClient); 34 35 int32_t SubscribeCallback(Type type, ActivityEvent event, 36 ReportLatencyNs latency, sptr<IRemoteDevStaCallback> callback); 37 int32_t UnsubscribeCallback(Type type, ActivityEvent event, 38 sptr<IRemoteDevStaCallback> callback); 39 Data GetDeviceStatusData(Type type); 40 int32_t GetDevicePostureDataSync(DevicePostureData &data); 41 void OnConnected(); 42 43 private: 44 std::mutex mtx_; 45 std::map<Type, int32_t> typeMap_; 46 std::vector<SubscribeStationaryParam> subParams_; 47 }; 48 } // namespace DeviceStatus 49 } // namespace Msdp 50 } // namespace OHOS 51 #endif // INTENTION_STATIONARY_CLIENT_H 52