Example #1
0
void SubscribeService(mUpnpControlPoint *ctrlPoint)
{
	mUpnpDevice *selDev;
	mUpnpService *selService;
	bool subSuccess;
	
	printf("Subscribe Device\n");
	
	mupnp_controlpoint_lock(ctrlPoint);
	selDev = SelectDevice(ctrlPoint);
	if (selDev == NULL)
	{
		mupnp_controlpoint_unlock(ctrlPoint);
		return;
	}
	selService = SelectService(selDev);
	if (selService == NULL)
	{
		mupnp_controlpoint_unlock(ctrlPoint);
		return;
	}
	subSuccess = mupnp_controlpoint_subscribe(ctrlPoint, selService, 300);
	
	printf("Subscribe Result(%d) = %s\n",
		(int)subSuccess, 
		(subSuccess == true) ? mupnp_service_getsubscriptionsid(selService) : "");
	mupnp_controlpoint_unlock(ctrlPoint);
	
}
Example #2
0
void mupnp_event_subscription_request_setunsubscription(mUpnpSubscriptionRequest* subReq, mUpnpService* service)
{
  mupnp_log_debug_l4("Entering...\n");

  mupnp_http_request_setmethod(subReq, MUPNP_HTTP_UNSUBSCRIBE);
  mupnp_event_subscription_request_setservice(subReq, service);
  mupnp_event_subscription_request_setsid(subReq, mupnp_service_getsubscriptionsid(service));
  mupnp_log_debug_l4("Leaving...\n");
}