mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
ssdpd: align with dm_data
This commit is contained in:
parent
1ae6eb33e9
commit
b2d07e6e30
1 changed files with 81 additions and 83 deletions
|
|
@ -14,7 +14,6 @@ struct upnpdiscovery {
|
|||
char *uuid;
|
||||
char *urn;
|
||||
char *descurl;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_device_inst {
|
||||
|
|
@ -32,7 +31,6 @@ struct upnp_device_inst {
|
|||
char *preentation_url;
|
||||
char *parentudn;
|
||||
char *upc;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_service_inst {
|
||||
|
|
@ -42,12 +40,10 @@ struct upnp_service_inst {
|
|||
char *scpdurl;
|
||||
char *controlurl;
|
||||
char *eventsuburl;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
struct upnp_description_file_info {
|
||||
char *desc_url;
|
||||
struct uci_section *dmmap_sect;
|
||||
};
|
||||
|
||||
/*************************************************************
|
||||
|
|
@ -58,9 +54,9 @@ static int browseUPnPDiscoveryRootDeviceInst(struct dmctx *dmctx, DMNODE *parent
|
|||
json_object *res = NULL, *root_devices = NULL, *device = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *descurl = NULL, *st = NULL, *usn = NULL, *inst = NULL;
|
||||
struct uci_section *dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
int root_inst = 0;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -97,16 +93,11 @@ static int browseUPnPDiscoveryRootDeviceInst(struct dmctx *dmctx, DMNODE *parent
|
|||
upnp_dev.st = dmstrdup(st);
|
||||
upnp_dev.usn = dmstrdup(usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_root_device", "uuid", upnp_dev.urn)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_root_device", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "uuid", upnp_dev.urn);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, ++root_inst);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -117,8 +108,8 @@ static int browseUPnPDiscoveryDeviceInst(struct dmctx *dmctx, DMNODE *parent_nod
|
|||
json_object *res = NULL, *devices = NULL, *device = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *dev_descurl = NULL, *dev_st = NULL, *dev_usn = NULL, *inst = NULL;
|
||||
struct uci_section *dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -155,16 +146,11 @@ static int browseUPnPDiscoveryDeviceInst(struct dmctx *dmctx, DMNODE *parent_nod
|
|||
upnp_dev.st = dmstrdup(dev_st);
|
||||
upnp_dev.usn = dmstrdup(dev_usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_device", "uuid", upnp_dev.uuid)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_device", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "uuid", upnp_dev.uuid);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -175,8 +161,8 @@ static int browseUPnPDiscoveryServiceInst(struct dmctx *dmctx, DMNODE *parent_no
|
|||
json_object *res = NULL, *services = NULL, *service = NULL;
|
||||
struct upnpdiscovery upnp_dev = {0};
|
||||
char *srv_descurl = NULL, *srv_st = NULL, *srv_usn = NULL, *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
char buf[512] = {0};
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "discovery", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -214,16 +200,11 @@ static int browseUPnPDiscoveryServiceInst(struct dmctx *dmctx, DMNODE *parent_no
|
|||
upnp_dev.st = dmstrdup(srv_st);
|
||||
upnp_dev.usn = dmstrdup(srv_usn);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_service", "usn", srv_usn)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_service", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "usn", srv_usn);
|
||||
}
|
||||
|
||||
upnp_dev.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -234,7 +215,7 @@ static int browseUPnPDescriptionDeviceDescriptionInst(struct dmctx *dmctx, DMNOD
|
|||
json_object *res = NULL, *descriptions = NULL, *description = NULL;
|
||||
struct upnp_description_file_info upnp_desc = {0};
|
||||
char *descurl = NULL, *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -249,15 +230,11 @@ static int browseUPnPDescriptionDeviceDescriptionInst(struct dmctx *dmctx, DMNOD
|
|||
descurl = dmjson_get_value(description, 1, "desc_url");
|
||||
upnp_desc.desc_url = dmstrdup(descurl);
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_description", "descurl", descurl)) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_description", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "descurl", descurl);
|
||||
}
|
||||
upnp_desc.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_desc;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_desc, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -268,8 +245,8 @@ static int browseUPnPDescriptionDeviceInstanceInst(struct dmctx *dmctx, DMNODE *
|
|||
json_object *res = NULL, *devices_instances = NULL, *device_inst = NULL;
|
||||
struct upnp_device_inst upnp_dev_inst = {};
|
||||
char *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
int i;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -294,16 +271,11 @@ static int browseUPnPDescriptionDeviceInstanceInst(struct dmctx *dmctx, DMNODE *
|
|||
dmasprintf(&upnp_dev_inst.udn, "%s", dmjson_get_value(device_inst, 1, "UDN"));
|
||||
dmasprintf(&upnp_dev_inst.upc, "%s", dmjson_get_value(device_inst, 1, "UPC"));
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_device_inst", "udn", dmjson_get_value(device_inst, 1, "UDN"))) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_device_inst", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "udn", dmjson_get_value(device_inst, 1, "UDN"));
|
||||
}
|
||||
|
||||
upnp_dev_inst.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_dev_inst;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_dev_inst, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -314,8 +286,8 @@ static int browseUPnPDescriptionServiceInstanceInst(struct dmctx *dmctx, DMNODE
|
|||
json_object *res = NULL, *services_instances = NULL, *service_inst = NULL;
|
||||
struct upnp_service_inst upnp_services_inst = {};
|
||||
char *inst = NULL;
|
||||
struct uci_section* dmmap_sect = NULL;
|
||||
int i;
|
||||
struct dm_data data = {0};
|
||||
|
||||
dmubus_call("upnp", "description", UBUS_ARGS{{}}, 0, &res);
|
||||
if (res == NULL)
|
||||
|
|
@ -333,16 +305,11 @@ static int browseUPnPDescriptionServiceInstanceInst(struct dmctx *dmctx, DMNODE
|
|||
dmasprintf(&upnp_services_inst.controlurl, "%s", dmjson_get_value(service_inst, 1, "controlURL"));
|
||||
dmasprintf(&upnp_services_inst.eventsuburl, "%s", dmjson_get_value(service_inst, 1, "eventSubURL"));
|
||||
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap_opt("dmmap_upnp", "upnp_service_inst", "serviceid", dmjson_get_value(service_inst, 1, "serviceId"))) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_upnp", "upnp_service_inst", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "serviceid", dmjson_get_value(service_inst, 1, "serviceId"));
|
||||
}
|
||||
|
||||
upnp_services_inst.dmmap_sect = dmmap_sect;
|
||||
data.additional_data = (void *)&upnp_services_inst;
|
||||
|
||||
inst = handle_instance_without_section(dmctx, parent_node, i+1);
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, &upnp_services_inst, inst) == DM_STOP)
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -417,67 +384,76 @@ static int get_UPnPDiscovery_ServiceNumberOfEntries(char *refparam, struct dmctx
|
|||
/*#Device.UPnP.Discovery.RootDevice.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/
|
||||
static int get_UPnPDiscoveryRootDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->uuid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->uuid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.RootDevice.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/
|
||||
static int get_UPnPDiscoveryRootDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.RootDevice.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryRootDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.UUID!UBUS:upnpc/discovery//devices[i-1].st*/
|
||||
static int get_UPnPDiscoveryDevice_UUID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->uuid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->uuid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.USN!UBUS:upnpc/discovery//devices[i-1].usn*/
|
||||
static int get_UPnPDiscoveryDevice_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Device.{i}.Location!UBUS:upnpc/discovery//devices[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryDevice_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Service.{i}.USN!UBUS:upnpc/discovery//services[i-1].usn*/
|
||||
static int get_UPnPDiscoveryService_USN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->usn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->usn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Discovery.Service.{i}.Location!UBUS:upnpc/discovery//services[i-1].descurl*/
|
||||
static int get_UPnPDiscoveryService_Location(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnpdiscovery *)data)->descurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnpdiscovery *)(p->additional_data))->descurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDiscoveryService_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char buf[256] = {0};
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.Device.", "UUID", ((struct upnpdiscovery *)data)->uuid, buf, sizeof(buf));
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.Device.", "UUID", ((struct upnpdiscovery *)(p->additional_data))->uuid, buf, sizeof(buf));
|
||||
|
||||
if (!DM_STRLEN(buf))
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.RootDevice.", "UUID", ((struct upnpdiscovery *)data)->uuid, buf, sizeof(buf));
|
||||
bbfdm_get_references(ctx, MATCH_FIRST, "Device.UPnP.Discovery.RootDevice.", "UUID", ((struct upnpdiscovery *)(p->additional_data))->uuid, buf, sizeof(buf));
|
||||
|
||||
*value = dmstrdup(buf);
|
||||
return 0;
|
||||
|
|
@ -507,26 +483,30 @@ static int get_UPnPDescription_ServiceInstanceNumberOfEntries(char *refparam, st
|
|||
/*#Device.UPnP.Description.DeviceDescription.{i}.URLBase!UBUS:upnpc/description//descriptions[i-1].descurl*/
|
||||
static int get_UPnPDescriptionDeviceDescription_URLBase(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_description_file_info *)data)->desc_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_description_file_info *)(p->additional_data))->desc_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.UDN!UBUS:upnpc/description//devicesinstances[i-1].UDN*/
|
||||
static int get_UPnPDescriptionDeviceInstance_UDN(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->udn;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->udn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionDeviceInstance_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_device_inst *)data)->parentudn, value);
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_device_inst *)(p->additional_data))->parentudn, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionDeviceInstance_DiscoveryDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct upnp_device_inst *upnpdevinst = (struct upnp_device_inst *)data;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
struct upnp_device_inst *upnpdevinst = (struct upnp_device_inst *)(p->additional_data);
|
||||
|
||||
if (upnpdevinst->udn && upnpdevinst->udn[0]) {
|
||||
char buf[256] = {0};
|
||||
|
|
@ -551,98 +531,112 @@ static int get_UPnPDescriptionDeviceInstance_DiscoveryDevice(char *refparam, str
|
|||
/*#Device.UPnP.Description.DeviceInstance.{i}.DeviceType!UBUS:upnpc/description//devicesinstances[i-1].deviceType*/
|
||||
static int get_UPnPDescriptionDeviceInstance_DeviceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->device_type;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->device_type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.FriendlyName!UBUS:upnpc/description//devicesinstances[i-1].friendlyName*/
|
||||
static int get_UPnPDescriptionDeviceInstance_FriendlyName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->friendly_name;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->friendly_name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.Manufacturer!UBUS:upnpc/description//devicesinstances[i-1].manufacturer*/
|
||||
static int get_UPnPDescriptionDeviceInstance_Manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->manufacturer;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->manufacturer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ManufacturerURL!UBUS:upnpc/description//devicesinstances[i-1].manufacturerURL*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ManufacturerURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->manufacturer_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->manufacturer_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelDescription!UBUS:upnpc/description//devicesinstances[i-1].modelDescription*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelDescription(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_description;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_description;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelName!UBUS:upnpc/description//devicesinstances[i-1].modelName*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_name;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelNumber!UBUS:upnpc/description//devicesinstances[i-1].modelNumber*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_number;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.ModelURL!UBUS:upnpc/description//devicesinstances[i-1].modelURL*/
|
||||
static int get_UPnPDescriptionDeviceInstance_ModelURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->model_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->model_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.SerialNumber!UBUS:upnpc/description//devicesinstances[i-1].serialNumber*/
|
||||
static int get_UPnPDescriptionDeviceInstance_SerialNumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->serial_number;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->serial_number;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.UPC!UBUS:upnpc/description//devicesinstances[i-1].UPC*/
|
||||
static int get_UPnPDescriptionDeviceInstance_UPC(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->upc;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->upc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.DeviceInstance.{i}.PresentationURL!UBUS:upnpc/description//devicesinstances[i-1].preentation_url*/
|
||||
static int get_UPnPDescriptionDeviceInstance_PresentationURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_device_inst *)data)->preentation_url;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_device_inst *)(p->additional_data))->preentation_url;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionServiceInstance_ParentDevice(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_service_inst *)data)->parentudn, value);
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Description.DeviceInstance.", "UDN", ((struct upnp_service_inst *)(p->additional_data))->parentudn, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceId!UBUS:upnpc/description//servicesinstances[i-1].serviceId*/
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceId(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->serviceid;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->serviceid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceDiscovery(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char usn[512] = {0};
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
|
||||
snprintf(usn, sizeof(usn), "%s::%s", ((struct upnp_service_inst *)data)->parentudn, ((struct upnp_service_inst *)data)->servicetype);
|
||||
snprintf(usn, sizeof(usn), "%s::%s", ((struct upnp_service_inst *)(p->additional_data))->parentudn, ((struct upnp_service_inst *)(p->additional_data))->servicetype);
|
||||
|
||||
_bbfdm_get_references(ctx, "Device.UPnP.Discovery.Service.", "USN", usn, value);
|
||||
return 0;
|
||||
|
|
@ -651,28 +645,32 @@ static int get_UPnPDescriptionServiceInstance_ServiceDiscovery(char *refparam, s
|
|||
/*#Device.UPnP.Description.ServiceInstance.{i}.ServiceType!UBUS:upnpc/description//servicesinstances[i-1].serviceType*/
|
||||
static int get_UPnPDescriptionServiceInstance_ServiceType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->servicetype;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->servicetype;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.SCPDURL!UBUS:upnpc/description//servicesinstances[i-1].SCPDURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_SCPDURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->scpdurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->scpdurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.ControlURL!UBUS:upnpc/description//servicesinstances[i-1].controlURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_ControlURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->controlurl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->controlurl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*#Device.UPnP.Description.ServiceInstance.{i}.EventSubURL!UBUS:upnpc/description//servicesinstances[i-1].eventSubURL*/
|
||||
static int get_UPnPDescriptionServiceInstance_EventSubURL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = ((struct upnp_service_inst *)data)->eventsuburl;
|
||||
struct dm_data *p = (struct dm_data *)data;
|
||||
*value = ((struct upnp_service_inst *)(p->additional_data))->eventsuburl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue