mUPnP for C
controlpoint.h File Reference

Data Structures

struct  _mUpnpControlPoint
 

Macros

#define MUPNP_CONTROLPOINT_SSDP_DEFAULT_SEARCH_MX   3
 
#define MUPNP_CONTROLPOINT_SSDP_MIN_DELAY   20
 
#define MUPNP_CONTROLPOINT_SSDP_RESPONSE_DEFAULT_PORT   39400
 
#define MUPNP_CONTROLPOINT_SSDP_RESPONSE_PORT_MAX_TRIES_INDEX   80
 
#define MUPNP_CONTROLPOINT_HTTP_EVENT_DEFAULT_PORT   39500
 
#define MUPNP_CONTROLPOINT_HTTP_EVENTSUB_URI   "/eventSub"
 
#define mupnp_controlpoint_getssdpserverlist(ctrlPoint)
 
#define mupnp_controlpoint_getssdpresponseserverlist(ctrlPoint)
 
#define mupnp_controlpoint_gethttpserverlist(ctrlPoint)
 
#define mupnp_controlpoint_setssdplistener(ctrlPoint, func)
 
#define mupnp_controlpoint_getssdplistener(ctrlPoint)
 
#define mupnp_controlpoint_setssdpresponselistener(ctrlPoint, func)
 
#define mupnp_controlpoint_getssdpresponselistener(ctrlPoint)
 
#define mupnp_controlpoint_setdevicelistener(ctrlPoint, func)
 
#define mupnp_controlpoint_getdevicelistener(ctrlPoint)
 
#define mupnp_controlpoint_addeventlistener(ctrlPoint, listener)
 
#define mupnp_controlpoint_removeeventlistener(ctrlPoint, listener)
 
#define mupnp_controlpoint_geteventlistener(ctrlPoint)
 
#define mupnp_controlpoint_geteventlisteners(ctrlPoint)
 
#define mupnp_controlpoint_setssdpresponseport(ctrlPoint, port)
 
#define mupnp_controlpoint_getssdpresponseport(ctrlPoint)
 
#define mupnp_controlpoint_seteventport(ctrlPoint, port)
 
#define mupnp_controlpoint_geteventport(ctrlPoint)
 
#define mupnp_controlpoint_seteventsuburi(ctrlPoint, uri)
 
#define mupnp_controlpoint_geteventsuburi(ctrlPoint)
 
#define mupnp_controlpoint_setssdpsearchmx(ctrlPoint, value)
 
#define mupnp_controlpoint_getssdpsearchmx(ctrlPoint)
 
#define mupnp_controlpoint_sethttplistener(ctrlPoint, func)
 
#define mupnp_controlpoint_gethttplistener(ctrlPoint)
 
#define mupnp_controlpoint_setuserdata(ctrlPoint, value)
 
#define mupnp_controlpoint_getuserdata(ctrlPoint)
 
#define mupnp_controlpoint_getdevices(ctrlPoint)
 
#define mupnp_controlpoint_getndevices(ctrlPoint)
 
#define mupnp_controlpoint_getdevice(ctrlPoint, index)
 
#define mupnp_controlpoint_adddevice(ctrlPoint, dev)
 

Typedefs

typedef enum _mUpnpDeviceStatus mUpnpDeviceStatus
 
typedef struct _mUpnpControlPoint mUpnpControlPoint
 
typedef void(* MUPNP_DEVICE_LISTENER) (mUpnpControlPoint *ctrlPoint, const char *udn, mUpnpDeviceStatus status)
 

Enumerations

enum  _mUpnpDeviceStatus { mUpnpDeviceStatusAdded = 0 , mUpnpDeviceStatusUpdated , mUpnpDeviceStatusInvalid , mUpnpDeviceStatusRemoved }
 

Functions

mUpnpControlPointmupnp_controlpoint_new (void)
 
void mupnp_controlpoint_delete (mUpnpControlPoint *ctrlPoint)
 
bool mupnp_controlpoint_start (mUpnpControlPoint *ctrlPoint)
 
bool mupnp_controlpoint_stop (mUpnpControlPoint *ctrlPoint)
 
bool mupnp_controlpoint_isrunning (mUpnpControlPoint *ctrlPoint)
 
