.opts = PO_RDONLY | PO_NOSAVE,
.off = offsetof(linuxdvb_frontend_t, lfe_number),
},
+ {
+ .type = PT_STR,
+ .id = "sysfs_device",
+ .name = N_("Device path in sysfs"),
+ .desc = N_("The device path in sysfs filesystem (/sys)."),
+ .opts = PO_RDONLY | PO_NOSAVE | PO_MULTILINE,
+ .off = offsetof(linuxdvb_frontend_t, lfe_sysfs),
+ },
{
.type = PT_INT,
.id = "pids_max",
{
const idclass_t *idc;
const char *str, *uuid = NULL, *muuid = NULL;
- char id[16], lname[256];
+ char id[16], lname[256], buf[256];
linuxdvb_frontend_t *lfe;
htsmsg_t *scconf;
+ ssize_t r;
/* Tuner slave */
snprintf(id, sizeof(id), "master for #%d", number);
lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
if (!lfe) return NULL;
+ /* Sysfs path */
+ snprintf(lname, sizeof(lname), "/sys/class/dvb/dvb%d.frontend%d", la->la_dvb_number, number);
+ r = readlink(lname, buf, sizeof(buf));
+ if (r > 0) {
+ if (r == sizeof(buf)) r--;
+ buf[r] = '\0';
+ if (strncmp(str = buf, "../../", 6) == 0) str += 6;
+ lfe->lfe_sysfs = strdup(str);
+ }
+
/* Callbacks */
lfe->mi_get_weight = linuxdvb_frontend_get_weight;
lfe->mi_get_priority = linuxdvb_frontend_get_priority;
LIST_REMOVE(lfe, lfe_link);
/* Free memory */
+ free(lfe->lfe_sysfs);
free(lfe->lfe_fe_path);
free(lfe->lfe_dmx_path);
free(lfe->lfe_dvr_path);