mUPnP for C
device.h File Reference
#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...
 

Macros

#define MUPNP_DEVICE_ELEM_NAME   "device"
 
#define MUPNP_DEVICELIST_ELEM_NAME   "deviceList"
 
#define MUPNP_DEVICE_UPNP_ROOTDEVICE   "upnp:rootdevice"
 
#define MUPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME   1000
 
#define MUPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME   500
 
#define MUPNP_DEVICE_DEFAULT_LEASE_TIME   (30 * 60)
 
#define MUPNP_DEVICE_HTTP_DEFAULT_PORT   38400
 
#define MUPNP_DEVICE_DEFAULT_DESCRIPTION_URI   "/description.xml"
 
#define MUPNP_DEVICE_URLBASE_MAXLEN   64
 
#define MUPNP_DEVICE_M_SEARCH_FILTER_INTERVAL   15
 
#define MUPNP_DEVICE_URLBASE_NAME   "URLBase"
 
#define MUPNP_DEVICE_DEVICE_TYPE   "deviceType"
 
#define MUPNP_DEVICE_FRIENDLY_NAME   "friendlyName"
 
#define MUPNP_DEVICE_MANUFACTURER   "manufacturer"
 
#define MUPNP_DEVICE_MANUFACTURER_URL   "manufacturerURL"
 
#define MUPNP_DEVICE_MODEL_DESCRIPTION   "modelDescription"
 
#define MUPNP_DEVICE_MODEL_NAME   "modelName"
 
#define MUPNP_DEVICE_MODEL_NUMBER   "modelNumber"
 
#define MUPNP_DEVICE_MODEL_URL   "modelURL"
 
#define MUPNP_DEVICE_SERIAL_NUMBER   "serialNumber"
 
#define MUPNP_DEVICE_UDN   "UDN"
 
#define MUPNP_DEVICE_UPC   "UPC"
 
#define MUPNP_DEVICE_PRESENTATION_URL   "presentationURL"
 
#define MUPNP_DEVICE_DEFAULT_PRESENTATION_URI   "/presentation"
 
#define mupnp_device_next(dev)
 
#define mupnp_device_remove(dev)
 
#define mupnp_device_isdevicenode(node)
 
#define mupnp_device_getrootnode(dev)
 
#define mupnp_device_getdevicenode(dev)
 
#define mupnp_device_isrootdevice(dev)
 
#define mupnp_device_setparentdevice(dev, pDev)
 
#define mupnp_device_getparentdevice(dev)
 
#define mupnp_device_setdevicetype(dev, value)
 
#define mupnp_device_getdevicetype(dev)
 
#define mupnp_device_isdevicetype(dev, value)
 
#define mupnp_device_setfriendlyname(dev, value)
 
#define mupnp_device_getfriendlyname(dev)
 
#define mupnp_device_setmanufacturer(dev, value)
 
#define mupnp_device_getmanufacturer(dev)
 
#define mupnp_device_setmanufacturerurl(dev, value)
 
#define mupnp_device_getmanufacturerurl(dev)
 
#define mupnp_device_setmodeldescription(dev, value)
 
#define mupnp_device_getmodeldescription(dev)
 
#define mupnp_device_setmodelname(dev, value)
 
#define mupnp_device_getmodelname(dev)
 
#define mupnp_device_setmodelnumber(dev, value)
 
#define mupnp_device_getmodelnumber(dev)
 
#define mupnp_device_setmodelurl(dev, value)
 
#define mupnp_device_getmodelurl(dev)
 
#define mupnp_device_setserialnumber(dev, value)
 
#define mupnp_device_getserialnumber(dev)
 
#define mupnp_device_setudn(dev, value)
 
#define mupnp_device_getudn(dev)
 
#define mupnp_device_hasudn(dev)
 
#define mupnp_device_setupc(dev, value)
 
#define mupnp_device_getupc(dev)
 
#define mupnp_device_setpresentationurl(dev, value)
 
#define mupnp_device_getpresentationurl(dev)
 
#define mupnp_device_removepresentationurl(dev)
 
#define mupnp_device_getpresentationlistener(dev)
 
#define mupnp_device_geturlbase(dev)
 
#define mupnp_device_setbootid(dev, value)
 
#define mupnp_device_getbootid(dev)
 
#define mupnp_device_lock(dev)
 
#define mupnp_device_waitforlock(dev, t)
 
#define mupnp_device_unlock(dev)
 
#define mupnp_device_setuserdata(dev, value)
 
#define mupnp_device_getuserdata(dev)
 
#define mupnp_device_setdescriptionuri(dev, url)
 
#define mupnp_device_getdescriptionuri(dev)
 
#define mupnp_device_isdescriptionuri(dev, url)
 
#define mupnp_device_setleasetime(dev, value)
 
#define mupnp_device_getleasetime(dev)
 
#define mupnp_device_getdevicelist(dev)
 
#define mupnp_device_getdevice(dev, idx)
 
#define mupnp_device_getdevices(dev)
 
#define mupnp_device_getservicelist(dev)
 
#define mupnp_device_getnservices(dev)
 
#define mupnp_device_getservice(dev, idx)
 
#define mupnp_device_getservices(dev)
 
#define mupnp_device_geticonlist(dev)
 
#define mupnp_device_geticon(dev, idx)
 
#define mupnp_device_geticons(dev)
 
#define mupnp_devicelist_clear(devList)
 
#define mupnp_devicelist_size(devList)
 
#define mupnp_devicelist_gets(devList)
 
#define mupnp_devicelist_get(devList, index)
 
#define mupnp_devicelist_add(devList, dev)
 
#define mupnp_device_getaddress(dev)
 
#define mupnp_device_sethttpport(dev, value)
 
#define mupnp_device_gethttpport(dev)
 
#define mupnp_device_sethttplistener(dev, func)
 
#define mupnp_device_gethttplistener(dev)
 
#define mupnp_device_gethttpserverlist(dev)
 
#define mupnp_device_getssdpserverlist(dev)
 
#define mupnp_device_getssdpserverlist(dev)
 
#define mupnp_device_getssdppacket(dev)
 
#define mupnp_device_setssdppacket(dev, srcSsdpPkt)
 
#define mupnp_device_getlocationfromssdppacket(dev)
 
