ccontentdirectory.h File Reference

#include <cybergarage/upnp/cdevice.h>
#include <cybergarage/upnp/cservice.h>
#include <cybergarage/upnp/caction.h>
#include <cybergarage/xml/cxml.h>

Go to the source code of this file.

Data Structures

struct  _CgUpnpAVCDS
 The Content Directory Service structure. More...

Defines

#define CG_UPNP_CDS_SERVICE_TYPE   "urn:schemas-upnp-org:service:ContentDirectory"
#define CG_UPNP_CDS_ACTION_GETSEARCHCAPABILITIES   "GetSearchCapabilities"
#define CG_UPNP_CDS_ACTION_GETSORTCAPABILITIES   "GetSortCapabilities"
#define CG_UPNP_CDS_ACTION_GETSYSTEMUPDATEID   "GetSystemUpdateID"
#define CG_UPNP_CDS_ACTION_BROWSE   "Browse"
#define CG_UPNP_CDS_ACTION_SEARCH   "Search"
#define CG_UPNP_CDS_ACTION_CREATEOBJECT   "CreateObject"
#define CG_UPNP_CDS_ACTION_DESTROYOBJECT   "DestroyObject"
#define CG_UPNP_CDS_ACTION_UPDATEOBJECT   "UpdateObject"
#define CG_UPNP_CDS_ACTION_IMPORTRESOURCE   "ImportResource"
#define CG_UPNP_CDS_ACTION_EXPORTRESOURCE   "ExportResource"
#define CG_UPNP_CDS_ACTION_STOPTRANSFERRESOURCE   "StopTransferResource"
#define CG_UPNP_CDS_ACTION_GETTRANSFERPROGRESS   "GetTransferResource"
#define CG_UPNP_CDS_ACTION_DELETERESOURCE   "DeleteResource"
#define CG_UPNP_CDS_ACTION_CREATEREFERENCE   "CreateReference"
#define cg_upnp_av_cds_get_service(cds)   cds->service
#define cg_upnp_av_cds_setsortcaps(cds, sort_caps)   cg_string_setvalue(cds->sortCaps, sort_caps)
#define cg_upnp_av_cds_getsortcaps(cds)   cg_string_getvalue(cds->sortCaps)
#define cg_upnp_av_cds_setsearchcaps(cds, search_caps)   cg_string_setvalue(avDevice->sortCaps, search_caps)
#define cg_upnp_av_cds_getsearchcaps(cds)   cg_string_getvalue(cds->searchCaps)
#define cg_upnp_av_cds_setsystemupdateid(cds, id)   cg_string_setvalue(cds->systemUpdateID, id)
#define cg_upnp_av_cds_getsystemupdateid(cds)   cg_string_getvalue(cds->systemUpdateID)

Typedefs

typedef _CgUpnpAVCDS CgUpnpAVCDS
 The Content Directory Service structure.

Functions

CgUpnpAVCDScg_upnp_av_cds_new ()
void cg_upnp_av_cds_delete (CgUpnpAVCDS *cds)
void cg_upnp_av_cds_add_directory (CgUpnpAVCDS *cds, CgString *dir)
void cg_upnp_av_cds_remove_directory (CgUpnpAVCDS *cds, CgXmlNode *node)
BOOL cg_upnp_av_cds_action_received (CgUpnpAction *action)
void cg_upnp_av_cds_directory_watcher (CgThread *thread)


Define Documentation

#define cg_upnp_av_cds_get_service cds   )     cds->service
 

Get the CyberLinkC service from a Content Directory struct.

Parameters:
cds Content Directory in question
Returns:
The CgUpnpService* type service

#define cg_upnp_av_cds_getsearchcaps cds   )     cg_string_getvalue(cds->searchCaps)
 

Get the CDS' search capabilities

Parameters:
cds The Content Directory Service
Returns:
A string containing search capabilities

#define cg_upnp_av_cds_getsortcaps cds   )     cg_string_getvalue(cds->sortCaps)
 

Get the CDS' sort capabilities

Parameters:
cds The Content Directory Service
Returns:
A string containing sort capabilities

#define cg_upnp_av_cds_getsystemupdateid cds   )     cg_string_getvalue(cds->systemUpdateID)
 

Get the CDS' system update ID

Parameters:
cds The Content Directory Service
Returns:
System update ID

#define cg_upnp_av_cds_setsearchcaps cds,
search_caps   )     cg_string_setvalue(avDevice->sortCaps, search_caps)
 

Set the CDS' search capabilities

