diff --git a/libspark/hardware_caps.c b/libspark/hardware_caps.c index c872658..dda67aa 100644 --- a/libspark/hardware_caps.c +++ b/libspark/hardware_caps.c @@ -13,8 +13,12 @@ #include #include #include +#include +#include + #include +#define FP_DEV "/dev/vfd" static int initialized = 0; static hw_caps_t caps; @@ -33,7 +37,7 @@ hw_caps_t *get_hwcaps(void) strcpy(caps.boxvendor, "SPARK"); const char *tmp; char buf[1024]; - int len = -1; + int len = -1, ret, val; int fd = open("/proc/cmdline", O_RDONLY); if (fd != -1) { len = read(fd, buf, sizeof(buf) - 1); @@ -72,5 +76,16 @@ hw_caps_t *get_hwcaps(void) tmp = "(NO STB_ID FOUND)"; strcpy(caps.boxname, tmp); } + fd = open (FP_DEV, O_RDWR); + if (fd != -1) { + ret = ioctl(fd, VFDGETVERSION, &val); + if (ret < 0) + fprintf(stderr, "[hardware_caps] %s: VFDGETVERSION %m\n", __func__); + else if (val == 1) { /* VFD, others not yet seen in the wild */ + caps.display_type = HW_DISPLAY_LINE_TEXT; + caps.display_xres = 8; + } + close(fd); + } return ∩︀ }