Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Could just call the delegate Connected ?
Browse files Browse the repository at this point in the history
mikee47 committed Nov 5, 2020
1 parent 706c34f commit cbb5515
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Sming/Libraries/DIAL/src/Dial/Client.cpp
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ int Client::onDescription(HttpConnection& connection, bool success)
return 0;
}

bool Client::connect(ConnectedCallback callback, const String& type)
bool Client::connect(Connected callback, const String& type)
{
if(!UPnP::deviceHost.begin()) {
debug_e("UPnP initialisation failed");
@@ -102,7 +102,7 @@ bool Client::connect(ConnectedCallback callback, const String& type)
return true;
}

bool Client::connect(const Url& descriptionUrl, ConnectedCallback callback)
bool Client::connect(const Url& descriptionUrl, Connected callback)
{
onConnected = callback;

8 changes: 4 additions & 4 deletions Sming/Libraries/DIAL/src/Dial/Client.h
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ DECLARE_FSTR(service_urn)
class Client : public UPnP::ControlPoint
{
public:
using ConnectedCallback = Delegate<void(Client&, const XML::Document& doc, const HttpHeaders& headers)>;
using Connected = Delegate<void(Client&, const XML::Document& doc, const HttpHeaders& headers)>;

Client(size_t maxDescriptionSize = 4096) : maxDescriptionSize(maxDescriptionSize)
{
@@ -51,7 +51,7 @@ class Client : public UPnP::ControlPoint
*
* @retval true when the connect request can be started
*/
virtual bool connect(ConnectedCallback callback, const String& type = nullptr);
virtual bool connect(Connected callback, const String& type = nullptr);

/**
* @brief Directly connects to a device's description xml URL.
@@ -61,7 +61,7 @@ class Client : public UPnP::ControlPoint
*
* @retval true when the connect request can be started
*/
bool connect(const Url& descriptionUrl, ConnectedCallback callback);
bool connect(const Url& descriptionUrl, Connected callback);

bool formatMessage(SSDP::Message& msg, SSDP::MessageSpec& ms) override;

@@ -89,7 +89,7 @@ class Client : public UPnP::ControlPoint
using AppMap = ObjectMap<String, App>;

size_t maxDescriptionSize; // <<< Maximum size of TV XML description that is stored.
ConnectedCallback onConnected;
Connected onConnected;

Url descriptionUrl;
Url applicationUrl;

0 comments on commit cbb5515

Please sign in to comment.