This repository has a bunch of small(ish) sample programs to help with starting-up a libupnpp-based project. Some of them may be useful in their own right but beware:
Note
|
none of the samples take a lot of care about managing memory because they’re of the 'run once and die' kind. Be careful about cleanup if you integrate bits of code in a longer-running program. |
The different samples are hopefully commented enough to be understandable and useful.
Just list all devices and services on the local network, using the simple libupnpp discovery 'traverse' method, which has to wait for the full discovery window.
Control the volume on an UPnP AV renderer, using the keyboard. This is a simple demonstration of using a predefined libupnpp control class to control a standard device. It uses discovery callbacks to connect to the device as soon as it responds to search.
This is functionally the same as rdcvolume, but it defines its own service control interface class. This is to show how you can do stuff without the predefined control classes, and use libupnpp to control an arbitrary UPnP device.
This shows how to implement a "Hello World" device/service and the corresponding control interface. Nothing in there that is not more interestingly implemented in upmpdcli, but it is as simple as possible, so certainly easier to understand.
A program to send an audio file to an UPnP AV renderer, without using a Media Server. Can also send a 44100/16/2 stream read on stdin as a wav file. The file description part (DIDL) is not too smart, but most renderers don’t seem to care. It uses libmicrohttpd to serve the audio file to the renderer. Possibly could be improved and find a use.
Has a whole bunch of more or less useful code snippets, accessing UPnP AV Media Server and Renderer services.