Skip to content

Commit

Permalink
Merge branch 'user/corbinphipps/add-get_config-command' of 140.82.121…
Browse files Browse the repository at this point in the history
….3:microsoft/netremote into user/corbinphipps/add-get_config-command
  • Loading branch information
corbin-phipps committed Jul 2, 2024
2 parents 649d04e + e96130e commit caf24a1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
Binary file modified doc/docker-run-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/linux/wpa-controller/Hostapd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Hostapd::Hostapd(std::string_view interfaceName) :
throw HostapdException("Failed to create hostapd event handler control socket connection");
}

auto eventHandler{ std::make_unique<WpaEventHandler>(std::move(controlSocketConnection), WpaType::Hostapd) };
auto eventHandler{ std::make_shared<WpaEventHandler>(std::move(controlSocketConnection), WpaType::Hostapd) };
if (!eventHandler) {
throw HostapdException("Failed to create hostapd event handler");
}
Expand All @@ -66,6 +66,12 @@ Hostapd::GetInterface()
return m_interface;
}

std::shared_ptr<WpaEventHandler>
Hostapd::GetEventHandler() const noexcept
{
return m_eventHandler;
}

void
Hostapd::Ping()
{
Expand Down
10 changes: 9 additions & 1 deletion src/linux/wpa-controller/include/Wpa/Hostapd.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ struct Hostapd :
std::string_view
GetInterface() override;

/**
* @brief Obtain the event handler for the interface.
*
* @return std::shared_ptr<WpaEventHandler>
*/
std::shared_ptr<WpaEventHandler>
GetEventHandler() const noexcept override;

/**
* @brief Get the status for the interface.
*
Expand Down Expand Up @@ -279,7 +287,7 @@ private:
WpaController m_controller;
std::unique_ptr<WpaControlSocketConnection> m_eventHandlerControlSocketConnection{ nullptr };
std::shared_ptr<WpaEventListenerProxy> m_eventListenerProxy;
std::unique_ptr<WpaEventHandler> m_eventHandler{ nullptr };
std::shared_ptr<WpaEventHandler> m_eventHandler{ nullptr };
WpaEventListenerRegistrationToken m_eventHandlerRegistrationToken{};
};
} // namespace Wpa
Expand Down
9 changes: 9 additions & 0 deletions src/linux/wpa-controller/include/Wpa/IHostapd.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <Wpa/ProtocolHostapd.hxx>
#include <Wpa/ProtocolWpa.hxx>
#include <Wpa/WpaEventHandler.hxx>

namespace Wpa
{
Expand Down Expand Up @@ -90,6 +91,14 @@ struct IHostapd
virtual std::string_view
GetInterface() = 0;

/**
* @brief Obtain the event handler for the interface.
*
* @return std::shared_ptr<WpaEventHandler>
*/
virtual std::shared_ptr<WpaEventHandler>
GetEventHandler() const noexcept = 0;

/**
* @brief Get the status for the interface.
*
Expand Down

0 comments on commit caf24a1

Please sign in to comment.