#define mupnp_device_getinterfaceaddressfromssdppacket(dev)
 
#define mupnp_device_getadvertiserthead(dev)
 

Typedefs

typedef void(* MUPNP_PRESENTATION_LISTNER) (mUpnpHttpRequest *)
 
typedef struct _mUpnpDevice mUpnpDevice
 The generic UPnP device structure.
 
typedef struct _mUpnpDevice mUpnpDeviceList
 

Functions

mUpnpDevicemupnp_device_new (void)
 
void mupnp_device_delete (mUpnpDevice *dev)
 
void mupnp_device_clear (mUpnpDevice *dev)
 
void mupnp_device_setdevicenode (mUpnpDevice *dev, mUpnpXmlNode *node)
 
mUpnpDevicemupnp_device_getrootdevice (mUpnpDevice *dev)
 
bool mupnp_device_parsedescription (mUpnpDevice *dev, const char *desciption, size_t descriptionLen)
 
bool mupnp_device_parsedescriptionurl (mUpnpDevice *dev, mUpnpNetURL *url)
 
bool mupnp_device_updatefromssdppacket (mUpnpDevice *dev, mUpnpSSDPPacket *ssdpPkt)
 
char * mupnp_devicetype_getidentifier (const char *deviceType)
 
char * mupnp_devicetype_geturn (const char *deviceType)
 
char * mupnp_devicetype_getdevice (const char *deviceType)
 
char * mupnp_devicetype_gettype (const char *deviceType)
 
char * mupnp_devicetype_getschematype (const char *deviceType)
 
char * mupnp_devicetype_getversion (const char *deviceType)
 
void mupnp_device_updateudn (mUpnpDevice *dev)
 
void mupnp_device_setpresentationlistener (mUpnpDevice *dev, MUPNP_PRESENTATION_LISTNER func)
 
void mupnp_device_seturlbase (mUpnpDevice *dev, char *value)
 
bool mupnp_device_start (mUpnpDevice *dev)
 
bool mupnp_device_stop (mUpnpDevice *dev)
 
bool mupnp_device_isrunning (mUpnpDevice *dev)
 
const char * mupnp_device_getlocationurl (mUpnpDevice *dev, const char *host, char *buf, int bufSize)
 
void mupnp_device_announce (mUpnpDevice *dev)
 
void mupnp_device_byebye (mUpnpDevice *dev)
 
void mupnp_device_setactionlistener (mUpnpDevice *dev, MUPNP_ACTION_LISTNER actionListner)
 
void mupnp_device_setquerylistener (mUpnpDevice *dev, MUPNP_STATEVARIABLE_LISTNER queryListner)
 
mUpnpDevicemupnp_device_getdevicebyexacttype (mUpnpDevice *dev, const char *exacttype)
 
mUpnpDevicemupnp_device_getdevicebytype (mUpnpDevice *dev, const char *type)
 
mUpnpDevicemupnp_device_getdevicebyudn (mUpnpDevice *dev, const char *udn)
 
mUpnpDevicemupnp_device_getdevicebydescriptionuri (mUpnpDevice *dev, const char *url)
 
mUpnpServicemupnp_device_getservicebyserviceid (mUpnpDevice *dev, const char *serviceId)
 
mUpnpServicemupnp_device_getservicebyexacttype (mUpnpDevice *dev, const char *type)
 
mUpnpServicemupnp_device_getservicebytype (mUpnpDevice *dev, const char *type)
 
mUpnpServicemupnp_device_getservicebysid (mUpnpDevice *dev, const char *sid)
 
mUpnpServicemupnp_device_getservicebyscpdurl (mUpnpDevice *dev, const char *url)
 
mUpnpServicemupnp_device_getservicebycontrolurl (mUpnpDevice *dev, const char *url)
 
mUpnpServicemupnp_device_getservicebyeventsuburl (mUpnpDevice *dev, const char *url)
 
mUpnpIconmupnp_device_getsmallesticon (mUpnpDevice *dev)
 
mUpnpIconmupnp_device_getsmallesticonbymimetype (mUpnpDevice *dev, const char *mimeType)
 
bool mupnp_device_getabsoluteiconurl (mUpnpDevice *dev, mUpnpIcon *icon, mUpnpString *buf)
 
bool mupnp_device_addicon (mUpnpDevice *dev, mUpnpIcon *icon)
 
mUpnpActionmupnp_device_getactionbyname (mUpnpDevice *dev, const char *name)
 
mUpnpStateVariablemupnp_device_getstatevariablebyname (mUpnpDevice *dev, const char *name)
 
mUpnpDeviceListmupnp_devicelist_new (void)
 
void mupnp_devicelist_delete (mUpnpDeviceList *devList)
 
void mupnp_device_httprequestrecieved (mUpnpHttpRequest *httpReq)
 
void mupnp_device_ssdplistener (mUpnpSSDPPacket *ssdpPkt)
 
char * mupnp_device_getnotifydevicent (mUpnpDevice *dev, char *buf, int bufSize)
 
char * mupnp_device_getnotifydeviceusn (mUpnpDevice *dev, char *buf, int bufSize)
 
char * mupnp_device_getnotifydevicetypent (mUpnpDevice *dev, char *buf, int bufSize)
 
char * mupnp_device_getnotifydevicetypeusn (mUpnpDevice *dev, char *buf, int bufSize)
 
void mupnp_device_ssdpmessagereceived (mUpnpDevice *dev, mUpnpSSDPPacket *ssdpPkt, int filter)
 
bool mupnp_device_postsearchresponse (mUpnpDevice *dev, mUpnpSSDPPacket *ssdpPkt, const char *st, const char *usn)
 
bool mupnp_device_ipchanged (mUpnpDevice *dev)
 
bool mupnp_device_advertiser_start (mUpnpDevice *dev)
 
bool mupnp_device_advertiser_stop (mUpnpDevice *dev)
 
bool mupnp_device_advertiser_isrunning (mUpnpDevice *dev)
 

Macro Definition Documentation

◆ MUPNP_DEVICE_DEFAULT_DESCRIPTION_URI

#define MUPNP_DEVICE_DEFAULT_DESCRIPTION_URI   "/description.xml"

Definition for default description file "location"

◆ MUPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME

