CyberLink for C

cnotify.h File Reference

#include <cybergarage/typedef.h>
#include <cybergarage/soap/csoap.h>
#include <cybergarage/util/cstring.h>
#include <cybergarage/upnp/cstatevariable.h>
#include <cybergarage/upnp/event/cproperty.h>
#include <cybergarage/upnp/event/csubscriber.h>

Defines

#define CG_UPNP_NOTIFY_XMLNS   "e"
#define CG_UPNP_NOTIFY_PROPERTY   "property"
#define CG_UPNP_NOTIFY_PROPERTYSET   "propertyset"
#define cg_upnp_event_notify_request_sethttprequest(notifyReq, httpReq)   cg_soap_request_sethttprequest(notifyReq, httpReq)
#define cg_upnp_event_notify_request_post(notifyReq, host, port)   cg_soap_request_post(notifyReq, host, port)
#define cg_upnp_event_notify_request_getpropertysetnode(notifyReq)   cg_soap_request_getrootnoode(notifyReq)
#define cg_upnp_event_notify_request_setpropertylist(notifyReq, value)   cg_soap_request_setuserdata(notifyReq, value)
#define cg_upnp_event_notify_request_setnt(soapReq, value)   cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT, value)
#define cg_upnp_event_notify_request_getnt(soapReq)   cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT)
#define cg_upnp_event_notify_request_hasnt(soapReq)   cg_http_packet_hasheader((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT)
#define cg_upnp_event_notify_request_setnts(soapReq, value)   cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS, value)
#define cg_upnp_event_notify_request_getnts(soapReq)   cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS)
#define cg_upnp_event_notify_request_hasnts(soapReq)   cg_http_packet_hasheader(((CgHttpPacket*)soapReq->httpReq), CG_HTTP_NTS)
#define cg_upnp_event_notify_request_getsid(soapReq)   cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SID))
#define cg_upnp_event_notify_request_hassid(soapReq)   cg_http_packet_hasheader(((CgHttpPacket*)(soapReq->httpReq)), CG_HTTP_SID)
#define cg_upnp_event_notify_request_setseq(soapReq, value)   cg_http_packet_setheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ, value)
#define cg_upnp_event_notify_request_getseq(soapReq)   cg_http_packet_getheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ)
#define cg_upnp_event_notify_response_issuccessful(notifyRes)   cg_soap_response_issuccessful(notifyRes)
#define cg_upnp_event_notify_response_getstatuscode(notifyRes)   cg_soap_response_getstatuscode(notifyRes)

Typedefs

typedef CgSoapRequest CgUpnpNotifyRequest
typedef CgSoapResponse CgUpnpNotifyResponse

Functions

CgUpnpNotifyRequest * cg_upnp_event_notify_request_new ()
void cg_upnp_event_notify_request_delete (CgUpnpNotifyRequest *notifyReq)
void cg_upnp_event_notify_request_clear (CgUpnpNotifyRequest *notifyReq)
CgUpnpPropertyList * cg_upnp_event_notify_request_getpropertylist (CgUpnpNotifyRequest *nofityReq)
void cg_upnp_event_notify_request_setsid (CgUpnpNotifyRequest *soapReq, char *sid)
BOOL cg_upnp_event_notify_request_setpropertysetnode (CgUpnpNotifyRequest *notifyReq, CgUpnpSubscriber *sub, void *service, CgUpnpStateVariable *statVar)

Define Documentation

#define cg_upnp_event_notify_request_getnt (   soapReq)    cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT)

Get NT from notification request

Parameters:
soapReqNotification request
#define cg_upnp_event_notify_request_getnts (   soapReq)    cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS)

Get NTS from notification request

Parameters:
soapReqNotification request
#define cg_upnp_event_notify_request_getpropertysetnode (   notifyReq)    cg_soap_request_getrootnoode(notifyReq)

Get root node associated with current Notification request

Parameters:
notifyReqNotification request
Returns:
XML node
#define cg_upnp_event_notify_request_getseq (   soapReq)    cg_http_packet_getheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ)

Get sequence number from notification request

