• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 #ifndef ONLY_FIRST_WAKEUP_ENGINE_H
16 #define ONLY_FIRST_WAKEUP_ENGINE_H
17 
18 #include <string>
19 #include "base_macros.h"
20 #include "engine_base.h"
21 #include "only_first_wakeup_engine_impl.h"
22 
23 namespace OHOS {
24 namespace IntellVoiceEngine {
25 
26 class OnlyFirstWakeupEngine : public EngineBase {
27 public:
28     OnlyFirstWakeupEngine();
29     ~OnlyFirstWakeupEngine();
30     bool Init(const std::string &param, bool reEnroll = false) override;
SetCallback(sptr<IRemoteObject> object)31     void SetCallback(sptr<IRemoteObject> object) override {};
Attach(const IntellVoiceEngineInfo & info)32     int32_t Attach(const IntellVoiceEngineInfo &info) override {return 0;};
33     int32_t Detach(void) override;
Start(bool isLast)34     int32_t Start(bool isLast) override { return 0; };
35     int32_t SetParameter(const std::string &keyValueList) override;
36     std::string GetParameter(const std::string &key) override;
Stop()37     int32_t Stop() override { return 0; };
GetWakeupPcm(std::vector<uint8_t> & data)38     int32_t GetWakeupPcm(std::vector<uint8_t> &data) override { return 0; };
39 
40     void OnDetected(int32_t uuid) override;
41     void ReleaseAdapter() override;
42 
43     int32_t StartCapturer(int32_t channels) override;
44     int32_t Read(std::vector<uint8_t> &data) override;
45     int32_t StopCapturer() override;
NotifyHeadsetWakeEvent()46     int32_t NotifyHeadsetWakeEvent() override { return 0; };
NotifyHeadsetHostEvent(HeadsetHostEventType event)47     int32_t NotifyHeadsetHostEvent(HeadsetHostEventType event) override { return 0; };
48 
49 private:
50     void ResetSingleLevelWakeup(const std::string &value);
51     int32_t HandleCapturerMsg(StateMsg &msg);
52     USE_ROLE(OnlyFirstWakeupEngineImpl);
53 };
54 }
55 }
56 #endif