39 #ifndef _PLT_DEVICE_HOST_H_ 40 #define _PLT_DEVICE_HOST_H_ 87 const char* uuid =
"",
88 const char* device_type =
"",
89 const char* friendly_name =
"",
92 bool port_rebind =
false);
95 virtual void SetExtraBroadcast(
bool broadcast) { m_ExtraBroascast = broadcast; }
104 virtual void SetByeByeFirst(
bool bye_bye_first) { m_ByeByeFirst = bye_bye_first; }
110 virtual NPT_UInt16
GetPort() {
return m_Port; };
140 PLT_SsdpAnnounceType type);
150 PLT_SsdpAnnounceType type) {
151 return Announce(
this, request, socket, type);
205 const char* fileroot,
206 const char* urlroot =
"/");
332 bool m_ExtraBroascast;
The PLT_SsdpDeviceAnnounceTask class is a task to send UPnP Device SSDP announcements (alive or byeby...
Definition: PltSsdp.h:230
Definition: NptHttp.h:566
virtual NPT_Result ProcessGetSCPD(PLT_Service *service, NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response)
This method is called when a control point is requesting a service SCPD.
Definition: PltDeviceHost.cpp:463
static NPT_Result SendSsdpSearchResponse(PLT_DeviceData *device, NPT_HttpResponse &response, NPT_UdpSocket &socket, const char *st, const NPT_SocketAddress *addr=NULL)
Static method similar to SendSsdpSearchResponse.
Definition: PltDeviceHost.cpp:853
The PLT_SsdpAnnounceInterfaceIterator class is used to send SSDP announcements given a list of networ...
Definition: PltSsdp.h:183
virtual NPT_Result Stop(PLT_SsdpListenTask *task)
Called by PLT_TaskManager when the device is stoped.
Definition: PltDeviceHost.cpp:227
virtual NPT_Result SetupServices()=0
Required method for setting up UPnP services of device host (and any embedded).
Definition: NptHttp.h:315
Definition: NptHttp.h:282
The PLT_UPnP class maintains a list of devices (PLT_DeviceHost) to advertise and/or control points (P...
Definition: PltUPnP.h:68
virtual NPT_Result ProcessHttpPostRequest(NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response)
This method is called when a "POST" request has been received.
Definition: PltDeviceHost.cpp:487
virtual NPT_Result ProcessGetDescription(NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response)
This method is called when a control point is requesting the device description.
Definition: PltDeviceHost.cpp:441
The PLT_SsdpDeviceSearchResponseInterfaceIterator class looks for the best network interface to use t...
Definition: PltSsdp.h:132
The PLT_SsdpListenTask class is used to listen for incoming SSDP packets and keep track of a list of ...
Definition: PltSsdp.h:310
Definition: NptHttp.h:593
The PLT_DeviceIcon class represents a given instance of a UPnP device icon.
Definition: PltDeviceData.h:63
UPnP Service.
Definition: PltService.h:67
NPT_Result SetupResponse(NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response) override
NPT_HttpRequestHandler method for setting up the response of an incoming HTTP request.
Definition: PltDeviceHost.cpp:387
static NPT_Result Announce(PLT_DeviceData *device, NPT_HttpRequest &request, NPT_UdpSocket &socket, PLT_SsdpAnnounceType type)
Static method similar to Announce.
Definition: PltDeviceHost.cpp:262
NPT_Result OnSsdpPacket(const NPT_HttpRequest &request, const NPT_HttpRequestContext &context) override
PLT_SsdpPacketListener method called when a M-SEARCH SSDP packet is received.
Definition: PltDeviceHost.cpp:795
Definition: NptSockets.h:77
The PLT_SsdpDeviceSearchResponseTask class is used by a PLT_DeviceHost to respond to SSDP M-SEARCH re...
Definition: PltSsdp.h:156
virtual NPT_Result SetupDevice()
Default implementation for setting up device host.
Definition: PltDeviceHost.cpp:157
virtual NPT_UInt16 GetPort()
Returns the port used by the internal HTTP server for all incoming requests.
Definition: PltDeviceHost.h:110
virtual NPT_Result OnAction(PLT_ActionReference &action, const PLT_HttpRequestContext &context)
This mehod is called when an action performed by a control point has been received and needs to be an...
Definition: PltDeviceHost.cpp:947
The PLT_SsdpPacketListener class is an interface for handling SSDP packets (M-SEARCH and NOTIFY)...
Definition: PltSsdp.h:70
virtual NPT_Result SetupIcons()
Default implementation for registering device icon resources.
Definition: PltDeviceHost.cpp:134
virtual NPT_Result Start(PLT_SsdpListenTask *task)
Called by PLT_TaskManager when the device is started.
Definition: PltDeviceHost.cpp:168
virtual NPT_Result SendSsdpSearchResponse(NPT_HttpResponse &response, NPT_UdpSocket &socket, const char *st, const NPT_SocketAddress *addr=NULL)
Called by PLT_SsdpDeviceSearchResponseTask when responding to a M-SEARCH SSDP request.
Definition: PltDeviceHost.h:185
PLT_DeviceHost(const char *description_path="/", const char *uuid="", const char *device_type="", const char *friendly_name="", bool show_ip=false, NPT_UInt16 port=0, bool port_rebind=false)
Creates a new instance of UPnP Device Host.
Definition: PltDeviceHost.cpp:59
The PLT_DeviceData class holds information about a device being advertised or found by a control poin...
Definition: PltDeviceData.h:93
UPnP Device Host.
Definition: PltDeviceHost.h:69
virtual NPT_Result ProcessHttpGetRequest(NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response)
This method is called when a "GET" request for a resource other than the device description, SCPD, or icons has been received.
Definition: PltDeviceHost.cpp:426
virtual void SetByeByeFirst(bool bye_bye_first)
When a UPnP device comes up, the specifications require that a SSDP bye-bye sequence is sent to force...
Definition: PltDeviceHost.h:104
NPT_Result Announce(NPT_HttpRequest &request, NPT_UdpSocket &socket, PLT_SsdpAnnounceType type)
Called during SSDP announce.
Definition: PltDeviceHost.h:148
virtual NPT_Result ProcessHttpSubscriberRequest(NPT_HttpRequest &request, const NPT_HttpRequestContext &context, NPT_HttpResponse &response)
This method is called when a request from a subscriber has been received.
Definition: PltDeviceHost.cpp:708
The PLT_HttpRequestContext class holds information about the request sent, the local & remote ip addr...
Definition: PltHttp.h:111
NPT_Result SetLeaseTime(NPT_TimeInterval lease_time)
Sets the lease time.
Definition: PltDeviceHost.h:116
Definition: NptSockets.h:243
virtual NPT_Result AddIcon(const PLT_DeviceIcon &icon, const char *fileroot, const char *urlroot="/")
Add UPnP icon information to serve from file system.
Definition: PltDeviceHost.cpp:99
Definition: PltUPnP.cpp:113
Definition: PltUPnP.cpp:88