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
bool removeService(Service &svc)
The String class.
Definition: WString.h:136
Definition: Answer.h:17
Describes a basic service.
Definition: MDNS/src/include/Network/Mdns/Service.h:41
void end()
Stop the responder.
bool onMessage(Message &message) override
Used internally to process received query, but also handy for testing.
Iterator begin() const
Definition: LinkedObject.h:140
#define DECLARE_FSTR(name)
Declare a global FSTR::String& reference.
Definition: String.hpp:63
bool addService(Service &svc)
Add a service object.
Encapsulates a message packet for flexible introspection.
Definition: MDNS/src/include/Network/Mdns/Message.h:36