Parameters:
cds The Content Directory Service
search_caps A string containing seach capabilities

#define cg_upnp_av_cds_setsortcaps cds,
sort_caps   )     cg_string_setvalue(cds->sortCaps, sort_caps)
 

Set the CDS' sort capabilities

Parameters:
cds The Content Directory Service
sort_caps A string containing sort capabilities

#define cg_upnp_av_cds_setsystemupdateid cds,
id   )     cg_string_setvalue(cds->systemUpdateID, id)
 

Set the CDS' system update ID

Parameters:
cds The Content Directory Service
id System update ID

#define CG_UPNP_CDS_ACTION_BROWSE   "Browse"
 

#define CG_UPNP_CDS_ACTION_CREATEOBJECT   "CreateObject"
 

#define CG_UPNP_CDS_ACTION_CREATEREFERENCE   "CreateReference"
 

#define CG_UPNP_CDS_ACTION_DELETERESOURCE   "DeleteResource"
 

#define CG_UPNP_CDS_ACTION_DESTROYOBJECT   "DestroyObject"
 

#define CG_UPNP_CDS_ACTION_EXPORTRESOURCE   "ExportResource"
 

#define CG_UPNP_CDS_ACTION_GETSEARCHCAPABILITIES   "GetSearchCapabilities"
 

#define CG_UPNP_CDS_ACTION_GETSORTCAPABILITIES   "GetSortCapabilities"
 

#define CG_UPNP_CDS_ACTION_GETSYSTEMUPDATEID   "GetSystemUpdateID"
 

#define CG_UPNP_CDS_ACTION_GETTRANSFERPROGRESS   "GetTransferResource"
 

#define CG_UPNP_CDS_ACTION_IMPORTRESOURCE   "ImportResource"
 

#define CG_UPNP_CDS_ACTION_SEARCH   "Search"
 

#define CG_UPNP_CDS_ACTION_STOPTRANSFERRESOURCE   "StopTransferResource"
 

#define CG_UPNP_CDS_ACTION_UPDATEOBJECT   "UpdateObject"
 

#define CG_UPNP_CDS_SERVICE_TYPE   "urn:schemas-upnp-org:service:ContentDirectory"
 


Typedef Documentation

typedef struct _CgUpnpAVCDS CgUpnpAVCDS
 

The Content Directory Service structure.

Actually, this is not THE CDS service from CyberLink's point of view, but a container for CDS-specific information. This can be stored in the userData pointer of the actual CgUpnpService struct. The actual service can be found by checking whether cg_upnp_service_isname() returns the CDS type string stored in CG_UPNP_CDS_SERVICE_TYPE.

Short howto for device side: First, create a regular device and give the device its XML description to parse. The device should now contain services (with CDS). Second, give each service (especially CDS in this case) their own XML description files to parse actions and state tables. Third, set the service's action listener (to be able to respond correctly to actions and pass action invocations to other listening parties like libgupnp) and optionally the query listener (for libgupnp and friends, not really much else, because CyberLink does it all for us).


Function Documentation

BOOL cg_upnp_av_cds_action_received CgUpnpAction *  action  ) 
 

The function that gets called by the CyberLinkC stack when an action invoke has been sent to the CDS service

Parameters:
action The received action
Returns:
TRUE if action was processed successfully; otherwise false

void cg_upnp_av_cds_add_directory CgUpnpAVCDS cds,
CgString *  dir
 

Add a directory to the CDS (device side only). This function is recursive, meaning it adds everything found under the given directory.

Parameters:
cds The content directory service
dir Directory to add

void cg_upnp_av_cds_delete CgUpnpAVCDS cds  ) 
 

Destroy a Content Directory Service.

Parameters:
cds The content directory service

void cg_upnp_av_cds_directory_watcher CgThread *  thread  ) 
 

The function that keeps track of the contents in the directories that have been set available in the content directory service.

Note:
Users shouldn't call this function directly.
Parameters:
thread The CgThread struct that owns this function

CgUpnpAVCDS* cg_upnp_av_cds_new  ) 
 

Create a new Content Directory Service sub-structure. You must first have a parsed CgUpnpService* and then set a CgUpnpAVCDS* as the service's user data.

void cg_upnp_av_cds_remove_directory CgUpnpAVCDS cds,
CgXmlNode *  node
 

Remove a directory from the CDS (device side only). This function is recursive, meaning it removes the whole tree under the given node.

Parameters:
cds The content directory service
node The node to remove


Generated on Mon Aug 14 10:23:33 2006 for CyberLinkC-AV by  doxygen 1.4.6