bool mupnp_controlpoint_lock (mUpnpControlPoint *ctrlPoint)
 
bool mupnp_controlpoint_unlock (mUpnpControlPoint *ctrlPoint)
 
mUpnpDevicemupnp_controlpoint_getdevicebyexacttype (mUpnpControlPoint *ctrlPoint, const char *exacttype)
 
mUpnpDevicemupnp_controlpoint_getdevicebytype (mUpnpControlPoint *ctrlPoint, const char *type)
 
mUpnpDevicemupnp_controlpoint_getdevicebyudn (mUpnpControlPoint *ctrlPoint, const char *udn)
 
bool mupnp_controlpoint_seteventlistener (mUpnpControlPoint *ctrlPoint, MUPNP_EVENT_LISTENER evlistener)
 
bool mupnp_controlpoint_search (mUpnpControlPoint *ctrlPoint, const char *target)
 
void mupnp_controlpoint_httprequestreceived (mUpnpHttpRequest *httpReq)
 
void mupnp_controlpoint_updatestatetablefromproperty (mUpnpService *service, mUpnpProperty *prop)
 
bool mupnp_controlpoint_parsescservicescpd (mUpnpService *service)
 
bool mupnp_controlpoint_parseservicesfordevice (mUpnpDevice *dev, mUpnpSSDPPacket *ssdpPkt)
 
void mupnp_controlpoint_adddevicebyssdppacket (mUpnpControlPoint *ctrlPoint, mUpnpSSDPPacket *ssdpPkt)
 
void mupnp_controlpoint_removedevicebyssdppacket (mUpnpControlPoint *ctrlPoint, mUpnpSSDPPacket *ssdpPkt)
 
bool mupnp_controlpoint_subscribe (mUpnpControlPoint *ctrlPoint, mUpnpService *service, long timeout)
 
bool mupnp_controlpoint_resubscribe (mUpnpControlPoint *ctrlPoint, mUpnpService *service, long timeout)
 
bool mupnp_controlpoint_unsubscribe (mUpnpControlPoint *ctrlPoint, mUpnpService *service)
 
bool mupnp_controlpoint_subscribeall (mUpnpControlPoint *ctrlPoint, mUpnpDevice *dev, long timeout)
 
bool mupnp_controlpoint_resubscribeall (mUpnpControlPoint *ctrlPoint, mUpnpDevice *dev, long timeout)
 
bool mupnp_controlpoint_unsubscribeall (mUpnpControlPoint *ctrlPoint, mUpnpDevice *dev)
 
void mupnp_controlpoint_expirationhandler (mUpnpThread *thread)
 
bool mupnp_controlpoint_ipchanged (mUpnpControlPoint *ctrlpoint)
 
const char * mupnp_controlpoint_geteventsubcallbackurl (mUpnpControlPoint *ctrlPoint, char *ifaddr, char *buf, size_t bufLen)
 

Macro Definition Documentation

◆ mupnp_controlpoint_adddevice

#define mupnp_controlpoint_adddevice ( ctrlPoint,
dev )
Value:
mupnp_devicelist_add(ctrlPoint->deviceList, dev)
#define mupnp_devicelist_add(devList, dev)
Definition device.h:1296

Add a device to the control point's list of devices. Do not call this from user applications.

Parameters
ctrlPointThe control point in use
devThe device to add

◆ mupnp_controlpoint_addeventlistener

#define mupnp_controlpoint_addeventlistener ( ctrlPoint,
listener )
Value:
(mupnp_eventlistenerlist_add(ctrlPoint->eventListeners, listener))
void mupnp_eventlistenerlist_add(mUpnpEventListenerList *eventListenerList, MUPNP_EVENT_LISTENER listener)
Definition eventlistener_list.c:89

Set an event listener for the control point. Use this function to get event notifications to user-space applications.

Parameters
ctrlPointThe control point in question
listenerA callback function that is of type MUPNP_EVENT_LISTENER

◆ mupnp_controlpoint_getdevice

#define mupnp_controlpoint_getdevice ( ctrlPoint,
index )
Value:
mupnp_devicelist_get(ctrlPoint->deviceList, index)
#define mupnp_devicelist_get(devList, index)
Definition device.h:1287

Get the head of the control point's list of devices (use for iteration)