Parameters:
soapReqNotification request
#define cg_upnp_event_notify_request_getsid (   soapReq)    cg_upnp_event_subscription_getsid(cg_http_packet_getheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SID))

Get SID from notification request

Parameters:
soapReqNotification request
#define cg_upnp_event_notify_request_hasnt (   soapReq)    cg_http_packet_hasheader((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT)
#define cg_upnp_event_notify_request_hasnts (   soapReq)    cg_http_packet_hasheader(((CgHttpPacket*)soapReq->httpReq), CG_HTTP_NTS)
#define cg_upnp_event_notify_request_hassid (   soapReq)    cg_http_packet_hasheader(((CgHttpPacket*)(soapReq->httpReq)), CG_HTTP_SID)
#define cg_upnp_event_notify_request_post (   notifyReq,
  host,
  port 
)    cg_soap_request_post(notifyReq, host, port)

Sends event Notification request to control point

Parameters:
notifyReqNotification request
hostHost address
portHost port
Returns:
Notify response
#define cg_upnp_event_notify_request_sethttprequest (   notifyReq,
  httpReq 
)    cg_soap_request_sethttprequest(notifyReq, httpReq)

Set HTTP request for event Notification request

Parameters:
notifyReqNotification request
httpReqHTTP request
#define cg_upnp_event_notify_request_setnt (   soapReq,
  value 
)    cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NT, value)

Set NT (Notificatio type) for Notification request

Parameters:
soapReqNotification request
valueNotification type
#define cg_upnp_event_notify_request_setnts (   soapReq,
  value 
)    cg_http_packet_setheadervalue((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_NTS, value)

Set NTS (Notification sub type) for current Notification request

Parameters:
soapReqNotification request
valueNTS
#define cg_upnp_event_notify_request_setpropertylist (   notifyReq,
  value 
)    cg_soap_request_setuserdata(notifyReq, value)

Set property list for Notification request

Parameters:
notifyReqNotification request
valueProperty list value
#define cg_upnp_event_notify_request_setseq (   soapReq,
  value 
)    cg_http_packet_setheaderlong((CgHttpPacket*)(soapReq->httpReq), CG_HTTP_SEQ, value)

Set sequence number for notification request

Parameters:
soapReqNotification request
valueSequence number
#define cg_upnp_event_notify_response_getstatuscode (   notifyRes)    cg_soap_response_getstatuscode(notifyRes)

Get the status code of the specified response

Parameters:
notifyResNotification response
#define cg_upnp_event_notify_response_issuccessful (   notifyRes)    cg_soap_response_issuccessful(notifyRes)

Check if notification response was successfull

Parameters:
notifyResNotification response
#define CG_UPNP_NOTIFY_PROPERTY   "property"

Define for notify property

#define CG_UPNP_NOTIFY_PROPERTYSET   "propertyset"

Define for notify property set

#define CG_UPNP_NOTIFY_XMLNS   "e"

Define for XML namespace


Typedef Documentation

Data type for UPnP Notification request

Data type for UPnP notify response


Function Documentation

void cg_upnp_event_notify_request_clear ( CgUpnpNotifyRequest *  notifyReq)

Clear Notification request

Parameters:
notifyReqNotification request
void cg_upnp_event_notify_request_delete ( CgUpnpNotifyRequest *  notifyReq)

Delete Notification request

Parameters:
notifyReqNotification request
CgUpnpPropertyList* cg_upnp_event_notify_request_getpropertylist ( CgUpnpNotifyRequest *  nofityReq)

Get property list from Notification request

Parameters:
nofityReqNotification request
CgUpnpNotifyRequest* cg_upnp_event_notify_request_new ( )

Create new Notification request

BOOL cg_upnp_event_notify_request_setpropertysetnode ( CgUpnpNotifyRequest *  notifyReq,
CgUpnpSubscriber *  sub,
void *  service,
CgUpnpStateVariable *  statVar 
)
Todo:
Check what this does exactly...
void cg_upnp_event_notify_request_setsid ( CgUpnpNotifyRequest *  soapReq,
char *  sid 
)

Set SID (Subscription ID) for notification request

Parameters:
soapReqNotification request
sidSID