#include <cybergarage/upnp/ccontrolpoint.h>
#include <cybergarage/upnp/cupnp_limit.h>
#include <cybergarage/upnp/control/ccontrol.h>
#include <cybergarage/util/clog.h>
#include <cybergarage/net/curi.h>
Functions |
| static void | cg_upnp_controlpoint_ssdplistner (CgUpnpSSDPPacket *ssdpPkt) |
| static void | cg_upnp_controlpoint_ssdpresponselistner (CgUpnpSSDPPacket *ssdpPkt) |
| char * | cg_upnp_controlpoint_geteventsubcallbackurl (CgUpnpControlPoint *ctrlPoint, char *ifaddr, char *buf, int bufLen) |
| CgUpnpControlPoint * | cg_upnp_controlpoint_new () |
| void | cg_upnp_controlpoint_delete (CgUpnpControlPoint *ctrlPoint) |
| BOOL | cg_upnp_controlpoint_start (CgUpnpControlPoint *ctrlPoint) |
| BOOL | cg_upnp_controlpoint_stop (CgUpnpControlPoint *ctrlPoint) |
| BOOL | cg_upnp_controlpoint_isrunning (CgUpnpControlPoint *ctrlPoint) |
| BOOL | cg_upnp_controlpoint_lock (CgUpnpControlPoint *ctrlPoint) |
| BOOL | cg_upnp_controlpoint_unlock (CgUpnpControlPoint *ctrlPoint) |
| CgUpnpDevice * | cg_upnp_controlpoint_getdevicebyexacttype (CgUpnpControlPoint *ctrlPoint, char *exacttype) |
| CgUpnpDevice * | cg_upnp_controlpoint_getdevicebytype (CgUpnpControlPoint *ctrlPoint, char *type) |
| CgUpnpDevice * | cg_upnp_controlpoint_getdevicebyudn (CgUpnpControlPoint *ctrlPoint, char *udn) |
| BOOL | cg_upnp_controlpoint_parsescservicescpd (CgUpnpService *service) |
| BOOL | cg_upnp_controlpoint_parseservicesfordevice (CgUpnpDevice *dev, CgUpnpSSDPPacket *ssdpPkt) |
| static CgUpnpDevice * | cg_upnp_controlpoint_createdevicefromssdkpacket (CgUpnpSSDPPacket *ssdpPkt) |
| void | cg_upnp_controlpoint_adddevicebyssdppacket (CgUpnpControlPoint *ctrlPoint, CgUpnpSSDPPacket *ssdpPkt) |
| void | cg_upnp_controlpoint_removedevicebyssdppacket (CgUpnpControlPoint *ctrlPoint, CgUpnpSSDPPacket *ssdpPkt) |
| BOOL | cg_upnp_controlpoint_search (CgUpnpControlPoint *ctrlPoint, char *target) |
| BOOL | cg_upnp_controlpoint_ipchanged (CgUpnpControlPoint *ctrlPoint) |
Function Documentation
Add a device on the basis of an SSDP packet. Do not call this from user applications.
- Parameters:
-
| ctrlPoint | The control point, whose device list to handle |
| ssdpPkt | The received SSDP packet |
Destroy the given control point
- Parameters:
-
| ctrlPoint | The control point struct to destroy |
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 cg_upnp_controlpoint_getdevicebytype
- Parameters:
-
| ctrlPoint | Controlpoint in question |
| exacttype | Type 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 cg_upnp_devicetype_getversion
- Parameters:
-
| ctrlPoint | Controlpoint in question |
| type | Type of the device |
Find a device from the controlpoint by the UDN of the device.
- Parameters:
-
| ctrlPoint | Controlpoint in question |
| udn | Type of the device |
| char* cg_upnp_controlpoint_geteventsubcallbackurl |
( |
CgUpnpControlPoint * |
ctrlPoint, |
|
|
char * |
ifaddr, |
|
|
char * |
buf, |
|
|
int |
bufLen |
|
) |
| |
Get the event subscription callback URI
- Parameters:
-
| ctrlPoint | The control point in question |
| ifaddr | Interface address |
| buf | Buffer used to store callback url |
| bufLen | Buffer length |
- Returns:
- Event callback url (pointer to buf)
Notify the control point that any IP of the host has been changed.
- Parameters:
-
| ctrlpoint | The control point in use |
- Returns:
- success of changing used interfaces
Check if the control point is activated.
- Parameters:
-
| ctrlPoint | The control point to stop |
- Returns:
- TRUE if running; otherwise FALSE
Lock the control point's mutex. The control point should be ALWAYS locked, when a CgUpnpDevice*, CgUpnpService*, CgUpnpAction* 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 cg_upnp_controlpoint_unlock
- Note:
- Do NOT save any CgUpnp* 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:
-
| ctrlPoint | The control point in question |
Create a new control point. Does not start any threads.
- Returns:
- A newly-created CgUpnpControlPoint
Parse the service description from the service's SCPD URL. Do not call this from user applications.
- Parameters:
-
| service | The service in question |
- Returns:
- TRUE if successful; otherwise FALSE
Parse the device's services using the received SSDP packet. Do not call this from user applications.
- Parameters:
-
| dev | The device in question |
| ssdpPkt | An SSDP packet |
Remove a device on the basis of an SSDP packet. Do not call this from user applications.
- Parameters:
-
| ctrlPoint | The control point, whose device list to handle |
| ssdpPkt | The received SSDP packet |
Do an M-SEARCH to look for devices in the network.
- Parameters:
-
| ctrlPoint | The control point in question |
| target | The Search Target parameter (ex. "ssdp:all") |
| static void cg_upnp_controlpoint_ssdplistner |
( |
CgUpnpSSDPPacket * |
ssdpPkt | ) |
[static] |
| static void cg_upnp_controlpoint_ssdpresponselistner |
( |
CgUpnpSSDPPacket * |
ssdpPkt | ) |
[static] |
Activate the control point. Starts listening for SSDP messages etc. You must call this function before you can actually use a control point.
- Parameters:
-
| ctrlPoint | The control point to start |
- Returns:
- TRUE if successful; otherwise FALSE
Stop the control point. Stops sending/receiveing/responding to any messages.
- Parameters:
-
| ctrlPoint | The control point to stop |
- Returns:
- TRUE if successful; otherwise FALSE
Release a previously locked control point mutex. See cg_upnp_controlpoint_lock for a more detailed description on the control point locking mechanism.
- Parameters:
-
| ctrlPoint | The control point in question |