mUPnP for C
|
#include <mupnp/typedef.h>
#include <mupnp/http/http.h>
#include <mupnp/util/string.h>
#include <mupnp/util/list.h>
#include <mupnp/event/property.h>
#include <mupnp/service.h>
#include <mupnp/upnp_function.h>
Data Structures | |
struct | _mUpnpEventListenerList |
Typedefs | |
typedef mUpnpHttpRequest | mUpnpSubscriptionRequest |
typedef mUpnpHttpResponse | mUpnpSubscriptionResponse |
typedef void(* | MUPNP_EVENT_LISTENER) (mUpnpProperty *) |
typedef struct _mUpnpEventListenerList | mUpnpEventListenerList |
#define MUPNP_EVENT_MAX_SEQ 2147483647 |
Definition for maximum event sequence number
#define mupnp_event_subscription_issubscriberequest | ( | subReq | ) |
Checks if request type is subscription request
subReq | The request to be checked |
#define mupnp_event_subscription_isunsubscriberequest | ( | subReq | ) |
Checks if request type is unsubscription request
subReq | The request to be checked |
#define mupnp_event_subscription_request_delete | ( | subReq | ) |
Subscription request destructor
subReq | Reference to the subscription request to be deleted |
#define mupnp_event_subscription_request_getcallback | ( | subReq | ) |
Get subscription callback URL
subReq | Subscription request |
#define mupnp_event_subscription_request_gethost | ( | subReq | ) |
Get host header value from subscription request
subReq | Subscription request |
#define mupnp_event_subscription_request_getnt | ( | subReq | ) |
Get NT from subscription request
subReq | Subscription request |
#define mupnp_event_subscription_request_getsid | ( | subReq | ) |
Get sid from subscription request
subReq | Subscription request |
#define mupnp_event_subscription_request_gettimeout | ( | subReq | ) |
Get timeout value from subscription request
subReq | Subscription request |
#define mupnp_event_subscription_request_hascallback | ( | subReq | ) |
Checks if subscription request has callback URL
subReq | Subscription request |
#define mupnp_event_subscription_request_hasnt | ( | subReq | ) |
Checks if subscription request has NT
subReq | Subscription request |
#define mupnp_event_subscription_request_hassid | ( | subReq | ) |
Checks if subscription object has SID
subReq | Subscription request |
#define mupnp_event_subscription_request_new | ( | void | ) |
Subscription request constructor
#define mupnp_event_subscription_request_post | ( | subReq | ) |
Send subscription request to device
subReq | Subscription request |
#define mupnp_event_subscription_request_postresponse | ( | subReq, | |
subRes ) |
Send response to subscription request
subReq | Subscription request |
subRes | Subscription response |
#define mupnp_event_subscription_request_setcallback | ( | subReq, | |
value ) |
Set subscription request callback URL
subReq | Subscription request |
value | Callback URL string |
#define mupnp_event_subscription_request_sethost | ( | subReq, | |
value ) |
Set HTTP host header value
subReq | Subscription request |
value | HTTP Host: header content |
#define mupnp_event_subscription_request_setnt | ( | subReq, | |
value ) |
Set NT (Notification target) for subscription request
subReq | Subscription request |
value | Notification type |
#define mupnp_event_subscription_response_delete | ( | subRes | ) |
Destructor for subscription response
subRes | Subscription response |
#define mupnp_event_subscription_response_getsid | ( | subRes | ) |
Get SID
subRes | Subscription request |
#define mupnp_event_subscription_response_getstatuscode | ( | subRes, | |
code ) |
Get status code from subscription response object
subRes | Subscription response |
code | Status code |
#define mupnp_event_subscription_response_gettimeout | ( | subRes | ) |
Get timeout value from subscription response
subRes | Subscription response |
#define mupnp_event_subscription_response_issuccessful | ( | subRes | ) |
Checks if subscription was successfull by checking status code from subscription response
subRes | Subscription response |
#define mupnp_event_subscription_response_new | ( | ) |
Constructor for subscription response
#define mupnp_event_subscription_response_setstatuscode | ( | subRes, | |
code ) |
Set status code for subscription response
subRes | Subscription response |
code | Status code |
#define mupnp_eventlistenerlist_clear | ( | eventListenerList | ) |
Clear the contents of a event listener list.
eventListenerList | The device list to clear |
#define mupnp_eventlistenerlist_gets | ( | eventListenerList | ) |
Fetches next list element from event listener list
eventListenerList | Event listener list |
#define mupnp_eventlistenerlist_next | ( | eventListenerList | ) |
Fetches next list element from event listener list
eventListenerList | Event listener list |
#define mupnp_eventlistenerlist_size | ( | eventListenerList | ) |
Get the size of the device list
eventListenerList | The device list |
#define MUPNP_SUBSCRIPTION_CALLBACK_END_WITH ">" |
Definition for subscription callback end tag
#define MUPNP_SUBSCRIPTION_CALLBACK_START_WITH "<" |
Definition for subscription callback start tag
#define MUPNP_SUBSCRIPTION_DELAY 30 |
Definition for subscription delay
#define MUPNP_SUBSCRIPTION_INFINITE_STRING "infinite" |
Definition for infinite string in subscription
#define MUPNP_SUBSCRIPTION_INFINITE_VALUE (-1) |
Definition for infinite value in subscription
#define MUPNP_SUBSCRIPTION_MAX_TIMEOUT 300 |
Definition for maximum upnp subscription timeout
#define MUPNP_SUBSCRIPTION_SID_HEADER_SIZE (5 + MUPNP_SUBSCRIPTION_SID_SIZE) |
Definition for SID header size
#define MUPNP_SUBSCRIPTION_SID_SIZE (MUPNP_UUID_MAX_LEN + 8) |
Definition for SID size
#define MUPNP_SUBSCRIPTION_TIMEOUT_HEADER "Second-" |
Definition for subscription timeout header prefix
#define MUPNP_SUBSCRIPTION_UUID "uuid:" |
Definition for subscription uuid prefix
#define MUPNP_SUBSCRIPTION_XMLNS "urn:schemas-upnp-org:event-1-0" |
Definition for subscription xml namespace
typedef void(* MUPNP_EVENT_LISTENER) (mUpnpProperty *) |
Type definition for event listener callback
typedef struct _mUpnpEventListenerList mUpnpEventListenerList |
Type definition for event listener list
Type definition for subsription request
Data type for subscription request
Type definition for subsrciption response
const char * mupnp_event_subscription_createsid | ( | char * | buf, |
size_t | bufSize ) |
Create SID for subscription
buf | Character buffer where SID is created |
bufSize | Buffer size. |
const char * mupnp_event_subscription_getsid | ( | const char * | headerValue | ) |
Get SID
headerValue | Raw header C string |
mUpnpTime mupnp_event_subscription_gettimeout | ( | const char * | headerValue | ) |
Get event subscription timeout
headerValue | Header value |
void mupnp_event_subscription_request_setnewsubscription | ( | mUpnpSubscriptionRequest * | subReq, |
mUpnpService * | service, | ||
const char * | callback, | ||
mUpnpTime | timeout ) |
(Re)initializes subscription request
subReq | Subscription request |
service | Service to be subscribed |
callback | URL to be called when service state changes |
timeout | Subscription timeout |
void mupnp_event_subscription_request_setrenewsubscription | ( | mUpnpSubscriptionRequest * | subReq, |
mUpnpService * | service, | ||
const char * | uuid, | ||
mUpnpTime | timeout ) |
(Re)initializes subscription request to be renewal request
subReq | Subscription request |
service | Service to be subscribed |
uuid | Devices unique identification string |
timeout | Subscription timeout |
void mupnp_event_subscription_request_setsid | ( | mUpnpSubscriptionRequest * | subReq, |
const char * | sid ) |
Set sid to subscription request
subReq | Subscription request |
sid | SID (Subscription id) |
void mupnp_event_subscription_request_settimeout | ( | mUpnpSubscriptionRequest * | subReq, |
mUpnpTime | timeout ) |
Set timeout for subscription request
subReq | Subscription request |
timeout | Timeout value for subscription request |
void mupnp_event_subscription_request_setunsubscription | ( | mUpnpSubscriptionRequest * | subReq, |
mUpnpService * | service ) |
(Re)initializes subscription request to be unsubscription request
subReq | Subscription request |
service | Service where to be unsubscribed |
void mupnp_event_subscription_response_setsid | ( | mUpnpSubscriptionResponse * | subRes, |
const char * | sid ) |
Set SID (Subscription ID) for response
subRes | Subscription response |
sid | Subscription ID |
void mupnp_event_subscription_response_settimeout | ( | mUpnpSubscriptionResponse * | subRes, |
long | value ) |
Set HTTP timeout for subscription response
subRes | Subscription response |
value | Timeout |
void mupnp_event_subscription_subscriberesponse_setresponse | ( | mUpnpSubscriptionResponse * | subRes, |
int | code ) |
Set response code for subscription response
subRes | Subscription response |
code | Response code |
const char * mupnp_event_subscription_tosidheaderstring | ( | const char * | sid, |
char * | buf, | ||
size_t | bufSize ) |
Creates SID header string
sid | Character array containing the SID |
buf | A buffer where header string is created |
bufSize | Size of the used buffer |
const char * mupnp_event_subscription_totimeoutheaderstring | ( | mUpnpTime | time, |
mUpnpString * | buf ) |
Create timeout header string
time | Timeout |
buf | Buffer used when creating header string |
void mupnp_eventlistenerlist_add | ( | mUpnpEventListenerList * | eventListenerList, |
MUPNP_EVENT_LISTENER | listener ) |
Add a listener to the event listener list
eventListenerList | The event listener list |
listener | The listener to add |
void mupnp_eventlistenerlist_delete | ( | mUpnpEventListenerList * | eventListenerList | ) |
Delete a event listener list.
eventListenerList | The event listener list to delete |
mUpnpEventListenerList * mupnp_eventlistenerlist_new | ( | void | ) |
Create a new event listener list
void mupnp_eventlistenerlist_notify | ( | mUpnpEventListenerList * | eventListenerList, |
mUpnpProperty * | property ) |
Call all event listeners in the list with the given data.
eventListenerList | The list to iterate thru |
property | The property that has been evented |
Call all event listeners in the list with the given evented data.
eventListenerList | The list to iterate thru |
property | The property that has been evented |
void mupnp_eventlistenerlist_remove | ( | mUpnpEventListenerList * | eventListenerList, |
MUPNP_EVENT_LISTENER | listener ) |
Remove a listener from the event listener list
eventListenerList | The event listener list |
listener | The listener to remove |