From cbb551534c77f22e504d1ac096205befe96719d0 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Thu, 5 Nov 2020 23:11:04 +0000 Subject: [PATCH] Could just call the delegate `Connected` ? --- Sming/Libraries/DIAL/src/Dial/Client.cpp | 4 ++-- Sming/Libraries/DIAL/src/Dial/Client.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sming/Libraries/DIAL/src/Dial/Client.cpp b/Sming/Libraries/DIAL/src/Dial/Client.cpp index 997896cd28..a6f696e710 100644 --- a/Sming/Libraries/DIAL/src/Dial/Client.cpp +++ b/Sming/Libraries/DIAL/src/Dial/Client.cpp @@ -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; diff --git a/Sming/Libraries/DIAL/src/Dial/Client.h b/Sming/Libraries/DIAL/src/Dial/Client.h index f17ca12d87..30609cbe80 100644 --- a/Sming/Libraries/DIAL/src/Dial/Client.h +++ b/Sming/Libraries/DIAL/src/Dial/Client.h @@ -38,7 +38,7 @@ DECLARE_FSTR(service_urn) class Client : public UPnP::ControlPoint { public: - using ConnectedCallback = Delegate; + using Connected = Delegate; 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; size_t maxDescriptionSize; // <<< Maximum size of TV XML description that is stored. - ConnectedCallback onConnected; + Connected onConnected; Url descriptionUrl; Url applicationUrl;