Parameters
ctrlPointThe control point in use
indexThe index of the device to get
Returns
The specified device

◆ mupnp_controlpoint_getdevicelistener

#define mupnp_controlpoint_getdevicelistener ( ctrlPoint)
Value:
(ctrlPoint->deviceListener)

Get the device listener for the control point.

Parameters
ctrlPointThe control point in question
Returns
A callback function that is of type MUPNP_DEVICE_LISTENER or NULL

◆ mupnp_controlpoint_getdevices

#define mupnp_controlpoint_getdevices ( ctrlPoint)
Value:
mupnp_devicelist_gets(ctrlPoint->deviceList)
#define mupnp_devicelist_gets(devList)
Definition device.h:1278

Get the head of the control point's list of devices (use for iteration)

Parameters
ctrlPointThe control point in use
Returns
The head of the device list

◆ mupnp_controlpoint_geteventlistener

#define mupnp_controlpoint_geteventlistener ( ctrlPoint)
Value:
(ctrlPoint->eventListeners->next->listener)

Get the single event listener for the control point.

Parameters
ctrlPointThe control point in question
Returns
The callback function, that is of type MUPNP_EVENT_LISTENER, or NULL if there is no listener

◆ mupnp_controlpoint_geteventlisteners

#define mupnp_controlpoint_geteventlisteners ( ctrlPoint)
Value:
(ctrlPoint->eventListeners)

Get the list of event listeners for the control point.

Parameters
ctrlPointThe control point in question
Returns
List of MUPNP_EVENT_LISTENER functions

◆ mupnp_controlpoint_geteventport

#define mupnp_controlpoint_geteventport ( ctrlPoint)
Value:
(ctrlPoint->httpEventPort)

Get the IP port number for the control point's event reception

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_geteventsuburi

#define mupnp_controlpoint_geteventsuburi ( ctrlPoint)
Value:
mupnp_string_getvalue(ctrlPoint->httpEventURI)
char * mupnp_string_getvalue(mUpnpString *str)
Definition string.c:177

Get the URI used for the control point's event subscription notifications

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_gethttplistener

#define mupnp_controlpoint_gethttplistener ( ctrlPoint)
Value:
(ctrlPoint->httpListener)

Get the HTTP listener function for the control point.

Parameters
ctrlPointThe control point in question
Returns
The listener function, that is of type MUPNP_HTTP_LISTENER

◆ mupnp_controlpoint_gethttpserverlist

#define mupnp_controlpoint_gethttpserverlist ( ctrlPoint)
Value:
(ctrlPoint->httpServerList)

Get the list of HTTP servers associated to the control point

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_getndevices

#define mupnp_controlpoint_getndevices ( ctrlPoint)
Value:
mupnp_devicelist_size(ctrlPoint->deviceList)
#define mupnp_devicelist_size(devList)
Definition device.h:1270

Get the number of devices known by the control point

Parameters
ctrlPointThe control point in use
Returns
The number of devices in the control point's device list

◆ mupnp_controlpoint_getssdplistener

#define mupnp_controlpoint_getssdplistener ( ctrlPoint)
Value:
(ctrlPoint->ssdpListener)

Get the SSDP message listener for the control point.

Parameters
ctrlPointThe control point in question
Returns
A callback function that is of type MUPNP_SSDP_LISTNER or NULL

◆ mupnp_controlpoint_getssdpresponselistener

#define mupnp_controlpoint_getssdpresponselistener ( ctrlPoint)
Value:
(ctrlPoint->ssdpResListener)

Get the SSDP response listener for the control point.

Parameters
ctrlPointThe control point in question
Returns
A callback function that is of type MUPNP_SSDP_RESPONSE_LISTNER or NULL

◆ mupnp_controlpoint_getssdpresponseport

#define mupnp_controlpoint_getssdpresponseport ( ctrlPoint)
Value:
(ctrlPoint->ssdpResPort)

Get the IP port number used for the control point's SSDP responses

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_getssdpresponseserverlist

#define mupnp_controlpoint_getssdpresponseserverlist ( ctrlPoint)
Value:
(ctrlPoint->ssdpResServerList)

Get the list of SSDP response servers associated to the control point

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_getssdpsearchmx

#define mupnp_controlpoint_getssdpsearchmx ( ctrlPoint)
Value:
(ctrlPoint->ssdpSearchMx)

