1 /* 2 * Copyright (C) 2021-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 #ifndef WIFI_SYSTEM_TIMER_H 17 #define WIFI_SYSTEM_TIMER_H 18 19 #ifndef OHOS_ARCH_LITE 20 #include <cstdint> 21 #include <functional> 22 #include <string> 23 #include <sys/time.h> 24 #include <vector> 25 #include "time_service_client.h" 26 #include "itimer_info.h" 27 #include "timer.h" 28 29 namespace OHOS { 30 namespace Wifi { 31 class WifiSysTimer : public MiscServices::ITimerInfo { 32 public: 33 WifiSysTimer(); 34 WifiSysTimer(bool repeat, uint64_t interval, bool isNoWakeUp, bool isIdle = false); 35 virtual ~WifiSysTimer(); 36 void OnTrigger() override; 37 void SetType(const int &type) override; 38 void SetRepeat(bool repeat) override; 39 void SetInterval(const uint64_t &interval) override; 40 void SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> _wantAgent) override; 41 void SetCallbackInfo(const std::function<void()> &callBack); 42 private: 43 std::function<void()> callBack_ = nullptr; 44 }; 45 46 } // namespace Wifi 47 } // namespace OHOS 48 #endif 49 #endif // WIFI_SYSTEM_TIMER_H