Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Simple Service Discovery Protocol (SSDP) #2114

Closed
wants to merge 2 commits into from

Conversation

slaff
Copy link
Contributor

@slaff slaff commented Oct 16, 2020

Initial implementation for service discovery in Sming. Can be used to announce service(s) and search based on searchType (deviceType). Comes with an example that demonstrates a simple workflow.

@slaff slaff added this to the 4.2.0 milestone Oct 16, 2020
@slaff slaff force-pushed the feature/component-ssdp branch from 38e2b25 to 17c4b3b Compare October 16, 2020 12:41
@slaff slaff requested a review from mikee47 October 16, 2020 12:41
@slaff
Copy link
Contributor Author

slaff commented Oct 16, 2020

@mikee47 Can you help me improve the memory usage in the SSDP component? I will use the proposed changes from you not only to improve this component but also to create a small document describing best practises in improving memory usage.

@slaff slaff force-pushed the feature/component-ssdp branch from 460ef50 to 337128e Compare October 16, 2020 14:12
@mikee47
Copy link
Contributor

mikee47 commented Oct 16, 2020

@slaff You may want to take a look at https://github.com/mikee47/Sming-UPnP which
incorporates an SSDP layer. I intentionally wrote it all with callbacks to keep memory usage down.

@slaff
Copy link
Contributor Author

slaff commented Oct 16, 2020

You may want to take a look at https://github.com/mikee47/Sming-UPnP

@mikee47 Let's merge your UpnP stuff then?

@mikee47
Copy link
Contributor

mikee47 commented Oct 16, 2020

@slaff OK, There's four separate libraries in Sming-UPnP: RapidXML, SSDP, UPnP and HueEmulator so I'll split them out with those names. Let me know if you'd prefer different ones?

@slaff
Copy link
Contributor Author

slaff commented Oct 16, 2020 via email

@mikee47 mikee47 mentioned this pull request Oct 17, 2020
6 tasks
@slaff slaff removed the 3 - Review label Oct 18, 2020
@slaff
Copy link
Contributor Author

slaff commented Oct 18, 2020

Closing in favour of the more advanced PR #2115.

@slaff slaff closed this Oct 18, 2020
@slaff slaff removed this from the 4.2.0 milestone Oct 18, 2020
slaff pushed a commit that referenced this pull request Oct 24, 2020
The framework contains three libraries:

* RapidXML: Parsing, serialising and de-serialising XML data
* SSDP: Simple Service Discovery Protocol server
* UPnP: Framework to build UPnP compliant device stacks. Written from scratch with reference to the documented standards. The `Basic_UPnP` sample gives an idea of what can be done. See the library README for further details,

The main purpose for this library was to provide an Alexa-compatible interface. It was important to provide a smooth end-user experience so that device discovery is reliable and painless. As such, device discovery and presentation is essentially complete, tested and working.

Also included is the `Basic_Alexa` sample with `HueEmulator` library.

Devices will appear in Windows explorer under 'Network'. You can find more comprehensive test tools at https://www.meshcommander.com/upnptools (Windows only - _Device Spy_ is the most interesting! See #2114 README for notes on testing in Linux.

Both samples will run in Host emulator mode.


Additional changes:

* Add `isLocal()` methods to AccessPoint & Station classes
* Add additional toString() functions/methods
* Make SMING_ARCH available to code and use it to generate Hue device names
* HTTP Headers
    Add `Accept` to standard header fields
    Move HTTP header field name handling into separate unit, and add BasicHttpHeaders
* Fix HTTP content type field parsing
    
    May contain spaces which must be removed, for example:
    
            CONTENT-TYPE: text/xml ; charset="utf-8"\r\n

    Also map `application/xml` (as well as `text/xml`) to `MIME_XML`

* Fix LimitedMemoryStream, and add `getStreamPointer` method
    
    Attempting to write data larger than available space discards all of it.
    Correct behaviour is to write as much as possible, but still discard the remainder.
    
    Also, seek operation (for reading) is now bi-directional between the start of the buffer and the current write position.
@slaff slaff deleted the feature/component-ssdp branch July 9, 2021 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants