White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@522 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
35392132af
commit
c434f275ef
@ -138,8 +138,7 @@ TvCtrlPointDeleteNode( struct TvDeviceNode *node )
|
|||||||
* UDN -- The Unique Device Name for the device to remove
|
* UDN -- The Unique Device Name for the device to remove
|
||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
int
|
int TvCtrlPointRemoveDevice(const char *UDN)
|
||||||
TvCtrlPointRemoveDevice(const char *UDN)
|
|
||||||
{
|
{
|
||||||
struct TvDeviceNode *curdevnode;
|
struct TvDeviceNode *curdevnode;
|
||||||
struct TvDeviceNode *prevdevnode;
|
struct TvDeviceNode *prevdevnode;
|
||||||
@ -1016,8 +1015,8 @@ void TvCtrlPointHandleSubscribeUpdate(
|
|||||||
ithread_mutex_unlock( &DeviceListMutex );
|
ithread_mutex_unlock( &DeviceListMutex );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void TvCtrlPointHandleGetVar(
|
||||||
TvCtrlPointHandleGetVar( const char *controlURL,
|
const char *controlURL,
|
||||||
const char *varName,
|
const char *varName,
|
||||||
const DOMString varValue)
|
const DOMString varValue)
|
||||||
{
|
{
|
||||||
@ -1069,13 +1068,12 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
IXML_Document *DescDoc = NULL;
|
IXML_Document *DescDoc = NULL;
|
||||||
const char *location = NULL;
|
const char *location = NULL;
|
||||||
int errCode = UpnpDiscovery_get_ErrCode(d_event);
|
int errCode = UpnpDiscovery_get_ErrCode(d_event);
|
||||||
|
|
||||||
if (errCode != UPNP_E_SUCCESS) {
|
if (errCode != UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
"Error in Discovery Callback -- %d", errCode);
|
"Error in Discovery Callback -- %d", errCode);
|
||||||
}
|
}
|
||||||
|
location = UpnpString_get_String(UpnpDiscovery_get_Location(d_event));
|
||||||
location = UpnpString_get_String(
|
|
||||||
UpnpDiscovery_get_Location(d_event));
|
|
||||||
errCode = UpnpDownloadXmlDoc(location, &DescDoc);
|
errCode = UpnpDownloadXmlDoc(location, &DescDoc);
|
||||||
if (errCode != UPNP_E_SUCCESS) {
|
if (errCode != UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
@ -1085,19 +1083,15 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
TvCtrlPointAddDevice(
|
TvCtrlPointAddDevice(
|
||||||
DescDoc, location, UpnpDiscovery_get_Expires(d_event));
|
DescDoc, location, UpnpDiscovery_get_Expires(d_event));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DescDoc) {
|
if (DescDoc) {
|
||||||
ixmlDocument_free(DescDoc);
|
ixmlDocument_free(DescDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
TvCtrlPointPrintList();
|
TvCtrlPointPrintList();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UPNP_DISCOVERY_SEARCH_TIMEOUT:
|
case UPNP_DISCOVERY_SEARCH_TIMEOUT:
|
||||||
/* Nothing to do here... */
|
/* Nothing to do here... */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
|
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
|
||||||
UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
|
UpnpDiscovery *d_event = (UpnpDiscovery *)Event;
|
||||||
int errCode = UpnpDiscovery_get_ErrCode(d_event);
|
int errCode = UpnpDiscovery_get_ErrCode(d_event);
|
||||||
@ -1108,16 +1102,12 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
"Error in Discovery ByeBye Callback -- %d", errCode);
|
"Error in Discovery ByeBye Callback -- %d", errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
SampleUtil_Print("Received ByeBye for Device: %s", deviceId);
|
SampleUtil_Print("Received ByeBye for Device: %s", deviceId);
|
||||||
TvCtrlPointRemoveDevice(deviceId);
|
TvCtrlPointRemoveDevice(deviceId);
|
||||||
|
|
||||||
SampleUtil_Print("After byebye:");
|
SampleUtil_Print("After byebye:");
|
||||||
TvCtrlPointPrintList();
|
TvCtrlPointPrintList();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SOAP Stuff */
|
/* SOAP Stuff */
|
||||||
case UPNP_CONTROL_ACTION_COMPLETE: {
|
case UPNP_CONTROL_ACTION_COMPLETE: {
|
||||||
UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
|
UpnpActionComplete *a_event = (UpnpActionComplete *)Event;
|
||||||
@ -1127,20 +1117,16 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
"Error in Action Complete Callback -- %d",
|
"Error in Action Complete Callback -- %d",
|
||||||
errCode);
|
errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No need for any processing here, just print out results.
|
/* No need for any processing here, just print out results.
|
||||||
* Service state table updates are handled by events. */
|
* Service state table updates are handled by events. */
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UPNP_CONTROL_GET_VAR_COMPLETE: {
|
case UPNP_CONTROL_GET_VAR_COMPLETE: {
|
||||||
UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
|
UpnpStateVarComplete *sv_event = (UpnpStateVarComplete *)Event;
|
||||||
int errCode = UpnpStateVarComplete_get_ErrCode(sv_event);
|
int errCode = UpnpStateVarComplete_get_ErrCode(sv_event);
|
||||||
if (errCode != UPNP_E_SUCCESS) {
|
if (errCode != UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
"Error in Get Var Complete Callback -- %d",
|
"Error in Get Var Complete Callback -- %d", errCode);
|
||||||
errCode );
|
|
||||||
} else {
|
} else {
|
||||||
TvCtrlPointHandleGetVar(
|
TvCtrlPointHandleGetVar(
|
||||||
UpnpString_get_String(UpnpStateVarComplete_get_CtrlUrl(sv_event)),
|
UpnpString_get_String(UpnpStateVarComplete_get_CtrlUrl(sv_event)),
|
||||||
@ -1149,7 +1135,6 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GENA Stuff */
|
/* GENA Stuff */
|
||||||
case UPNP_EVENT_RECEIVED: {
|
case UPNP_EVENT_RECEIVED: {
|
||||||
UpnpEvent *e_event = (UpnpEvent *)Event;
|
UpnpEvent *e_event = (UpnpEvent *)Event;
|
||||||
@ -1159,26 +1144,23 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
UpnpEvent_get_ChangedVariables(e_event));
|
UpnpEvent_get_ChangedVariables(e_event));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UPNP_EVENT_SUBSCRIBE_COMPLETE:
|
case UPNP_EVENT_SUBSCRIBE_COMPLETE:
|
||||||
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
|
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
|
||||||
case UPNP_EVENT_RENEWAL_COMPLETE: {
|
case UPNP_EVENT_RENEWAL_COMPLETE: {
|
||||||
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
||||||
|
|
||||||
errCode = UpnpEventSubscribe_get_ErrCode(es_event);
|
errCode = UpnpEventSubscribe_get_ErrCode(es_event);
|
||||||
if (errCode != UPNP_E_SUCCESS) {
|
if (errCode != UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
"Error in Event Subscribe Callback -- %d",
|
"Error in Event Subscribe Callback -- %d", errCode);
|
||||||
errCode);
|
|
||||||
} else {
|
} else {
|
||||||
TvCtrlPointHandleSubscribeUpdate(
|
TvCtrlPointHandleSubscribeUpdate(
|
||||||
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)),
|
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)),
|
||||||
UpnpString_get_String(UpnpEventSubscribe_get_SID(es_event)),
|
UpnpString_get_String(UpnpEventSubscribe_get_SID(es_event)),
|
||||||
UpnpEventSubscribe_get_TimeOut(es_event));
|
UpnpEventSubscribe_get_TimeOut(es_event));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UPNP_EVENT_AUTORENEWAL_FAILED:
|
case UPNP_EVENT_AUTORENEWAL_FAILED:
|
||||||
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
|
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
|
||||||
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
|
||||||
@ -1190,7 +1172,6 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)),
|
UpnpString_get_String(UpnpEventSubscribe_get_PublisherUrl(es_event)),
|
||||||
&TimeOut,
|
&TimeOut,
|
||||||
newSID);
|
newSID);
|
||||||
|
|
||||||
if (errCode == UPNP_E_SUCCESS) {
|
if (errCode == UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print("Subscribed to EventURL with SID=%s", newSID);
|
SampleUtil_Print("Subscribed to EventURL with SID=%s", newSID);
|
||||||
TvCtrlPointHandleSubscribeUpdate(
|
TvCtrlPointHandleSubscribeUpdate(
|
||||||
@ -1202,7 +1183,6 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ignore these cases, since this is not a device */
|
/* ignore these cases, since this is not a device */
|
||||||
case UPNP_EVENT_SUBSCRIPTION_REQUEST:
|
case UPNP_EVENT_SUBSCRIPTION_REQUEST:
|
||||||
case UPNP_CONTROL_GET_VAR_REQUEST:
|
case UPNP_CONTROL_GET_VAR_REQUEST:
|
||||||
|
@ -1079,8 +1079,7 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
|
|||||||
"Error in Discovery Callback -- %d", errCode);
|
"Error in Discovery Callback -- %d", errCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
location = UpnpString_get_String(
|
location = UpnpString_get_String(UpnpDiscovery_get_Location(d_event));
|
||||||
UpnpDiscovery_get_Location(d_event));
|
|
||||||
errCode = UpnpDownloadXmlDoc(location, &DescDoc);
|
errCode = UpnpDownloadXmlDoc(location, &DescDoc);
|
||||||
if (errCode != UPNP_E_SUCCESS) {
|
if (errCode != UPNP_E_SUCCESS) {
|
||||||
SampleUtil_Print(
|
SampleUtil_Print(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user