#define MUPNP_DEVICE_DEFAULT_DISCOVERY_WAIT_TIME   500

Definition for default device discovery wait time

◆ MUPNP_DEVICE_DEFAULT_LEASE_TIME

#define MUPNP_DEVICE_DEFAULT_LEASE_TIME   (30 * 60)

Definition for default device lease time

◆ MUPNP_DEVICE_DEFAULT_PRESENTATION_URI

#define MUPNP_DEVICE_DEFAULT_PRESENTATION_URI   "/presentation"

Definition for default presentation URL"

◆ MUPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME

#define MUPNP_DEVICE_DEFAULT_STARTUP_WAIT_TIME   1000

Definition for default device start up wait time

◆ MUPNP_DEVICE_DEVICE_TYPE

#define MUPNP_DEVICE_DEVICE_TYPE   "deviceType"

Definition for device type XML element name

◆ MUPNP_DEVICE_ELEM_NAME

#define MUPNP_DEVICE_ELEM_NAME   "device"

Definition for device XML element name

◆ MUPNP_DEVICE_FRIENDLY_NAME

#define MUPNP_DEVICE_FRIENDLY_NAME   "friendlyName"

Definition for device friendly name XML element name

◆ mupnp_device_getaddress

#define mupnp_device_getaddress ( dev)
Value:
#define mupnp_device_getssdppacket(dev)
Definition device.h:1497
#define mupnp_ssdp_packet_getlocaladdress(ssdpPkt)
Definition ssdp_server.h:133

Get the device associated to the given service

Parameters
serviceThe service in question Get the root device of the given service
serviceThe service in question Get the device's address from SSDP packet
devThe device in question

◆ mupnp_device_getadvertiserthead

#define mupnp_device_getadvertiserthead ( dev)
Value:
(dev->advertiser)

Get the advertiser thread from the device

Parameters
devThe device in question

◆ mupnp_device_getbootid

#define mupnp_device_getbootid ( dev)
Value:
(dev->bootId)

Get the device's boot id

Parameters
devDevice in question
Returns
The boot id

◆ mupnp_device_getdescriptionuri

#define mupnp_device_getdescriptionuri ( dev)
Value:
mupnp_string_getvalue(dev->descriptionURI)
char * mupnp_string_getvalue(mUpnpString *str)
Definition string.c:177

Get the device's description URI

Parameters
devDevice in question

◆ mupnp_device_getdevice

#define mupnp_device_getdevice ( dev,
idx )
Value:
((mUpnpDevice*)mupnp_list_get((mUpnpList*)dev->deviceList, idx))
mUpnpList * mupnp_list_get(mUpnpList *headList, int index)
Definition list.c:76
The generic UPnP device structure.
Definition device.h:122
The generic list interface in mUPnP.
Definition list.h:56

Find a certain device from the given device list

Parameters
devDevice in question
idxDevice index number in list
Returns
NULL if not found; otherwise the device pointer

◆ mupnp_device_getdevicelist

#define mupnp_device_getdevicelist ( dev)
Value:
(dev->deviceList)

Get the device's internal device list

Parameters
devDevice in question

◆ mupnp_device_getdevicenode

#define mupnp_device_getdevicenode ( dev)
Value:
(dev->deviceNode)

Return the device XML description node

Parameters
devDevice in question

◆ mupnp_device_getdevices

#define mupnp_device_getdevices ( dev)
Value:
((mUpnpDevice*)mupnp_list_gets((mUpnpList*)dev->deviceList))
#define mupnp_list_gets(headList)
Definition list.h:159
Todo
Correct explanation...
Parameters
devDevice in question

◆ mupnp_device_getdevicetype

#define mupnp_device_getdevicetype ( dev)
Value:
#define mupnp_device_getdevicenode(dev)
Definition device.h:237
#define MUPNP_DEVICE_DEVICE_TYPE
Definition device.h:71
const char * mupnp_xml_node_getchildnodevalue(mUpnpXmlNode *node, const char *name)
Definition xml_node.c:216

Return the device type

Parameters
devDevice in question
Returns
Device type

◆ mupnp_device_getfriendlyname

#define mupnp_device_getfriendlyname ( dev)
Value:

Return the device's friendly name.

Parameters
devDevice in question
Returns
The device's friendly name

◆ mupnp_device_gethttplistener

#define mupnp_device_gethttplistener ( dev)
Value:
(dev->httpListener)

Get the device's HTTP listener function

Parameters
devThe device in question

◆ mupnp_device_gethttpport

#define mupnp_device_gethttpport ( dev)
Value:
(dev->httpPort)

Get the device's HTTP port

Parameters
devThe device in question

◆ mupnp_device_gethttpserverlist

#define mupnp_device_gethttpserverlist ( dev)
Value:
(dev->httpServerList)

Get the HTTP server list

Parameters
devThe device in question

◆ mupnp_device_geticon

#define mupnp_device_geticon ( dev,
idx )
Value:
((mUpnpIcon*)mupnp_list_get((mUpnpList*)dev->iconList, idx))
Definition icon.h:42

Get an icon by its index from the device's list of icons

Parameters
devDevice in question
idxIcon index number

◆ mupnp_device_geticonlist

#define mupnp_device_geticonlist ( dev)
Value:
(dev->iconList)

Get the device's list of icons

Parameters
devDevice in question

◆ mupnp_device_geticons

#define mupnp_device_geticons ( dev)
Value:
((mUpnpIcon*)mupnp_list_gets((mUpnpList*)dev->iconList))
Todo
Correct explanation...
Parameters
devDevice in question

◆ mupnp_device_getinterfaceaddressfromssdppacket

#define mupnp_device_getinterfaceaddressfromssdppacket ( dev)
Value:

Extract the interface address from the device's SSDP packet

Parameters
devThe device in question

◆ mupnp_device_getleasetime

#define mupnp_device_getleasetime ( dev)
Value:
(dev->leaseTime)

Get the device's lease time. See mupnp_device_setleasetime.

Parameters
devDevice in question

◆ mupnp_device_getlocationfromssdppacket

#define mupnp_device_getlocationfromssdppacket ( dev)
Value:
#define mupnp_ssdp_packet_getlocation(ssdpPkt)
Definition ssdp_server.h:118

