Simon Dean 17d4bfbcda Backport LibGPS updates a79d155bd658eff85036f0d7d29486faac0bf3cc
Backport and merge artefacts from
a5cdf161ad1aefcda5425b5bef56032e1c510219
2025-01-08 18:09:54 +00:00

66 lines
2.3 KiB
C++

/*
* This file is part of openauto project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* openauto is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* openauto is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with openauto. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <aasdk/Channel/WifiProjection/WifiProjectionService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>
#include <boost/asio/io_service.hpp>
#include <aasdk/Messenger/IMessenger.hpp>
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
namespace f1x::openauto::autoapp::service::wifiprojection {
class WifiProjectionService :
public aasdk::channel::wifiprojection::IWifiProjectionServiceEventHandler,
public IService,
public std::enable_shared_from_this<WifiProjectionService> {
public:
WifiProjectionService(boost::asio::io_service &ioService, aasdk::messenger::IMessenger::Pointer messenger, configuration::IConfiguration::Pointer configuration);
void start() override;
void stop() override;
void pause() override;
void resume() override;
void fillFeatures(aap_protobuf::service::control::message::ServiceDiscoveryResponse &response) override;
void onChannelOpenRequest(const aap_protobuf::service::control::message::ChannelOpenRequest &request) override;
void onChannelError(const aasdk::error::Error &e) override;
void
onWifiCredentialsRequest(
const aap_protobuf::service::wifiprojection::message::WifiCredentialsRequest &request) override;
private:
using std::enable_shared_from_this<WifiProjectionService>::shared_from_this;
configuration::IConfiguration::Pointer configuration_;
boost::asio::deadline_timer timer_;
boost::asio::io_service::strand strand_;
aasdk::channel::wifiprojection::WifiProjectionService::Pointer channel_;
};
}