Get the MX-parameter used for SSDP searches

Parameters
ctrlPointThe control point in question
Returns
value MX; Time to wait

◆ mupnp_controlpoint_getssdpserverlist

#define mupnp_controlpoint_getssdpserverlist ( ctrlPoint)
Value:
(ctrlPoint->ssdpServerList)

Get the list of SSDP servers associated to the control point

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_getuserdata

#define mupnp_controlpoint_getuserdata ( ctrlPoint)
Value:
(ctrlPoint->userData)

Get the user data pointer (arbitrary user data) from the control point.

Parameters
devThe control point in question
Returns
Pointer to user data or NULL

◆ MUPNP_CONTROLPOINT_HTTP_EVENT_DEFAULT_PORT

#define MUPNP_CONTROLPOINT_HTTP_EVENT_DEFAULT_PORT   39500

Definition for HTTP event default port

◆ MUPNP_CONTROLPOINT_HTTP_EVENTSUB_URI

#define MUPNP_CONTROLPOINT_HTTP_EVENTSUB_URI   "/eventSub"

Definition for default controlpoint event callback "location"

◆ mupnp_controlpoint_removeeventlistener

#define mupnp_controlpoint_removeeventlistener ( ctrlPoint,
listener )
Value:
(mupnp_eventlistenerlist_remove(ctrlPoint->eventListeners, listener))
void mupnp_eventlistenerlist_remove(mUpnpEventListenerList *eventListenerList, MUPNP_EVENT_LISTENER listener)
Definition eventlistener_list.c:60

Remove an event listener from the control point.

Parameters
ctrlPointThe control point in question
listenerThe callback function to remove, that is of type MUPNP_EVENT_LISTENER

◆ mupnp_controlpoint_setdevicelistener

#define mupnp_controlpoint_setdevicelistener ( ctrlPoint,
func )
Value:
(ctrlPoint->deviceListener = func)

Set device listener for the control point.

Parameters
ctrlPointThe control point
funcA callback function that is type MUPNP_DEVICE_LISTENER or NULL

◆ mupnp_controlpoint_seteventport

#define mupnp_controlpoint_seteventport ( ctrlPoint,
port )
Value:
(ctrlPoint->httpEventPort = port)

Set the IP port number for the control point's event reception

Parameters
ctrlPointThe control point in question
portThe IP port number

◆ mupnp_controlpoint_seteventsuburi

#define mupnp_controlpoint_seteventsuburi ( ctrlPoint,
uri )
Value:
mupnp_string_setvalue(ctrlPoint->httpEventURI, uri)
void mupnp_string_setvalue(mUpnpString *str, const char *value)
Definition string.c:84

Set the URI used for the control point's event subscription notifications

Parameters
ctrlPointThe control point in question
uriThe URI to set

◆ mupnp_controlpoint_sethttplistener

#define mupnp_controlpoint_sethttplistener ( ctrlPoint,
func )
Value:
(ctrlPoint->httpListener = func)

Set an HTTP listener function to the control point. Use this function to get HTTP requests to user-space applications.

Parameters
ctrlPointThe control point in question
funcThe listener function, that is of type MUPNP_HTTP_LISTENER

◆ mupnp_controlpoint_setssdplistener

#define mupnp_controlpoint_setssdplistener ( ctrlPoint,
func )
Value:
(ctrlPoint->ssdpListener = func)

Set an SSDP message listener for the control point. Use this function to get SSDP messages to user-space applications.

Parameters
ctrlPointThe control point in question
funcA callback function that is of type MUPNP_SSDP_LISTNER

◆ mupnp_controlpoint_setssdpresponselistener

#define mupnp_controlpoint_setssdpresponselistener ( ctrlPoint,
func )
Value:
(ctrlPoint->ssdpResListener = func)

Set an SSDP response listener for the control point. Use this function to get SSDP responses to user-space applications.

Parameters
ctrlPointThe control point in question
funcA callback function that is of type MUPNP_SSDP_RESPONSE_LISTNER

◆ mupnp_controlpoint_setssdpresponseport

#define mupnp_controlpoint_setssdpresponseport ( ctrlPoint,
port )
Value:
(ctrlPoint->ssdpResPort = port)

Set the IP port number used for the control point's SSDP responses