Extract location information from the device's SSDP packet

Parameters
devThe device in question

◆ mupnp_device_getmanufacturer

#define mupnp_device_getmanufacturer ( dev)
Value:

Get the device's manufacturer.

Parameters
devDevice in question
Returns
value The manufacturer's name

◆ mupnp_device_getmanufacturerurl

#define mupnp_device_getmanufacturerurl ( dev)
Value:

Get the device's manufacturer URL

Parameters
devDevice in question
Returns
The manufacturer URL

◆ mupnp_device_getmodeldescription

#define mupnp_device_getmodeldescription ( dev)
Value:

Get the device model description

Parameters
devDevice in question
Returns
The device model description

◆ mupnp_device_getmodelname

#define mupnp_device_getmodelname ( dev)
Value:

Get the device's model name

Parameters
devDevice in question
Returns
The model name

◆ mupnp_device_getmodelnumber

#define mupnp_device_getmodelnumber ( dev)
Value:

Get the device's model number

Parameters
devDevice in question
Returns
The model number

◆ mupnp_device_getmodelurl

#define mupnp_device_getmodelurl ( dev)
Value:

Get the device's model URL

Parameters
devDevice in question
Returns
The model URL

◆ mupnp_device_getnservices

#define mupnp_device_getnservices ( dev)
Value:
mupnp_servicelist_size(dev->serviceList)
#define mupnp_servicelist_size(serviceList)
Definition service.h:750

Get the number of services known by the device

Parameters
devDevice in question
Returns
The number of devices in the control point's device list

◆ mupnp_device_getparentdevice

#define mupnp_device_getparentdevice ( dev)
Value:
(dev->parentDevice)

Return the device's parent device

Parameters
devDevice in question

◆ mupnp_device_getpresentationlistener

#define mupnp_device_getpresentationlistener ( dev)
Value:
(dev->presentationListener)

Get the device's presentation listener function

Parameters
devThe device in question

◆ mupnp_device_getpresentationurl

#define mupnp_device_getpresentationurl ( dev)
Value:

Get the device's presentation URL

Parameters
devDevice in question
Returns
The presentation URL

◆ mupnp_device_getrootnode

#define mupnp_device_getrootnode ( dev)
Value:
mupnp_xml_nodelist_gets(dev->rootNodeList)
#define mupnp_xml_nodelist_gets(nodeList)
Definition xml.h:103

Return the device's root node

Todo
Correct explanation...
Parameters
devDevice in question

◆ mupnp_device_getserialnumber

#define mupnp_device_getserialnumber ( dev)
Value:

Get the device's model number

Parameters
devDevice in question
Returns
The serial number

◆ mupnp_device_getservice

#define mupnp_device_getservice ( dev,
idx )
Value:
((mUpnpService*)mupnp_list_get((mUpnpList*)dev->serviceList, idx))
Definition service.h:51

Get a service from <idx> from the device

Parameters
devDevice in question
idxDevice index number

◆ mupnp_device_getservicelist

#define mupnp_device_getservicelist ( dev)
Value:
(dev->serviceList)

Get the device's list of services

Parameters
devDevice in question

◆ mupnp_device_getservices

#define mupnp_device_getservices ( dev)
Value:
((mUpnpService*)mupnp_list_gets((mUpnpList*)dev->serviceList))
Todo
Correct explanation...
Parameters
devDevice in question

◆ mupnp_device_getssdppacket

#define mupnp_device_getssdppacket ( dev)
Value:
(dev->ssdpPkt)

Get the device's SSDP packet

Parameters
devThe device in question

◆ mupnp_device_getssdpserverlist [1/2]

#define mupnp_device_getssdpserverlist ( dev)
Value:
(dev->ssdpServerList)

Get the device's list of SSDP servers

Parameters
devThe device in question

Get the SSDP server list

Parameters
devThe device in question

◆ mupnp_device_getssdpserverlist [2/2]

#define mupnp_device_getssdpserverlist ( dev)
Value:
(dev->ssdpServerList)

Get the device's list of SSDP servers

Parameters
devThe device in question

Get the SSDP server list

Parameters
devThe device in question

◆ mupnp_device_getudn

#define mupnp_device_getudn ( dev)
Value:

Get the device's Unique Device Name (UDN)

Parameters
devDevice in question
Returns
The Unique Device Name

◆ mupnp_device_getupc

#define mupnp_device_getupc ( dev)
Value:

Get the device's Universal Product Code (UPC)

Parameters
devDevice in question
Returns
The Universal Product Code

◆ mupnp_device_geturlbase

#define mupnp_device_geturlbase ( dev)
Value:
#define mupnp_device_getrootnode(dev)
Definition device.h:222
#define MUPNP_DEVICE_URLBASE_NAME
Definition device.h:68
mUpnpDevice * mupnp_device_getrootdevice(mUpnpDevice *dev)
Definition device.c:165

Get the device's base URL. The base URL is the root for all relative URLs.

Parameters
devDevice in question
Returns
The URL base

◆ mupnp_device_getuserdata

#define mupnp_device_getuserdata ( dev)
Value:
(dev->userData)

Get device's user data pointer

Parameters
devDevice in question
Returns
pointer to user data

◆ mupnp_device_hasudn

#define mupnp_device_hasudn ( dev)
Value:
((0 < mupnp_strlen(mupnp_device_getudn(dev))) ? true : false)
#define mupnp_device_getudn(dev)
Definition device.h:605
size_t mupnp_strlen(const char *str)
Definition string_function.c:63
#define true
Definition typedef.h:63

Check whether the device has a Unique Device Name (UDN)

Parameters
devDevice in question
Returns
true if the device has a UDN; otherwise false

◆ MUPNP_DEVICE_HTTP_DEFAULT_PORT

#define MUPNP_DEVICE_HTTP_DEFAULT_PORT   38400

Definition for default device HTTP port

◆ mupnp_device_isdescriptionuri

#define mupnp_device_isdescriptionuri ( dev,
url )
Value:
mupnp_streq(mupnp_string_getvalue(dev->descriptionURI), url)
bool mupnp_streq(const char *str1, const char *str2)
Definition string_function.c:158

Check, whether the given URL matches the device's description URI

Parameters
devDevice in question
urlDescription URL to check

