int TvDeviceSetServiceTableVar(unsigned int service, int variable, char *value) { /* IXML_Document *PropSet= NULL; */ if (service >= TV_SERVICE_SERVCOUNT || variable >= tv_service_table[service].VariableCount || strlen(value) >= TV_MAX_VAL_LEN) return (0); ithread_mutex_lock(&TVDevMutex); strcpy(tv_service_table[service].VariableStrVal[variable], value); #if 0 /* Using utility api */ PropSet = UpnpCreatePropertySet(1, tv_service_table[service].VariableName[variable], tv_service_table[service].VariableStrVal[variable]); UpnpNotifyExt(device_handle, tv_service_table[service].UDN, tv_service_table[service].ServiceId, PropSet); /* Free created property set */ Document_free(PropSet); #endif UpnpNotify(device_handle, tv_service_table[service].UDN, tv_service_table[service].ServiceId, (const char **)&tv_service_table[service].VariableName[variable], (const char **)&tv_service_table[service].VariableStrVal[variable], 1); ithread_mutex_unlock(&TVDevMutex); return 1; }
DBG_STATIC void transport_notify_lastchange(struct action_event *event, char *value) { const char *varnames[] = { "LastChange", NULL }; char *varvalues[] = { NULL, NULL }; DBG_PRINT(DBG_LVL4, "AVT Event: '%s'\n", value); varvalues[0] = xmlescape(value, 0); if (transport_values[TRANSPORT_VAR_LAST_CHANGE]) free(transport_values[TRANSPORT_VAR_LAST_CHANGE]); // Save arg transport_values[TRANSPORT_VAR_LAST_CHANGE] = value; UpnpNotify(device_handle, event->request->DevUDN, event->request->ServiceID, varnames, (const char **)varvalues, 1); free(varvalues[0]); }
int upnp_device_notify(struct upnp_device *device, const char *serviceID, const char **varnames, const char **varvalues, int varcount) { UpnpNotify(device->device_handle, device->upnp_device_descriptor->udn, serviceID, varnames, varvalues, varcount); return 0; }
int upnp_device_notify(struct device_private *priv, const char *serviceID, const char **varnames, const char **varvalues, int varcount) { #ifdef HAVE_LIBUPNP UpnpNotify(priv->device_handle, priv->upnp_device->udn, serviceID, varnames, varvalues, varcount); #endif return 0; }