Parameters
ctrlPointThe control point in question
portThe IP port number

◆ mupnp_controlpoint_setssdpsearchmx

#define mupnp_controlpoint_setssdpsearchmx ( ctrlPoint,
value )
Value:
(ctrlPoint->ssdpSearchMx = value)

Set the MX-parameter used for SSDP searches i.e. Set the time to wait (in seconds) for device responses to an M-SEARCH

Parameters
ctrlPointThe control point in question
valueMX; Time to wait

◆ mupnp_controlpoint_setuserdata

#define mupnp_controlpoint_setuserdata ( ctrlPoint,
value )
Value:
(ctrlPoint->userData = value)

Set the user data pointer (arbitrary user data) to the control point.

Parameters
ctrlPointThe control point in question
valueArbitrary user data

◆ MUPNP_CONTROLPOINT_SSDP_DEFAULT_SEARCH_MX

#define MUPNP_CONTROLPOINT_SSDP_DEFAULT_SEARCH_MX   3

Definition for SSDP default search MX

◆ MUPNP_CONTROLPOINT_SSDP_MIN_DELAY

#define MUPNP_CONTROLPOINT_SSDP_MIN_DELAY   20

Definition for control point SSDP minimum delay

◆ MUPNP_CONTROLPOINT_SSDP_RESPONSE_DEFAULT_PORT

#define MUPNP_CONTROLPOINT_SSDP_RESPONSE_DEFAULT_PORT   39400

Definition for control point default response port

◆ MUPNP_CONTROLPOINT_SSDP_RESPONSE_PORT_MAX_TRIES_INDEX

#define MUPNP_CONTROLPOINT_SSDP_RESPONSE_PORT_MAX_TRIES_INDEX   80

Definition for numeric constant to specify the max tries to open a SSDP Response Port (rosfran.borges)

Typedef Documentation

◆ MUPNP_DEVICE_LISTENER

typedef void(* MUPNP_DEVICE_LISTENER) (mUpnpControlPoint *ctrlPoint, const char *udn, mUpnpDeviceStatus status)

◆ mUpnpControlPoint

Prototype for control point's device listener callback.

Parameters
udnThe UDN of the device, that the status update concerns
statusThe new status

◆ mUpnpDeviceStatus

Device listener status parameters.

mUpnpDeviceStatusAdded means a device has been added to local cache. mUpnpDeviceStatusUpdated means a device description has been updated because its IP address or description has changed. The user should renew any active subscriptions if this has been received.

mUpnpDeviceStatusInvalid is basically the same as mUpnpDeviceStatusRemoved, but mUpnpDeviceStatusRemoved is sent only when a device leaves the network in a proper way (i.e. with UPnP ByeBye messages). The user should immediately cease using the device, because it will be removed in both cases.

Enumeration Type Documentation

◆ _mUpnpDeviceStatus

Device listener status parameters.

mUpnpDeviceStatusAdded means a device has been added to local cache. mUpnpDeviceStatusUpdated means a device description has been updated because its IP address or description has changed. The user should renew any active subscriptions if this has been received.

mUpnpDeviceStatusInvalid is basically the same as mUpnpDeviceStatusRemoved, but mUpnpDeviceStatusRemoved is sent only when a device leaves the network in a proper way (i.e. with UPnP ByeBye messages). The user should immediately cease using the device, because it will be removed in both cases.

Enumerator
mUpnpDeviceStatusAdded 
mUpnpDeviceStatusUpdated 
mUpnpDeviceStatusInvalid 
mUpnpDeviceStatusRemoved 

Function Documentation

◆ mupnp_controlpoint_adddevicebyssdppacket()

void mupnp_controlpoint_adddevicebyssdppacket ( mUpnpControlPoint * ctrlPoint,
mUpnpSSDPPacket * ssdpPkt )

Add a device on the basis of an SSDP packet. Do not call this from user applications.

Parameters
ctrlPointThe control point, whose device list to handle
ssdpPktThe received SSDP packet

◆ mupnp_controlpoint_delete()

void mupnp_controlpoint_delete ( mUpnpControlPoint * ctrlPoint)

Destroy the given control point

Parameters
ctrlPointThe control point struct to destroy

◆ mupnp_controlpoint_expirationhandler()