◆ mupnp_device_isdevicenode

#define mupnp_device_isdevicenode ( node)
Value:
#define MUPNP_DEVICE_ELEM_NAME
Definition device.h:38
#define mupnp_xml_node_isname(node, nodename)
Definition xml.h:123

Check whether the given node is of type MUPNP_DEVICE_ELEM_NAME

Parameters
nodemUpnpXmlAttribute

◆ mupnp_device_isdevicetype

#define mupnp_device_isdevicetype ( dev,
value )
Value:
#define mupnp_device_getdevicetype(dev)
Definition device.h:336

Check, whether the device is of the exact specified type (including version)

Parameters
devDevice in question
valueDevice type
Returns
bool: true if device matches given type; otherwise false

◆ mupnp_device_isrootdevice

#define mupnp_device_isrootdevice ( dev)
Value:
((dev->rootNodeList != NULL) ? true : false)

Check whether the given device contains a list of root nodes i.e. is it the root device

Parameters
devDevice in question

◆ mupnp_device_lock

#define mupnp_device_lock ( dev)
Value:
mupnp_mutex_lock(dev->mutex)
bool mupnp_mutex_lock(mUpnpMutex *mutex)
Definition mutex.c:264

Lock the device's mutex (grant exclusive access to the device) until mupnp_device_unlock is called.

Parameters
devDevice in question

◆ MUPNP_DEVICE_M_SEARCH_FILTER_INTERVAL

#define MUPNP_DEVICE_M_SEARCH_FILTER_INTERVAL   15

Definition for M-SEARCH filter interval

◆ MUPNP_DEVICE_MANUFACTURER

#define MUPNP_DEVICE_MANUFACTURER   "manufacturer"

Definition for device manufacturer XML element name

◆ MUPNP_DEVICE_MANUFACTURER_URL

#define MUPNP_DEVICE_MANUFACTURER_URL   "manufacturerURL"

Definition for manufacturer URL XML element name

◆ MUPNP_DEVICE_MODEL_DESCRIPTION

#define MUPNP_DEVICE_MODEL_DESCRIPTION   "modelDescription"

Definition for device model description XML element name

◆ MUPNP_DEVICE_MODEL_NAME

#define MUPNP_DEVICE_MODEL_NAME   "modelName"

Definition fo device model name XML element name

◆ MUPNP_DEVICE_MODEL_NUMBER

#define MUPNP_DEVICE_MODEL_NUMBER   "modelNumber"

Definition for device model number XML element name

◆ MUPNP_DEVICE_MODEL_URL

#define MUPNP_DEVICE_MODEL_URL   "modelURL"

Definition for device model URL XML element name

◆ mupnp_device_next

#define mupnp_device_next ( dev)
Value:
mUpnpList * mupnp_list_next(mUpnpList *list)
Definition list.c:234

Get the next device in the device list. Use as an iterator.

Parameters
devCurrent device

◆ MUPNP_DEVICE_PRESENTATION_URL

#define MUPNP_DEVICE_PRESENTATION_URL   "presentationURL"

Definition for device presentation URL XML element name

◆ mupnp_device_remove

#define mupnp_device_remove ( dev)
Value:
void mupnp_list_remove(mUpnpList *list)
Definition list.c:144

Remove the device from the device list.

Parameters
devDevice in question

◆ mupnp_device_removepresentationurl

#define mupnp_device_removepresentationurl ( dev)
Value:
bool mupnp_xml_node_removechildnode(mUpnpXmlNode *node, const char *name)
Definition xml_node.c:129

Remove the device's presentation URL

Parameters
devDevice in question

◆ MUPNP_DEVICE_SERIAL_NUMBER

#define MUPNP_DEVICE_SERIAL_NUMBER   "serialNumber"

Definition for device serial number XML element name

◆ mupnp_device_setbootid

#define mupnp_device_setbootid ( dev,
value )
Value:
(dev->bootId = value)

Modify the device's boot id

Parameters
devDevice in question
valueThe boot id

◆ mupnp_device_setdescriptionuri

#define mupnp_device_setdescriptionuri ( dev,
url )
Value:
mupnp_string_setvalue(dev->descriptionURI, url)
void mupnp_string_setvalue(mUpnpString *str, const char *value)
Definition string.c:84

Set the given URL as the device's description URI

Parameters
devDevice in question
urlDescription URL

◆ mupnp_device_setdevicetype

#define mupnp_device_setdevicetype ( dev,
value )
Value:
void mupnp_xml_node_setchildnode(mUpnpXmlNode *node, const char *name, const char *value)
Definition xml_node.c:105

Modify the device type.

Parameters
devDevice in question
valueType to set

◆ mupnp_device_setfriendlyname

#define mupnp_device_setfriendlyname ( dev,
value )
Value:

Modify the device's friendly name.

Parameters
devDevice in question
valueThe friendly name

◆ mupnp_device_sethttplistener

#define mupnp_device_sethttplistener ( dev,
func )
Value:
(dev->httpListener = func)

Set an HTTP listener function to the device

Parameters
devThe device in question
funcThe listener function

◆ mupnp_device_sethttpport

#define mupnp_device_sethttpport ( dev,
value )
Value:
(dev->httpPort = value)

Modify the port that the device's HTTP server is listening

Parameters
devThe device in question
valuePort number

◆ mupnp_device_setleasetime

#define mupnp_device_setleasetime ( dev,
value )
Value:
(dev->leaseTime = 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.

Parameters
devDevice in question
valueLease time in seconds

◆ mupnp_device_setmanufacturer

#define mupnp_device_setmanufacturer ( dev,
value )
Value:

Modify the device's manufacturer.

Parameters
devDevice in question
valueThe manufacturer's name

◆ mupnp_device_setmanufacturerurl

#define mupnp_device_setmanufacturerurl ( dev,
value )
Value:

Modify the device's manufacturer URL

Parameters
devDevice in question
valueThe manufacturer URL

◆ mupnp_device_setmodeldescription

#define mupnp_device_setmodeldescription ( dev,
value )
Value:

Modify the device model description

Parameters
devDevice in question
valueThe device model description

◆ mupnp_device_setmodelname

#define mupnp_device_setmodelname ( dev,
value )
Value:

Modify the device's model name

