* Update ESP8266SSDP.h
Fix SSDP bug: The response to M-Search Packet with ST field set to UUID should be with the UUID not the Device Type
Integrated 'uuid:' prefix into the char array of the _uuid
* Update ESP8266SSDP.cpp
Fix SSDP bug: The response to M-Search Packet with ST field set to UUID should be with the UUID not the Device Type
Integrated 'uuid:' prefix into the char array of the _uuid
* include 'uuid:' in format String and in flash
* Update ESP8266SSDP.cpp
* Release referenced resources in destructor
* Release referenced resources in destructor, corrected for IPV6
* Release referenced resources in destructor, per suggested changes
I recently starting playing around with a few esp8266-01s and tried to use the SSDP libraries to work with Smarthings discovery:
https://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/building-lan-connected-device-types/building-the-service-manager.html
on the docs there are example grovy files that do simple service discovery, i was not able to get SSDP to work correctly, though i was able to find some other projects that did (python fauxmo works for alexa, but with modifications i was able to make it work for custom devices in ST).
after digging to figure out why the python code was working and the ESP SSDP lib was not i noticed there is a string comparison in the grovy file and it was failing to match the udn with the original usn device id. The ST groovy code could be changed to remedy this problem but i wonder if it should be fixed here, because so many other examples of SSDP discovery take care in ensuring the usn and udn match exactly.
___________
Summary, I think the USN and UDN values should match exactly. This will fix issues, allowing for much easier integration with smart hubs that need the device ids to match. Allowing me to use these libraries and not need to roll a custom SSDP handler.
* ifndef'd LWIP_OPEN_SRC to prevent a redefined warning
* ABORT on NOTIFY to prevent responding to NOTIFY messages (we should only respond to M-SEARCH messages)
* case-insensitive compare of _deviceType to enable response to all-lowercase Alexa queries (robustness principle)
Previously, the notify template and and response templates had a
hardcoded NT (or ST) of upnp:root device. They now include the
deviceType that is set in initialization.
also a small formatting fix. this should now allow the system to
actually respond to SSDP discoveries that are issued on the network ...
i'm still not 100% certain if this is right due to the way that the
switch() statement is setup; it could be processing more than it should
* can now specify the TTL programmatically
* can now define the device type urn (up to 64 chars)
** still defaults to `Basic:1`
* can now set the serial number using a `uint32_t`, formatted as %08X