#include <cybergarage/typedef.h>
#include <cybergarage/util/clist.h>
#include <cybergarage/util/cstring.h>
#include <cybergarage/net/curl.h>
#include <cybergarage/util/ctime.h>
#include <cybergarage/upnp/cstatevariable.h>
Data Structures |
| struct | _CgUpnpSubscriber |
Defines |
| #define | cg_upnp_subscriber_next(sub) (CgUpnpSubscriber *)cg_list_next((CgList *)sub) |
| #define | cg_upnp_subscriber_remove(sub) cg_list_remove((CgList *)sub) |
| #define | cg_upnp_subscriber_setsid(sub, value) cg_string_setvalue(sub->sid, value) |
| #define | cg_upnp_subscriber_getsid(sub) cg_string_getvalue(sub->sid) |
| #define | cg_upnp_subscriber_settimeout(sub, value) (sub->timeout = value) |
| #define | cg_upnp_subscriber_gettimeout(sub) (sub->timeout) |
| #define | cg_upnp_subscriber_setsubscriptiontime(sub, value) (sub->subscriptionTime = value) |
| #define | cg_upnp_subscriber_getsubscriptiontime(sub) (sub->subscriptionTime) |
| #define | cg_upnp_subscriber_setnotifycount(sub, value) (sub->notifyCount = value) |
| #define | cg_upnp_subscriber_getnotifycount(sub) (sub->notifyCount) |
| #define | cg_upnp_subscriber_setdeliveryurl(sub, value) cg_net_url_set(sub->deliveryURL, value) |
| #define | cg_upnp_subscriber_getdeliveryhost(sub) cg_net_url_gethost(sub->deliveryURL) |
| #define | cg_upnp_subscriber_getdeliverypath(sub) cg_net_url_getpath(sub->deliveryURL) |
| #define | cg_upnp_subscriber_getdeliveryport(sub) cg_net_url_getport(sub->deliveryURL) |
| #define | cg_upnp_subscriberlist_clear(subList) cg_list_clear((CgList *)subList, (CG_LIST_DESTRUCTORFUNC)cg_upnp_subscriber_delete) |
| #define | cg_upnp_subscriberlist_size(subList) cg_list_size((CgList *)subList) |
| #define | cg_upnp_subscriberlist_gets(subList) (CgUpnpSubscriber *)cg_list_next((CgList *)subList) |
| #define | cg_upnp_subscriberlist_add(subList, sub) cg_list_add((CgList *)subList, (CgList *)sub) |
Typedefs |
| typedef struct _CgUpnpSubscriber | CgUpnpSubscriber |
| typedef struct _CgUpnpSubscriber | CgUpnpSubscriberList |
Functions |
| CgUpnpSubscriber * | cg_upnp_subscriber_new () |
| void | cg_upnp_subscriber_delete (CgUpnpSubscriber *sub) |
| void | cg_upnp_subscriber_clear (CgUpnpSubscriber *sub) |
| void | cg_upnp_subscriber_renew (CgUpnpSubscriber *sub) |
| long | cg_upnp_subscriber_incrementnotifycount (CgUpnpSubscriber *sub) |
| BOOL | cg_upnp_subscriber_isexpired (CgUpnpSubscriber *sub) |
| BOOL | cg_upnp_subscriber_notify (CgUpnpSubscriber *sub, CgUpnpStateVariable *statVar) |
| BOOL | cg_upnp_subscriber_notifyall (CgUpnpSubscriber *sub, void *service) |
| CgUpnpSubscriberList * | cg_upnp_subscriberlist_new () |
| void | cg_upnp_subscriberlist_delete (CgUpnpSubscriberList *subscriberlist) |
Define Documentation
| #define cg_upnp_subscriber_getdeliveryhost |
( |
|
sub | ) |
cg_net_url_gethost(sub->deliveryURL) |
Set the subscriber's delivery host
- Parameters:
-
| #define cg_upnp_subscriber_getdeliverypath |
( |
|
sub | ) |
cg_net_url_getpath(sub->deliveryURL) |
Set the subscriber's delivery path
- Parameters:
-
| #define cg_upnp_subscriber_getdeliveryport |
( |
|
sub | ) |
cg_net_url_getport(sub->deliveryURL) |
Set the subscriber's delivery port
- Parameters:
-
| #define cg_upnp_subscriber_getnotifycount |
( |
|
sub | ) |
(sub->notifyCount) |
Get the notify count
- Parameters:
-
- Returns:
- Notify count
| #define cg_upnp_subscriber_getsid |
( |
|
sub | ) |
cg_string_getvalue(sub->sid) |
Get the subscriber's SID (Subscription IDentifier) value
- Parameters:
-
| sub | The current event subscriber |
- Returns:
- Subscriber's SID
| #define cg_upnp_subscriber_getsubscriptiontime |
( |
|
sub | ) |
(sub->subscriptionTime) |
Get the subscription time (duration)
- Parameters:
-
- Returns:
- Subscription time
| #define cg_upnp_subscriber_gettimeout |
( |
|
sub | ) |
(sub->timeout) |
Get the subscription timeout (expiration time)
- Parameters:
-
- Returns:
- Timeout
Get the next subscriber in a subscriber list. Use as an iterator.
- Parameters:
-
| sub | The current event subscriber |
- Returns:
- Next subscriber or NULL
| #define cg_upnp_subscriber_remove |
( |
|
sub | ) |
cg_list_remove((CgList *)sub) |
Remove the event subscriber from a subscriber list.
- Parameters:
-
| sub | The event subscriber to remove |
| #define cg_upnp_subscriber_setdeliveryurl |
( |
|
sub, |
|
|
|
value |
|
) |
| cg_net_url_set(sub->deliveryURL, value) |
Set the subscriber's delivery URL
- Parameters:
-
| sub | The event subscriber |
| value | The delivery URL |
| #define cg_upnp_subscriber_setnotifycount |
( |
|
sub, |
|
|
|
value |
|
) |
| (sub->notifyCount = value) |
Set the notify count to a certain value.
- Parameters:
-
| sub | The event subscriber |
| value | Notify count |
| #define cg_upnp_subscriber_setsid |
( |
|
sub, |
|
|
|
value |
|
) |
| cg_string_setvalue(sub->sid, value) |
Set the subscriber's SID (Subscription IDentifier) value
- Parameters:
-
| sub | The event subscriber |
| value | The SID value |
| #define cg_upnp_subscriber_setsubscriptiontime |
( |
|
sub, |
|
|
|
value |
|
) |
| (sub->subscriptionTime = value) |
Set the subscription time (duration) to a certain value.
- Parameters:
-
| sub | The event subscriber |
| value | Subscription time |
| #define cg_upnp_subscriber_settimeout |
( |
|
sub, |
|
|
|
value |
|
) |
| (sub->timeout = value) |
Set the subscription timeout (expiration time) to a certain value.
- Parameters:
-
| sub | The event subscriber |
| value | Timeout |
| #define cg_upnp_subscriberlist_add |
( |
|
subList, |
|
|
|
sub |
|
) |
| cg_list_add((CgList *)subList, (CgList *)sub) |
Add a new event subscriber to a subscriber list
- Parameters:
-
| subList | The subscriber list to add to |
| sub | The subscriber to add |
Clear the contents of a subscriber list
- Parameters:
-
| subList | The subscriber list to clear |
Get the first item in a subscriber list (use as the first step in iteration).
- Parameters:
-
| subList | The subscriber list to evaluate |
| #define cg_upnp_subscriberlist_size |
( |
|
subList | ) |
cg_list_size((CgList *)subList) |
Get the size (node count) of a subscriber list
- Parameters:
-
| subList | The subscriber list to evaluate |
Typedef Documentation
The device-side structure for an event subscriber
Function Documentation
Clear the contents of an event subscriber
- Todo:
- Lacks implementation (is it necessary?)
- Parameters:
-
Clear the contents of an event subscriber
- Todo:
- Lacks implementation (is it necessary?)
- Parameters:
-
Destroy an event subscriber
- Parameters:
-
Increment the event notify count by one
- Parameters:
-
- Returns:
- The new notify count
Check, whether a subscriber's event subscription has been expired
- Parameters:
-
- Returns:
- TRUE if the subscription has been expired; otherwise FALSE
Create a new event subscriber
Post a notification to an event subscriber. This is called in a device.
- Parameters:
-
| sub | The event subscriber |
| statVar | The evented state variable |
- Returns:
- TRUE if succesful; otherwise FALSE
Post a notification to an event subscriber. This is called in a device.
- Parameters:
-
| sub | The event subscriber |
| service | The evented service |
- Returns:
- TRUE if succesful; otherwise FALSE
Renew a subscription. Essentially sets subscription time (duration) to zero and resets notify count (== event key).
- Parameters:
-
Destroy an event subscriber list
- Parameters:
-
| subscriberlist | The list to destroy |
Create a new event subscriber list