Parameters
devDevice in question
valueThe model name

◆ mupnp_device_setmodelnumber

#define mupnp_device_setmodelnumber ( dev,
value )
Value:

Modify the device's model number

Parameters
devDevice in question
valueThe model number

◆ mupnp_device_setmodelurl

#define mupnp_device_setmodelurl ( dev,
value )
Value:

Modify the device's model URL

Parameters
devDevice in question
valueThe model URL

◆ mupnp_device_setparentdevice

#define mupnp_device_setparentdevice ( dev,
pDev )
Value:
(dev->parentDevice = pDev)

Set a parent device for the given child device

Parameters
devChild device
pDevParent device

◆ mupnp_device_setpresentationurl

#define mupnp_device_setpresentationurl ( dev,
value )
Value:

Modify the device's presentation URL

Parameters
devDevice in question
valueThe presentation URL

◆ mupnp_device_setserialnumber

#define mupnp_device_setserialnumber ( dev,
value )
Value:

Modify the device's serial number

Parameters
devDevice in question
valueThe serial number

◆ mupnp_device_setssdppacket

#define mupnp_device_setssdppacket ( dev,
srcSsdpPkt )
Value:
mupnp_ssdp_packet_copy(dev->ssdpPkt, srcSsdpPkt)
void mupnp_ssdp_packet_copy(mUpnpSSDPPacket *dstSsdpPkt, mUpnpSSDPPacket *srcSsdpPkt)
Definition ssdp_packet.c:178

Modify the device's SSDP packet (creates a copy of the original)

Parameters
devThe device in question
srcSsdpPktThe SSDP packet

◆ mupnp_device_setudn

#define mupnp_device_setudn ( dev,
value )
Value:

Modify the device's Unique Device Name (UDN)

Parameters
devDevice in question
valueThe Unique Device Name

◆ mupnp_device_setupc

#define mupnp_device_setupc ( dev,
value )
Value:

Modify the device's Universal Product Code (UPC)

Parameters
devDevice in question
valueThe Universal Product Code

◆ mupnp_device_setuserdata

#define mupnp_device_setuserdata ( dev,
value )
Value:
(dev->userData = value)

Set device's user data pointer

Parameters
devDevice in question
valueUser data pointer

◆ MUPNP_DEVICE_UDN

#define MUPNP_DEVICE_UDN   "UDN"

Definition for device UDN XML element name

◆ mupnp_device_unlock

#define mupnp_device_unlock ( dev)
Value:
mupnp_mutex_unlock(dev->mutex)
bool mupnp_mutex_unlock(mUpnpMutex *mutex)
Definition mutex.c:294

Unlock the device's mutex (release exclusive access to the device) locked previously with mupnp_device_lock.

Parameters
devDevice in question

◆ MUPNP_DEVICE_UPC

#define MUPNP_DEVICE_UPC   "UPC"

Definition for device UPC XML element name

◆ MUPNP_DEVICE_UPNP_ROOTDEVICE

#define MUPNP_DEVICE_UPNP_ROOTDEVICE   "upnp:rootdevice"

Definition for UPnP rootdevice ID

◆ MUPNP_DEVICE_URLBASE_MAXLEN

#define MUPNP_DEVICE_URLBASE_MAXLEN   64

Definition for maximum URL base length

◆ MUPNP_DEVICE_URLBASE_NAME

#define MUPNP_DEVICE_URLBASE_NAME   "URLBase"

Definition for urlbase XML element name

◆ mupnp_device_waitforlock

#define mupnp_device_waitforlock ( dev,
t )
Value:
mupnp_mutex_waitforlock(dev->mutex, t)

Lock the device's mutex with timeout, return true if exclusive access is gained Release lock with mupnp_device_unlock is called.

Parameters
devDevice in question
ttimeout in ms

◆ mupnp_devicelist_add

#define mupnp_devicelist_add ( devList,
dev )
Value:
void mupnp_list_add(mUpnpList *headList, mUpnpList *list)
Definition list.c:123

Add a device to the device list

Parameters
devListThe device list
devThe device to add

◆ mupnp_devicelist_clear

#define mupnp_devicelist_clear ( devList)
Value:
void mupnp_device_delete(mUpnpDevice *dev)
Definition device.c:95
void mupnp_list_clear(mUpnpList *headList, MUPNP_LIST_DESTRUCTORFUNC destructorFunc)
Definition list.c:257
void(* MUPNP_LIST_DESTRUCTORFUNC)(void *)
Definition list.h:29

Clear the contents of a device list. Use mupnp_devicelist_delete instead of this function.

Parameters
devListThe device list to clear

◆ MUPNP_DEVICELIST_ELEM_NAME

#define MUPNP_DEVICELIST_ELEM_NAME   "deviceList"

Definition for device XML element list name

◆ mupnp_devicelist_get

#define mupnp_devicelist_get ( devList,
index )
Value:
(mUpnpDevice*) mupnp_list_get((mUpnpList*)devList, index)

Get an device from the device list by the index

Parameters
devListThe device list
indexThe index of the device to get

◆ mupnp_devicelist_gets

#define mupnp_devicelist_gets ( devList)
Value:
Todo
Correct description
Parameters
devListThe device list

◆ mupnp_devicelist_size

#define mupnp_devicelist_size ( devList)
Value:
int mupnp_list_size(mUpnpList *headList)
Definition list.c:53

Get the size of the device list

Parameters
devListThe device list

Typedef Documentation

◆ MUPNP_PRESENTATION_LISTNER

typedef void(* MUPNP_PRESENTATION_LISTNER) (mUpnpHttpRequest *)

Definition for presentation listener

◆ mUpnpDevice

typedef struct _mUpnpDevice mUpnpDevice

The generic UPnP device structure.

Note
This struct can also be cast to a mUpnpList* and used as a node in a linked list with mupnp_list_* functions.

◆ mUpnpDeviceList

typedef struct _mUpnpDevice mUpnpDeviceList

Function Documentation

◆ mupnp_device_addicon()

bool mupnp_device_addicon ( mUpnpDevice * dev,
mUpnpIcon * icon )

Get a smallest icon

Parameters
devDevice in question
iconIcon to add

◆ mupnp_device_advertiser_isrunning()

bool mupnp_device_advertiser_isrunning ( mUpnpDevice * dev)

