mUPnP for C
|
#include <mupnp/control/control.h>
#include <mupnp/controlpoint.h>
#include <mupnp/net/uri.h>
#include <mupnp/upnp_limit.h>
#include <mupnp/util/log.h>
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.
ctrlPoint | The control point, whose device list to handle |
ssdpPkt | The received SSDP packet |
|
static |
void mupnp_controlpoint_delete | ( | mUpnpControlPoint * | ctrlPoint | ) |
Destroy the given control point
ctrlPoint | The control point struct to destroy |
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
ctrlPoint | Controlpoint in question |
exacttype | Type of the device |
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
ctrlPoint | Controlpoint in question |
type | Type of the device |
mUpnpDevice * mupnp_controlpoint_getdevicebyudn | ( | mUpnpControlPoint * | ctrlPoint, |
const char * | udn ) |
Find a device from the controlpoint by the UDN of the device.
ctrlPoint | Controlpoint in question |
udn | Type of the device |
const char * mupnp_controlpoint_geteventsubcallbackurl | ( | mUpnpControlPoint * | ctrlPoint, |
char * | ifaddr, | ||
char * | buf, | ||
size_t | bufLen ) |
Get the event subscription callback URI
ctrlPoint | The control point in question |
ifaddr | Interface address |
buf | Buffer used to store callback url |
bufLen | Buffer length |
bool mupnp_controlpoint_ipchanged | ( | mUpnpControlPoint * | ctrlpoint | ) |
Notify the control point that any IP of the host has been changed.
ctrlpoint | The control point in use |
bool mupnp_controlpoint_isrunning | ( | mUpnpControlPoint * | ctrlPoint | ) |
Check if the control point is activated.
ctrlPoint | The control point to stop |
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
ctrlPoint | The control point in question |
mUpnpControlPoint * mupnp_controlpoint_new | ( | void | ) |
Create a new control point. Does not start any threads.
bool mupnp_controlpoint_parsescservicescpd | ( | mUpnpService * | service | ) |
Parse the service description from the service's SCPD URL. Do not call this from user applications.
service | The service in question |
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.
dev | The device in question |
ssdpPkt | An SSDP packet |
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.
ctrlPoint | The control point, whose device list to handle |
ssdpPkt | The received SSDP packet |
bool mupnp_controlpoint_search | ( | mUpnpControlPoint * | ctrlPoint, |
const char * | target ) |
Do an M-SEARCH to look for devices in the network.
ctrlPoint | The control point in question |
target | The Search Target parameter (ex. "ssdp:all") |
|
static |
|
static |
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.
ctrlPoint | The control point to start |
bool mupnp_controlpoint_stop | ( | mUpnpControlPoint * | ctrlPoint | ) |
Stop the control point. Stops sending/receiveing/responding to any messages.
ctrlPoint | The control point to stop |
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.
ctrlPoint | The control point in question |