Responder.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Responder.h
8  *
9  ****/
10 
11 #pragma once
12 
13 #include "Service.h"
14 #include "Server.h"
15 
16 namespace mDNS
17 {
21 DECLARE_FSTR(fstrServicesLocal)
22 
23 class Responder : public Handler
24 {
25 public:
31  bool begin(const String& hostname);
32 
38  void end();
39 
48  bool addService(Service& svc);
49 
50  bool removeService(Service& svc);
51 
55  bool onMessage(Message& message) override;
56 
57 private:
58  String hostname;
59  Service::List services;
60 };
61 
62 } // namespace mDNS
The String class.
Definition: WString.h:137
Virtual base class used for chaining message handlers.
Definition: MDNS/src/include/Network/Mdns/Handler.h:22
Encapsulates a message packet for flexible introspection.
Definition: MDNS/src/include/Network/Mdns/Message.h:29
Special name for querying list of services.
Definition: Responder.h:24
bool onMessage(Message &message) override
Used internally to process received query, but also handy for testing.
bool removeService(Service &svc)
bool begin(const String &hostname)
Initialise the responder.
bool addService(Service &svc)
Add a service object.
void end()
Stop the responder.
Describes a basic service.
Definition: MDNS/src/include/Network/Mdns/Service.h:34
#define DECLARE_FSTR(name)
Declare a global FSTR::String& reference.
Definition: String.hpp:63
Definition: Answer.h:18