Check if the advertiser has been started

Parameters
devDevice that is being advertised

mupnp_device_advertiser_isrunning

Check if the advertiser has been started

Parameters
devDevice that is being advertised

◆ mupnp_device_advertiser_start()

bool mupnp_device_advertiser_start ( mUpnpDevice * dev)

Start the advertiser thread for the given device

Parameters
devThe device in question

mupnp_device_advertiser_start

Start the advertiser thread for the given device

Parameters
devThe device that is to be advertised

◆ mupnp_device_advertiser_stop()

bool mupnp_device_advertiser_stop ( mUpnpDevice * dev)

Stop the advertiser thread for the given device

Parameters
devThe device in question

mupnp_device_advertiser_stop

Stop the advertiser thread for the given device

Parameters
devDevice that is being advertised

◆ mupnp_device_announce()

void mupnp_device_announce ( mUpnpDevice * dev)

Broadcast an SSDP:alive to notify control points that the device is available.

Parameters
devDevice in question

◆ mupnp_device_byebye()

void mupnp_device_byebye ( mUpnpDevice * dev)

Broadcast an SSDP:byebye message to notify control points that the device is no longer available.

Parameters
devDevice in question

◆ mupnp_device_clear()

void mupnp_device_clear ( mUpnpDevice * dev)

Clear a UPnP device structure. This is an internal function and should not be called from outside.

Parameters
devDevice in question

◆ mupnp_device_delete()

void mupnp_device_delete ( mUpnpDevice * dev)

Delete a UPnP device

Parameters
devDevice in question

◆ mupnp_device_getabsoluteiconurl()

bool mupnp_device_getabsoluteiconurl ( mUpnpDevice * dev,
mUpnpIcon * icon,
mUpnpString * buf )

Get an icon by its index from the device's list of icons

Parameters
devDevice in question
iconIcon in question
bufBuffer to return the full icon's url
Returns
true if the absolute url is created, otherwise false.

◆ mupnp_device_getactionbyname()

mUpnpAction * mupnp_device_getactionbyname ( mUpnpDevice * dev,
const char * name )

Find an action from a device by its name

Parameters
devDevice in question
nameName of the action

◆ mupnp_device_getdevicebydescriptionuri()

mUpnpDevice * mupnp_device_getdevicebydescriptionuri ( mUpnpDevice * dev,
const char * url )

Find a child device by its description URI.

Parameters
devDevice in question
urlDescription URI

◆ mupnp_device_getdevicebyexacttype()

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

Parameters
ctrlPointControlpoint in question
exacttypeType 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

Parameters
devDevice in question
exacttypeType of the device

◆ mupnp_device_getdevicebytype()

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

Parameters
devDevice in question
typeType of the device

◆ mupnp_device_getdevicebyudn()

mUpnpDevice * mupnp_device_getdevicebyudn ( mUpnpDevice * dev,
const char * udn )

Find a device from the device's children by the UDN of the device.

Parameters
devDevice in question
typeType of the device

Find a device from the device's children by the UDN of the device.

Parameters
devDevice in question
udnType of the device

◆ mupnp_device_getlocationurl()

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".

Parameters
devDevice in question
hostThe device host
bufBuffer to store the resulting URL
bufSizeBuffer length

◆ mupnp_device_getnotifydevicent()

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).

Parameters
devThe device in question
bufBuffer for the Notification Type
bufSizeBuffer length

◆ mupnp_device_getnotifydevicetypent()

char * mupnp_device_getnotifydevicetypent ( mUpnpDevice * dev,
char * buf,
int bufSize )

Get the device type

Parameters
devThe device in question
bufBuffer for the device type
bufSizeBuffer length

◆ mupnp_device_getnotifydevicetypeusn()

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).

Parameters
devThe device in question
bufBuffer where USN is stored after call
bufSizeBuffer size
Returns
Pointer to buf

◆ mupnp_device_getnotifydeviceusn()

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).

Parameters
devThe device in question

◆ mupnp_device_getrootdevice()

mUpnpDevice * mupnp_device_getrootdevice ( mUpnpDevice * dev)

Return the root (i.e. the topmost) device in the device structure

Parameters
devTraverses the device tree upwards starting from this device

◆ mupnp_device_getservicebycontrolurl()

mUpnpService * mupnp_device_getservicebycontrolurl ( mUpnpDevice * dev,
const char * url )

Find a service from a device by its control URL

Parameters
devDevice in question
urlControl URL

◆ mupnp_device_getservicebyeventsuburl()

mUpnpService * mupnp_device_getservicebyeventsuburl ( mUpnpDevice * dev,
const char * url )

Find a service from a device by its event subscription URL

Parameters
devDevice in question
urlEvent Subscription URL

◆ mupnp_device_getservicebyexacttype()

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

Parameters
devDevice in question
typeType of the service

◆ mupnp_device_getservicebyscpdurl()

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.

Parameters
devDevice in question
urlSCPD URL

◆ mupnp_device_getservicebyserviceid()

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

Parameters
devDevice in question
serviceIdserviceId of the service
Returns
service matching the given serviceId

◆ mupnp_device_getservicebysid()

mUpnpService * mupnp_device_getservicebysid ( mUpnpDevice * dev,
const char * sid )

Find a service from the device by the subscribtion ID

Parameters
devDevice in question
sidSubscription ID of the service

Find a service from its Subscription ID

Parameters
devDevice in question
char*Subscription-ID (SID)

◆ mupnp_device_getservicebytype()

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

Parameters
devDevice in question
typeType 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

Parameters
devDevice in question
typeType of the service

◆ mupnp_device_getsmallesticon()

mUpnpIcon * mupnp_device_getsmallesticon ( mUpnpDevice * dev)

Get a smallest icon

Parameters
devDevice in question
Returns
A smallest icon.

◆ mupnp_device_getsmallesticonbymimetype()

mUpnpIcon * mupnp_device_getsmallesticonbymimetype ( mUpnpDevice * dev,
const char * mimeType )

Get a smallest icon of a specified mime type

Parameters
devDevice in question
mimeTypeMime type to get
Returns
A smallest icon.

◆ mupnp_device_getstatevariablebyname()

