mUPnP for C
|
#include <mupnp/typedef.h>
#include <mupnp/xml/xml.h>
#include <mupnp/util/list.h>
#include <mupnp/util/string.h>
#include <mupnp/util/mutex.h>
#include <mupnp/util/thread.h>
#include <mupnp/http/http.h>
#include <mupnp/net/url.h>
#include <mupnp/net/interface.h>
#include <mupnp/service.h>
#include <mupnp/icon.h>
#include <mupnp/ssdp/ssdp_server.h>
Data Structures | |
struct | _mUpnpDevice |
The generic UPnP device structure. More... | |
Typedefs | |
typedef void(* | MUPNP_PRESENTATION_LISTNER) (mUpnpHttpRequest *) |
typedef struct _mUpnpDevice | mUpnpDevice |
The generic UPnP device structure. | |
typedef struct _mUpnpDevice | mUpnpDeviceList |
#define MUPNP_DEVICE_DEFAULT_DESCRIPTION_URI "/description.xml" |
Definition for default description file "location"
#define MUPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME 500 |
Definition for default device discovery wait time
#define MUPNP_DEVICE_DEFAULT_LEASE_TIME (30 * 60) |
Definition for default device lease time
#define MUPNP_DEVICE_DEFAULT_PRESENTATION_URI "/presentation" |
Definition for default presentation URL"
#define MUPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME 1000 |
Definition for default device start up wait time
#define MUPNP_DEVICE_DEVICE_TYPE "deviceType" |
Definition for device type XML element name
#define MUPNP_DEVICE_ELEM_NAME "device" |
Definition for device XML element name
#define MUPNP_DEVICE_FRIENDLY_NAME "friendlyName" |
Definition for device friendly name XML element name
#define mupnp_device_getaddress | ( | dev | ) |
Get the device associated to the given service
service | The service in question Get the root device of the given service |
service | The service in question Get the device's address from SSDP packet |
dev | The device in question |
#define mupnp_device_getadvertiserthead | ( | dev | ) |
Get the advertiser thread from the device
dev | The device in question |
#define mupnp_device_getbootid | ( | dev | ) |
Get the device's boot id
dev | Device in question |
#define mupnp_device_getdescriptionuri | ( | dev | ) |
Get the device's description URI
dev | Device in question |
#define mupnp_device_getdevice | ( | dev, | |
idx ) |
Find a certain device from the given device list
dev | Device in question |
idx | Device index number in list |
#define mupnp_device_getdevicelist | ( | dev | ) |
Get the device's internal device list
dev | Device in question |
#define mupnp_device_getdevicenode | ( | dev | ) |
Return the device XML description node
dev | Device in question |
#define mupnp_device_getdevices | ( | dev | ) |
#define mupnp_device_getdevicetype | ( | dev | ) |
Return the device type
dev | Device in question |
#define mupnp_device_getfriendlyname | ( | dev | ) |
Return the device's friendly name.
dev | Device in question |
#define mupnp_device_gethttplistener | ( | dev | ) |
Get the device's HTTP listener function
dev | The device in question |
#define mupnp_device_gethttpport | ( | dev | ) |
Get the device's HTTP port
dev | The device in question |
#define mupnp_device_gethttpserverlist | ( | dev | ) |
Get the HTTP server list
dev | The device in question |
#define mupnp_device_geticon | ( | dev, | |
idx ) |
Get an icon by its index from the device's list of icons
dev | Device in question |
idx | Icon index number |
#define mupnp_device_geticonlist | ( | dev | ) |
Get the device's list of icons
dev | Device in question |
#define mupnp_device_geticons | ( | dev | ) |
#define mupnp_device_getinterfaceaddressfromssdppacket | ( | dev | ) |
Extract the interface address from the device's SSDP packet
dev | The device in question |
#define mupnp_device_getleasetime | ( | dev | ) |
Get the device's lease time. See mupnp_device_setleasetime.
dev | Device in question |
#define mupnp_device_getlocationfromssdppacket | ( | dev | ) |
Extract location information from the device's SSDP packet
dev | The device in question |
#define mupnp_device_getmanufacturer | ( | dev | ) |
Get the device's manufacturer.
dev | Device in question |
#define mupnp_device_getmanufacturerurl | ( | dev | ) |
Get the device's manufacturer URL
dev | Device in question |
#define mupnp_device_getmodeldescription | ( | dev | ) |
Get the device model description
dev | Device in question |
#define mupnp_device_getmodelname | ( | dev | ) |
Get the device's model name
dev | Device in question |
#define mupnp_device_getmodelnumber | ( | dev | ) |
Get the device's model number
dev | Device in question |
#define mupnp_device_getmodelurl | ( | dev | ) |
Get the device's model URL
dev | Device in question |
#define mupnp_device_getnservices | ( | dev | ) |
Get the number of services known by the device
dev | Device in question |
#define mupnp_device_getparentdevice | ( | dev | ) |
Return the device's parent device
dev | Device in question |
#define mupnp_device_getpresentationlistener | ( | dev | ) |
Get the device's presentation listener function
dev | The device in question |
#define mupnp_device_getpresentationurl | ( | dev | ) |
Get the device's presentation URL
dev | Device in question |
#define mupnp_device_getrootnode | ( | dev | ) |
Return the device's root node
dev | Device in question |
#define mupnp_device_getserialnumber | ( | dev | ) |
Get the device's model number
dev | Device in question |
#define mupnp_device_getservice | ( | dev, | |
idx ) |
Get a service from <idx> from the device
dev | Device in question |
idx | Device index number |
#define mupnp_device_getservicelist | ( | dev | ) |
Get the device's list of services
dev | Device in question |
#define mupnp_device_getservices | ( | dev | ) |
#define mupnp_device_getssdppacket | ( | dev | ) |
Get the device's SSDP packet
dev | The device in question |
#define mupnp_device_getssdpserverlist | ( | dev | ) |
Get the device's list of SSDP servers
dev | The device in question |
Get the SSDP server list
dev | The device in question |
#define mupnp_device_getssdpserverlist | ( | dev | ) |
Get the device's list of SSDP servers
dev | The device in question |
Get the SSDP server list
dev | The device in question |
#define mupnp_device_getudn | ( | dev | ) |
Get the device's Unique Device Name (UDN)
dev | Device in question |
#define mupnp_device_getupc | ( | dev | ) |
Get the device's Universal Product Code (UPC)
dev | Device in question |
#define mupnp_device_geturlbase | ( | dev | ) |
Get the device's base URL. The base URL is the root for all relative URLs.
dev | Device in question |
#define mupnp_device_getuserdata | ( | dev | ) |
Get device's user data pointer
dev | Device in question |
#define mupnp_device_hasudn | ( | dev | ) |
Check whether the device has a Unique Device Name (UDN)
dev | Device in question |
#define MUPNP_DEVICE_HTTP_DEFAULT_PORT 38400 |
Definition for default device HTTP port
#define mupnp_device_isdescriptionuri | ( | dev, | |
url ) |
Check, whether the given URL matches the device's description URI
dev | Device in question |
url | Description URL to check |
#define mupnp_device_isdevicenode | ( | node | ) |
Check whether the given node is of type MUPNP_DEVICE_ELEM_NAME
node | mUpnpXmlAttribute |
#define mupnp_device_isdevicetype | ( | dev, | |
value ) |
Check, whether the device is of the exact specified type (including version)
dev | Device in question |
value | Device type |
#define mupnp_device_isrootdevice | ( | dev | ) |
Check whether the given device contains a list of root nodes i.e. is it the root device
dev | Device in question |
#define mupnp_device_lock | ( | dev | ) |
Lock the device's mutex (grant exclusive access to the device) until mupnp_device_unlock is called.
dev | Device in question |
#define MUPNP_DEVICE_M_SEARCH_FILTER_INTERVAL 15 |
Definition for M-SEARCH filter interval
#define MUPNP_DEVICE_MANUFACTURER "manufacturer" |
Definition for device manufacturer XML element name
#define MUPNP_DEVICE_MANUFACTURER_URL "manufacturerURL" |
Definition for manufacturer URL XML element name
#define MUPNP_DEVICE_MODEL_DESCRIPTION "modelDescription" |
Definition for device model description XML element name
#define MUPNP_DEVICE_MODEL_NAME "modelName" |
Definition fo device model name XML element name
#define MUPNP_DEVICE_MODEL_NUMBER "modelNumber" |
Definition for device model number XML element name
#define MUPNP_DEVICE_MODEL_URL "modelURL" |
Definition for device model URL XML element name
#define mupnp_device_next | ( | dev | ) |
Get the next device in the device list. Use as an iterator.
dev | Current device |
#define MUPNP_DEVICE_PRESENTATION_URL "presentationURL" |
Definition for device presentation URL XML element name
#define mupnp_device_remove | ( | dev | ) |
Remove the device from the device list.
dev | Device in question |
#define mupnp_device_removepresentationurl | ( | dev | ) |
Remove the device's presentation URL
dev | Device in question |
#define MUPNP_DEVICE_SERIAL_NUMBER "serialNumber" |
Definition for device serial number XML element name
#define mupnp_device_setbootid | ( | dev, | |
value ) |
Modify the device's boot id
dev | Device in question |
value | The boot id |
#define mupnp_device_setdescriptionuri | ( | dev, | |
url ) |
Set the given URL as the device's description URI
dev | Device in question |
url | Description URL |
#define mupnp_device_setdevicetype | ( | dev, | |
value ) |
Modify the device type.
dev | Device in question |
value | Type to set |
#define mupnp_device_setfriendlyname | ( | dev, | |
value ) |
Modify the device's friendly name.
dev | Device in question |
value | The friendly name |
#define mupnp_device_sethttplistener | ( | dev, | |
func ) |
Set an HTTP listener function to the device
dev | The device in question |
func | The listener function |
#define mupnp_device_sethttpport | ( | dev, | |
value ) |
Modify the port that the device's HTTP server is listening
dev | The device in question |
value | Port number |
#define mupnp_device_setleasetime | ( | dev, | |
value ) |
Set the device's lease time. The lease time is basically the maximum amount of time that can elapse before an advertisement is broadcast again. It does not set the exact advertisement interval, but rather a time window for each advertisement. Advertisement actually occurs at (more or less) random intervals inside this time window.
dev | Device in question |
value | Lease time in seconds |
#define mupnp_device_setmanufacturer | ( | dev, | |
value ) |
Modify the device's manufacturer.
dev | Device in question |
value | The manufacturer's name |
#define mupnp_device_setmanufacturerurl | ( | dev, | |
value ) |
Modify the device's manufacturer URL
dev | Device in question |
value | The manufacturer URL |
#define mupnp_device_setmodeldescription | ( | dev, | |
value ) |
Modify the device model description
dev | Device in question |
value | The device model description |
#define mupnp_device_setmodelname | ( | dev, | |
value ) |
Modify the device's model name
dev | Device in question |
value | The model name |
#define mupnp_device_setmodelnumber | ( | dev, | |
value ) |
Modify the device's model number
dev | Device in question |
value | The model number |
#define mupnp_device_setmodelurl | ( | dev, | |
value ) |
Modify the device's model URL
dev | Device in question |
value | The model URL |
#define mupnp_device_setparentdevice | ( | dev, | |
pDev ) |
Set a parent device for the given child device
dev | Child device |
pDev | Parent device |
#define mupnp_device_setpresentationurl | ( | dev, | |
value ) |
Modify the device's presentation URL
dev | Device in question |
value | The presentation URL |
#define mupnp_device_setserialnumber | ( | dev, | |
value ) |
Modify the device's serial number
dev | Device in question |
value | The serial number |
#define mupnp_device_setssdppacket | ( | dev, | |
srcSsdpPkt ) |
Modify the device's SSDP packet (creates a copy of the original)
dev | The device in question |
srcSsdpPkt | The SSDP packet |
#define mupnp_device_setudn | ( | dev, | |
value ) |
Modify the device's Unique Device Name (UDN)
dev | Device in question |
value | The Unique Device Name |
#define mupnp_device_setupc | ( | dev, | |
value ) |
Modify the device's Universal Product Code (UPC)
dev | Device in question |
value | The Universal Product Code |
#define mupnp_device_setuserdata | ( | dev, | |
value ) |
Set device's user data pointer
dev | Device in question |
value | User data pointer |
#define MUPNP_DEVICE_UDN "UDN" |
Definition for device UDN XML element name
#define mupnp_device_unlock | ( | dev | ) |
Unlock the device's mutex (release exclusive access to the device) locked previously with mupnp_device_lock.
dev | Device in question |
#define MUPNP_DEVICE_UPC "UPC" |
Definition for device UPC XML element name
#define MUPNP_DEVICE_UPNP_ROOTDEVICE "upnp:rootdevice" |
Definition for UPnP rootdevice ID
#define MUPNP_DEVICE_URLBASE_MAXLEN 64 |
Definition for maximum URL base length
#define MUPNP_DEVICE_URLBASE_NAME "URLBase" |
Definition for urlbase XML element name
#define mupnp_device_waitforlock | ( | dev, | |
t ) |
Lock the device's mutex with timeout, return true if exclusive access is gained Release lock with mupnp_device_unlock is called.
dev | Device in question |
t | timeout in ms |
#define mupnp_devicelist_add | ( | devList, | |
dev ) |
Add a device to the device list
devList | The device list |
dev | The device to add |
#define mupnp_devicelist_clear | ( | devList | ) |
Clear the contents of a device list. Use mupnp_devicelist_delete instead of this function.
devList | The device list to clear |
#define MUPNP_DEVICELIST_ELEM_NAME "deviceList" |
Definition for device XML element list name
#define mupnp_devicelist_get | ( | devList, | |
index ) |
Get an device from the device list by the index
devList | The device list |
index | The index of the device to get |
#define mupnp_devicelist_gets | ( | devList | ) |
#define mupnp_devicelist_size | ( | devList | ) |
Get the size of the device list
devList | The device list |
typedef void(* MUPNP_PRESENTATION_LISTNER) (mUpnpHttpRequest *) |
Definition for presentation listener
typedef struct _mUpnpDevice mUpnpDevice |
The generic UPnP device structure.
typedef struct _mUpnpDevice mUpnpDeviceList |
bool mupnp_device_addicon | ( | mUpnpDevice * | dev, |
mUpnpIcon * | icon ) |
Get a smallest icon
dev | Device in question |
icon | Icon to add |
bool mupnp_device_advertiser_isrunning | ( | mUpnpDevice * | dev | ) |
Check if the advertiser has been started
dev | Device that is being advertised |
mupnp_device_advertiser_isrunning
Check if the advertiser has been started
dev | Device that is being advertised |
bool mupnp_device_advertiser_start | ( | mUpnpDevice * | dev | ) |
Start the advertiser thread for the given device
dev | The device in question |
mupnp_device_advertiser_start
Start the advertiser thread for the given device
dev | The device that is to be advertised |
bool mupnp_device_advertiser_stop | ( | mUpnpDevice * | dev | ) |
Stop the advertiser thread for the given device
dev | The device in question |
mupnp_device_advertiser_stop
Stop the advertiser thread for the given device
dev | Device that is being advertised |
void mupnp_device_announce | ( | mUpnpDevice * | dev | ) |
Broadcast an SSDP:alive to notify control points that the device is available.
dev | Device in question |
void mupnp_device_byebye | ( | mUpnpDevice * | dev | ) |
Broadcast an SSDP:byebye message to notify control points that the device is no longer available.
dev | Device in question |
void mupnp_device_clear | ( | mUpnpDevice * | dev | ) |
Clear a UPnP device structure. This is an internal function and should not be called from outside.
dev | Device in question |
void mupnp_device_delete | ( | mUpnpDevice * | dev | ) |
Delete a UPnP device
dev | Device in question |
bool mupnp_device_getabsoluteiconurl | ( | mUpnpDevice * | dev, |
mUpnpIcon * | icon, | ||
mUpnpString * | buf ) |
Get an icon by its index from the device's list of icons
dev | Device in question |
icon | Icon in question |
buf | Buffer to return the full icon's url |
mUpnpAction * mupnp_device_getactionbyname | ( | mUpnpDevice * | dev, |
const char * | name ) |
Find an action from a device by its name
dev | Device in question |
name | Name of the action |
mUpnpDevice * mupnp_device_getdevicebydescriptionuri | ( | mUpnpDevice * | dev, |
const char * | url ) |
Find a child device by its description URI.
dev | Device in question |
url | Description URI |
mUpnpDevice * mupnp_device_getdevicebyexacttype | ( | mUpnpDevice * | dev, |
const char * | exacttype ) |
Find a device from the device's children by the exact type of the device. This function searches for devices, whose complete type string matches the given string, including version number. For example: "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard the version, use mupnp_device_getdevicebytype
ctrlPoint | Controlpoint in question |
exacttype | Type of the device |
Find a device from the device's children by the type of the device. This function searches for devices, whose complete type string matches the given string, including version number. For example: "urn:schemas-upnp-org:device:FooDevice:1". If you need to disregard the version number, use mupnp_device_getdevicebytype
dev | Device in question |
exacttype | Type of the device |
mUpnpDevice * mupnp_device_getdevicebytype | ( | mUpnpDevice * | dev, |
const char * | type ) |
Find a device from the device's children by the type of the device. This function searches for devices, whose type part (i.e. not including the version) of the device type string matches the given string. For example: "urn:schemas-upnp-org:device:FooDevice". If you need to know the version of a device, use mupnp_devicetype_getversion
dev | Device in question |
type | Type of the device |
mUpnpDevice * mupnp_device_getdevicebyudn | ( | mUpnpDevice * | dev, |
const char * | udn ) |
Find a device from the device's children by the UDN of the device.
dev | Device in question |
type | Type of the device |
Find a device from the device's children by the UDN of the device.
dev | Device in question |
udn | Type of the device |
const char * mupnp_device_getlocationurl | ( | mUpnpDevice * | dev, |
const char * | host, | ||
char * | buf, | ||
int | bufSize ) |
Get device's location URL. Transforms the given <host> address to URL form: "http://<host>:<port>/description.xml". Port is usually 80 or 38400. If <host> is an IPv6 address, the address is "http://[<host>]:<port>/description.xml".
dev | Device in question |
host | The device host |
buf | Buffer to store the resulting URL |
bufSize | Buffer length |
char * mupnp_device_getnotifydevicent | ( | mUpnpDevice * | dev, |
char * | buf, | ||
int | bufSize ) |
Get the device's Notification Type (NT). For the root device this is "upnp:rootdevice", otherwise the device's UDN (Unique Device Name).
dev | The device in question |
buf | Buffer for the Notification Type |
bufSize | Buffer length |
char * mupnp_device_getnotifydevicetypent | ( | mUpnpDevice * | dev, |
char * | buf, | ||
int | bufSize ) |
Get the device type
dev | The device in question |
buf | Buffer for the device type |
bufSize | Buffer length |
char * mupnp_device_getnotifydevicetypeusn | ( | mUpnpDevice * | dev, |
char * | buf, | ||
int | bufSize ) |
Get the device's USN (Unique Service Name). For the root device this is "<UDN>::upnp:rootdevice", otherwise the UDN (Unique Device Name).
dev | The device in question |
buf | Buffer where USN is stored after call |
bufSize | Buffer size |
char * mupnp_device_getnotifydeviceusn | ( | mUpnpDevice * | dev, |
char * | buf, | ||
int | bufSize ) |
Get the device's USN (Unique Service Name). For the root device this is "<UDN>::upnp:rootdevice", otherwise the UDN (Unique Device Name).
dev | The device in question |
mUpnpDevice * mupnp_device_getrootdevice | ( | mUpnpDevice * | dev | ) |
Return the root (i.e. the topmost) device in the device structure
dev | Traverses the device tree upwards starting from this device |
mUpnpService * mupnp_device_getservicebycontrolurl | ( | mUpnpDevice * | dev, |
const char * | url ) |
Find a service from a device by its control URL
dev | Device in question |
url | Control URL |
mUpnpService * mupnp_device_getservicebyeventsuburl | ( | mUpnpDevice * | dev, |
const char * | url ) |
Find a service from a device by its event subscription URL
dev | Device in question |
url | Event Subscription URL |
mUpnpService * mupnp_device_getservicebyexacttype | ( | mUpnpDevice * | dev, |
const char * | type ) |
Find a service from the device by the type of the service. This function searches for services, whose complete type string matches the given string, including version number. For example: "urn:schemas-upnp-org:service:ContentDirectory:1". If you need to know the version of a service, use mupnp_servicetype_getversion
dev | Device in question |
type | Type of the service |
mUpnpService * mupnp_device_getservicebyscpdurl | ( | mUpnpDevice * | dev, |
const char * | url ) |
Find a service from the device by the SCPD (Service Control Protocol Definition) URL of the service.
dev | Device in question |
url | SCPD URL |
mUpnpService * mupnp_device_getservicebyserviceid | ( | mUpnpDevice * | dev, |
const char * | serviceId ) |
Find service from the device by a given serviceId. This function searches recursively device and its subdevices for a service with a given serviceId
dev | Device in question |
serviceId | serviceId of the service |
mUpnpService * mupnp_device_getservicebysid | ( | mUpnpDevice * | dev, |
const char * | sid ) |
Find a service from the device by the subscribtion ID
dev | Device in question |
sid | Subscription ID of the service |
Find a service from its Subscription ID
dev | Device in question |
char* | Subscription-ID (SID) |
mUpnpService * mupnp_device_getservicebytype | ( | mUpnpDevice * | dev, |
const char * | type ) |
Find a service from the device by the type of the service. This function searches for services, whose type part of the service type string matches the given string. For example: "ContentDirectory". If you need to search for an exact service type, use mupnp_device_getservicebyname
dev | Device in question |
type | Type of the service |
Find a service from the device by the type of the service. This function searches for services, whose type part (i.e. not including the version) of the service type string matches the given string. For example: "urn:schemas-upnp-org:service:ContentDirectory". If you need to know the version of a service, use mupnp_servicetype_getversion
dev | Device in question |
type | Type of the service |
mUpnpIcon * mupnp_device_getsmallesticon | ( | mUpnpDevice * | dev | ) |
Get a smallest icon
dev | Device in question |
mUpnpIcon * mupnp_device_getsmallesticonbymimetype | ( | mUpnpDevice * | dev, |
const char * | mimeType ) |
Get a smallest icon of a specified mime type
dev | Device in question |
mimeType | Mime type to get |
mUpnpStateVariable * mupnp_device_getstatevariablebyname | ( | mUpnpDevice * | dev, |
const char * | name ) |
Find a state variable from a device by its name
dev | Device in question |
name | Name of the state variable |
void mupnp_device_httprequestrecieved | ( | mUpnpHttpRequest * | httpReq | ) |
Handler function for a received HTTP request. Delegates GET and POST requests to their respective handlers, or treats as a BAD REQUEST, when appropriate.
httpReq | Received HTTP request |
bool mupnp_device_ipchanged | ( | mUpnpDevice * | dev | ) |
Notify device that IP address of the host has been changed.
dev | dev The device in question |
bool mupnp_device_isrunning | ( | mUpnpDevice * | dev | ) |
Check if the device] has been started
dev | Device that is being advertised |
mUpnpDevice * mupnp_device_new | ( | void | ) |
Create a new UPnP device
bool mupnp_device_parsedescription | ( | mUpnpDevice * | dev, |
const char * | desciption, | ||
size_t | descriptionLen ) |
Parse the device description XML document.
dev | Device in question |
description | Buffer containing the device description in XML format |
descriptionLen | Buffer length |
bool mupnp_device_parsedescriptionurl | ( | mUpnpDevice * | dev, |
mUpnpNetURL * | url ) |
Fetch and parse the device description XML file, located in the given URL.
dev | Device in question |
url | An internet resource |
bool mupnp_device_postsearchresponse | ( | mUpnpDevice * | dev, |
mUpnpSSDPPacket * | ssdpPkt, | ||
const char * | st, | ||
const char * | usn ) |
Post a response to an SSDP search message
dev | The device in question |
ssdpPkt | Received SSDP packet |
st | Service Type (ST) |
usn | Unique Service Name (USN) |
void mupnp_device_setactionlistener | ( | mUpnpDevice * | dev, |
MUPNP_ACTION_LISTNER | actionListner ) |
Set an action listener to the device. Actions are basically commands, that the device (service) responds to.
dev | Device in question |
actionListener | The action listener |
void mupnp_device_setdevicenode | ( | mUpnpDevice * | dev, |
mUpnpXmlNode * | node ) |
Set the device description node and initialise its child nodes
dev | Device in question |
node | The XML structure to be set as the device's description |
void mupnp_device_setpresentationlistener | ( | mUpnpDevice * | dev, |
MUPNP_PRESENTATION_LISTNER | func ) |
void mupnp_device_setquerylistener | ( | mUpnpDevice * | dev, |
MUPNP_STATEVARIABLE_LISTNER | queryListner ) |
Set a query listener to the device. Queries are meant for state variables.
dev | Device in question |
actionListener | The query listener |
void mupnp_device_seturlbase | ( | mUpnpDevice * | dev, |
char * | value ) |
Modify the device's URL base The base URL is the root for all relative URLs.
dev | Device in question |
value | The URL base |
void mupnp_device_ssdplistener | ( | mUpnpSSDPPacket * | ssdpPkt | ) |
The SSDP message handler function.
ssdpPkt | SSDP Packet |
void mupnp_device_ssdpmessagereceived | ( | mUpnpDevice * | dev, |
mUpnpSSDPPacket * | ssdpPkt, | ||
int | filter ) |
SSDP message handler
dev | The device in question |
ssdpPkt | Received SSDP packet |
bool mupnp_device_start | ( | mUpnpDevice * | dev | ) |
Start the device. This essentially starts:
dev | Device in question |
bool mupnp_device_stop | ( | mUpnpDevice * | dev | ) |
Stop the device. This concerns:
dev | Device in question |
bool mupnp_device_updatefromssdppacket | ( | mUpnpDevice * | dev, |
mUpnpSSDPPacket * | ssdpPkt ) |
Update the device's contents from an SSDP packet if necessary.
dev | The device to potentially update |
ssdpPkt | The SSDP packet to make decisions on |
void mupnp_device_updateudn | ( | mUpnpDevice * | dev | ) |
Update new Unique Device Name (UDN)
dev | Device in question |
void mupnp_devicelist_delete | ( | mUpnpDeviceList * | devList | ) |
Delete a device list completely, freeing all devices and their contents.
devList | The device list to delete |
mUpnpDeviceList * mupnp_devicelist_new | ( | void | ) |
Create a new device list
char * mupnp_devicetype_getdevice | ( | const char * | deviceType | ) |
Get the device part of a device type string (usually just "device")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the device part of a device type string (usually just "device")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
char * mupnp_devicetype_getidentifier | ( | const char * | deviceType | ) |
Get the identifier-part of a device type string (usually "urn")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the identifier-part of a device type string (usually "urn")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
char * mupnp_devicetype_getschematype | ( | const char * | deviceType | ) |
Get the schema type part of a device type string (without last colon) (ex. "urn:schemas-upnp-org:device:ContentDirectory")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the schema type part of a device type string (without last colon) (ex. "urn:schemas-upnp-org:device:ContentDirectory")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
char * mupnp_devicetype_gettype | ( | const char * | deviceType | ) |
Get the type part of a device type string (ex. "ContentDirectory")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the type part of a device type string (ex. "ContentDirectory")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
char * mupnp_devicetype_geturn | ( | const char * | deviceType | ) |
Get the URN part of a device type string (usually "schemas-upnp-org")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the URN part of a device type string (usually "schemas-upnp-org")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
char * mupnp_devicetype_getversion | ( | const char * | deviceType | ) |
Get the version part of a device type string (ex. "1")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |
Get the version part of a device type string (ex. "1")
deviceType | A device type string (usually the result from mupnp_device_getdevicetype) |