void mupnp_controlpoint_expirationhandler ( mUpnpThread * thread)

Worker thread for handling expirations.

Parameters
threadthe thread in question

◆ mupnp_controlpoint_getdevicebyexacttype()

mUpnpDevice * mupnp_controlpoint_getdevicebyexacttype ( mUpnpControlPoint * ctrlPoint,
const char * exacttype )

Find a device from the control point 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_controlpoint_getdevicebytype

Parameters
ctrlPointControlpoint in question
exacttypeType of the device

Find a device from the control point 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_controlpoint_getdevicebytype

Parameters
ctrlPointControlpoint in question
exacttypeType of the device

◆ mupnp_controlpoint_getdevicebytype()

mUpnpDevice * mupnp_controlpoint_getdevicebytype ( mUpnpControlPoint * ctrlPoint,
const char * type )

Find a device from the controlpoint 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
ctrlPointControlpoint in question
typeType of the device

Find a device from the controlpoint 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
ctrlPointControlpoint in question
typeType of the device

◆ mupnp_controlpoint_getdevicebyudn()

mUpnpDevice * mupnp_controlpoint_getdevicebyudn ( mUpnpControlPoint * ctrlPoint,
const char * udn )

Find a device from the controlpoint by the UDN of the device.

Parameters
ctrlPointControlpoint in question
typeType of the device

Find a device from the controlpoint by the UDN of the device.

Parameters
ctrlPointControlpoint in question
udnType of the device

◆ mupnp_controlpoint_geteventsubcallbackurl()

const char * mupnp_controlpoint_geteventsubcallbackurl ( mUpnpControlPoint * ctrlPoint,
char * ifaddr,
char * buf,
size_t bufLen )

Get the event subscription callback URI

Parameters
ctrlPointThe control point in question

Get the event subscription callback URI

Parameters
ctrlPointThe control point in question
ifaddrInterface address
bufBuffer used to store callback url
bufLenBuffer length
Returns
Event callback url (pointer to buf)

◆ mupnp_controlpoint_httprequestreceived()

void mupnp_controlpoint_httprequestreceived ( mUpnpHttpRequest * httpReq)

The function that calls all HTTP listener callback functions. Do not call this from applications.

Parameters
httpReqThe received HTTP request

◆ mupnp_controlpoint_ipchanged()

bool mupnp_controlpoint_ipchanged ( mUpnpControlPoint * ctrlpoint)

Notify the control point that any IP of the host has been changed.

Parameters
ctrlpointThe control point in use
Returns
success of changing used interfaces

◆ mupnp_controlpoint_isrunning()

bool mupnp_controlpoint_isrunning ( mUpnpControlPoint * ctrlPoint)

Check if the control point is activated.

Parameters
ctrlPointThe control point to stop
Returns
true if running; otherwise false

◆ mupnp_controlpoint_lock()

bool mupnp_controlpoint_lock ( mUpnpControlPoint * ctrlPoint)

Lock the control point's mutex. The control point should be ALWAYS locked, when a mUpnpDevice*, mUpnpService*, mUpnpAction* or other pointer has been taken into use from the stack. This effectively prevents devices/services from being updated/ removed or added while the control point is locked. You should release the lock as soon as possible with mupnp_controlpoint_unlock

Note
Do NOT save any mUpnp* pointers to user-space variables. Use them only as local variables (inside one function) after gaining a mutex lock. Release the lock as soon as you are done accessing the pointer, and then discard the pointer immediately.
Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_new()

mUpnpControlPoint * mupnp_controlpoint_new ( void )

Create a new control point. Does not start any threads.

Returns
A newly-created mUpnpControlPoint

◆ mupnp_controlpoint_parsescservicescpd()

bool mupnp_controlpoint_parsescservicescpd ( mUpnpService * service)

Parse the service description from the service's SCPD URL. Do not call this from user applications.

Parameters
serviceThe service in question
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_parseservicesfordevice()

bool mupnp_controlpoint_parseservicesfordevice ( mUpnpDevice * dev,
mUpnpSSDPPacket * ssdpPkt )

Parse the device's services using the received SSDP packet. Do not call this from user applications.

Parameters
devThe device in question
ssdpPktAn SSDP packet

◆ mupnp_controlpoint_removedevicebyssdppacket()