mUpnpStateVariable * mupnp_device_getstatevariablebyname ( mUpnpDevice * dev,
const char * name )

Find a state variable from a device by its name

Parameters
devDevice in question
nameName of the state variable

◆ mupnp_device_httprequestrecieved()

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.

Parameters
httpReqReceived HTTP request

◆ mupnp_device_ipchanged()

bool mupnp_device_ipchanged ( mUpnpDevice * dev)

Notify device that IP address of the host has been changed.

Parameters
devdev The device in question
Returns
success of changing used interfaces

◆ mupnp_device_isrunning()

bool mupnp_device_isrunning ( mUpnpDevice * dev)

Check if the device] has been started

Parameters
devDevice that is being advertised

◆ mupnp_device_new()

mUpnpDevice * mupnp_device_new ( void )

Create a new UPnP device

◆ mupnp_device_parsedescription()

bool mupnp_device_parsedescription ( mUpnpDevice * dev,
const char * desciption,
size_t descriptionLen )

Parse the device description XML document.

Parameters
devDevice in question
descriptionBuffer containing the device description in XML format
descriptionLenBuffer length
Returns
true, if the buffer was successfully parsed; otherwise false

◆ mupnp_device_parsedescriptionurl()

bool mupnp_device_parsedescriptionurl ( mUpnpDevice * dev,
mUpnpNetURL * url )

Fetch and parse the device description XML file, located in the given URL.

Parameters
devDevice in question
urlAn internet resource
Returns
true, if the buffer was successfully parsed; otherwise false

◆ mupnp_device_postsearchresponse()

bool mupnp_device_postsearchresponse ( mUpnpDevice * dev,
mUpnpSSDPPacket * ssdpPkt,
const char * st,
const char * usn )

Post a response to an SSDP search message

Parameters
devThe device in question
ssdpPktReceived SSDP packet
stService Type (ST)
usnUnique Service Name (USN)

◆ mupnp_device_setactionlistener()

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.

Parameters
devDevice in question
actionListenerThe action listener

◆ mupnp_device_setdevicenode()

void mupnp_device_setdevicenode ( mUpnpDevice * dev,
mUpnpXmlNode * node )

Set the device description node and initialise its child nodes

Parameters
devDevice in question
nodeThe XML structure to be set as the device's description

◆ mupnp_device_setpresentationlistener()

void mupnp_device_setpresentationlistener ( mUpnpDevice * dev,
MUPNP_PRESENTATION_LISTNER func )

◆ mupnp_device_setquerylistener()

void mupnp_device_setquerylistener ( mUpnpDevice * dev,
MUPNP_STATEVARIABLE_LISTNER queryListner )

Set a query listener to the device. Queries are meant for state variables.

Parameters
devDevice in question
actionListenerThe query listener

◆ mupnp_device_seturlbase()

void mupnp_device_seturlbase ( mUpnpDevice * dev,
char * value )

Modify the device's URL base The base URL is the root for all relative URLs.

Parameters
devDevice in question
valueThe URL base

◆ mupnp_device_ssdplistener()

void mupnp_device_ssdplistener ( mUpnpSSDPPacket * ssdpPkt)

The SSDP message handler function.

Parameters
ssdpPktSSDP Packet

◆ mupnp_device_ssdpmessagereceived()

void mupnp_device_ssdpmessagereceived ( mUpnpDevice * dev,
mUpnpSSDPPacket * ssdpPkt,
int filter )

SSDP message handler

Parameters
devThe device in question
ssdpPktReceived SSDP packet

◆ mupnp_device_start()

bool mupnp_device_start ( mUpnpDevice * dev)

Start the device. This essentially starts:

  • The HTTP server
  • The SSDP server
  • Advertising the device
  • Alive notification
Parameters
devDevice in question

◆ mupnp_device_stop()

bool mupnp_device_stop ( mUpnpDevice * dev)

Stop the device. This concerns:

  • The HTTP server
  • The SSDP server
  • Advertising the device
  • Byebye notification
Parameters
devDevice in question

◆ mupnp_device_updatefromssdppacket()

bool mupnp_device_updatefromssdppacket ( mUpnpDevice * dev,
mUpnpSSDPPacket * ssdpPkt )

Update the device's contents from an SSDP packet if necessary.

Parameters
devThe device to potentially update
ssdpPktThe SSDP packet to make decisions on
Returns
true if the device was updated; otherwise false

◆ mupnp_device_updateudn()

void mupnp_device_updateudn ( mUpnpDevice * dev)

Update new Unique Device Name (UDN)

Parameters
devDevice in question

◆ mupnp_devicelist_delete()

void mupnp_devicelist_delete ( mUpnpDeviceList * devList)

Delete a device list completely, freeing all devices and their contents.

Parameters
devListThe device list to delete

◆ mupnp_devicelist_new()

mUpnpDeviceList * mupnp_devicelist_new ( void )

Create a new device list

◆ mupnp_devicetype_getdevice()

char * mupnp_devicetype_getdevice ( const char * deviceType)

Get the device part of a device type string (usually just "device")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the device part of a device type string (usually just "device")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

◆ mupnp_devicetype_getidentifier()

char * mupnp_devicetype_getidentifier ( const char * deviceType)

Get the identifier-part of a device type string (usually "urn")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the identifier-part of a device type string (usually "urn")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

◆ mupnp_devicetype_getschematype()

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")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the schema type part of a device type string (without last colon) (ex. "urn:schemas-upnp-org:device:ContentDirectory")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

◆ mupnp_devicetype_gettype()

char * mupnp_devicetype_gettype ( const char * deviceType)

Get the type part of a device type string (ex. "ContentDirectory")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the type part of a device type string (ex. "ContentDirectory")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

◆ mupnp_devicetype_geturn()

char * mupnp_devicetype_geturn ( const char * deviceType)

Get the URN part of a device type string (usually "schemas-upnp-org")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the URN part of a device type string (usually "schemas-upnp-org")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

◆ mupnp_devicetype_getversion()

char * mupnp_devicetype_getversion ( const char * deviceType)

Get the version part of a device type string (ex. "1")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL

Get the version part of a device type string (ex. "1")

Parameters
deviceTypeA device type string (usually the result from mupnp_device_getdevicetype)
Returns
A newly-created char* if successful; otherwise NULL