hardware_caps: more boxtypes, add boxarch

This commit is contained in:
Stefan Seyfried
2016-01-22 19:48:09 +01:00
parent 353b083620
commit 71d4ec8339
2 changed files with 40 additions and 13 deletions

View File

@@ -2,35 +2,64 @@
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
* (C) 2010-2012,2016 Stefan Seyfried
*
* License: GPL v2 or later
*/
#include "cs_api.h"
#include <stdio.h>
#include <string.h>
#include "hardware_caps.h"
static int initialized = 0;
static hw_caps_t caps;
hw_caps_t *get_hwcaps(void) {
if (initialized)
return &caps;
caps.has_fan = (cs_get_revision() < 8);
int rev = cs_get_revision();
caps.has_fan = (rev < 8);
caps.has_HDMI = 1;
caps.has_SCART = (cs_get_revision() != 10);
caps.has_SCART = (rev != 10);
caps.has_SCART_input = 0;
caps.has_YUV_cinch = 1;
caps.can_shutdown = (cs_get_revision() > 7);
caps.can_shutdown = (rev > 7);
caps.can_cec = 1;
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.display_xres = 12;
caps.display_yres = 0;
caps.can_set_display_brightness = 1;
strcpy(caps.boxvendor, "Coolstream");
if (cs_get_revision() < 8)
/* list of boxnames from neutrinoyparser.cpp */
strcpy(caps.boxarch, "Nevis");
switch (rev) {
case 6:
case 7: // Black Stallion Edition
strcpy(caps.boxname, "HD1");
else if (cs_get_revision() == 10)
strcpy(caps.boxname, "ZEE");
else
strcpy(caps.boxname, "NEO");
break;
case 8:
strcpy(caps.boxname, "Neo");
break;
case 9:
strcpy(caps.boxname, "Tank");
strcpy(caps.boxarch, "Apollo");
break;
case 10:
strcpy(caps.boxname, "Zee");
break;
case 11:
strcpy(caps.boxname, "Trinity");
strcpy(caps.boxarch, "Shiner");
break;
case 12:
strcpy(caps.boxname, "Zee2");
strcpy(caps.boxarch, "Kronos");
break;
default:
strcpy(caps.boxname, "UNKNOWN_BOX");
strcpy(caps.boxarch, "Unknown");
fprintf(stderr, "[%s] unhandled box revision %d\n", __func__, rev);
}
initialized = 1;
return &caps;
}

View File

@@ -2,16 +2,13 @@
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
* (C) 2010-2012,2016 Stefan Seyfried
*
* License: GPL v2 or later
*/
#ifndef __HARDWARE_CAPS_H__
#define __HARDWARE_CAPS_H__
#include "cs_api.h"
#include <string.h>
typedef enum
{
HW_DISPLAY_NONE,
@@ -36,6 +33,7 @@ typedef struct hw_caps
int can_set_display_brightness;
char boxvendor[64];
char boxname[64];
char boxarch[64];
} hw_caps_t;
hw_caps_t *get_hwcaps(void);