void mupnp_controlpoint_removedevicebyssdppacket ( mUpnpControlPoint * ctrlPoint,
mUpnpSSDPPacket * ssdpPkt )

Remove a device on the basis of an SSDP packet. Do not call this from user applications.

Parameters
ctrlPointThe control point, whose device list to handle
ssdpPktThe received SSDP packet

◆ mupnp_controlpoint_resubscribe()

bool mupnp_controlpoint_resubscribe ( mUpnpControlPoint * ctrlPoint,
mUpnpService * service,
long timeout )

Re-subscribe to a service's events (i.e. renew subscription)

Parameters
ctrlPointThe control point in use
serviceThe service to subscribe to
timeoutTimeout for subscription expiration/renewal
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_resubscribeall()

bool mupnp_controlpoint_resubscribeall ( mUpnpControlPoint * ctrlPoint,
mUpnpDevice * dev,
long timeout )

Re-subscribe to all of the device's services' events (i.e. renew subscription)

Parameters
ctrlPointThe control point in use
devThe device to subscribe to
timeoutTimeout for subscription expiration/renewal
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_search()

bool mupnp_controlpoint_search ( mUpnpControlPoint * ctrlPoint,
const char * target )

Do an M-SEARCH to look for devices in the network.

Parameters
ctrlPointThe control point in question
targetThe Search Target parameter (ex. "ssdp:all")

◆ mupnp_controlpoint_seteventlistener()

bool mupnp_controlpoint_seteventlistener ( mUpnpControlPoint * ctrlPoint,
MUPNP_EVENT_LISTENER evlistener )

Set a single event listener for the control point. Use this function to get event notifications to user-space applications if you need only one listener.

Parameters
ctrlPointThe control point in question
evlistenerThe callback function to set, that is of type MUPNP_EVENT_LISTENER, or NULL

◆ mupnp_controlpoint_start()

bool mupnp_controlpoint_start ( mUpnpControlPoint * ctrlPoint)

Activate the control point. Starts listening for SSDP messages etc. You must call this function before you can actually use a control point.

Parameters
ctrlPointThe control point to start
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_stop()

bool mupnp_controlpoint_stop ( mUpnpControlPoint * ctrlPoint)

Stop the control point. Stops sending/receiveing/responding to any messages.

Parameters
ctrlPointThe control point to stop
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_subscribe()

bool mupnp_controlpoint_subscribe ( mUpnpControlPoint * ctrlPoint,
mUpnpService * service,
long timeout )

Subscribe to a service's events

Parameters
ctrlPointThe control point in use
serviceThe service to subscribe to
timeoutTimeout for subscription expiration/renewal
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_subscribeall()

bool mupnp_controlpoint_subscribeall ( mUpnpControlPoint * ctrlPoint,
mUpnpDevice * dev,
long timeout )

Subscribe to all of the device's services' events

Parameters
ctrlPointThe control point in use
devThe device to subscribe to
timeoutTimeout for subscription expiration/renewal
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_unlock()

bool mupnp_controlpoint_unlock ( mUpnpControlPoint * ctrlPoint)

Release a previously locked control point mutex. See mupnp_controlpoint_lock for a more detailed description on the control point locking mechanism.

Parameters
ctrlPointThe control point in question

◆ mupnp_controlpoint_unsubscribe()

bool mupnp_controlpoint_unsubscribe ( mUpnpControlPoint * ctrlPoint,
mUpnpService * service )

Unsubscribe to a service's events (i.e. cancel subscription)

Parameters
ctrlPointThe control point in use
serviceThe service to unsubscribe to
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_unsubscribeall()

bool mupnp_controlpoint_unsubscribeall ( mUpnpControlPoint * ctrlPoint,
mUpnpDevice * dev )

Unsubscribe to all of the device's services' events (i.e. cancel subscription)

Parameters
ctrlPointThe control point in use
devThe device to unsubscribe to
Returns
true if successful; otherwise false

◆ mupnp_controlpoint_updatestatetablefromproperty()

void mupnp_controlpoint_updatestatetablefromproperty ( mUpnpService * service,
mUpnpProperty * prop )

When an event is received, update also the associated service's state table to include the evented state variable.

Parameters
serviceThe service, whose state table to update
propThe evented property from which to update