mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-28 16:00:58 +02:00
move azbox code to libazbox directory
Origin commit data
------------------
Branch: master
Commit: 4fcc8f582f
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-12-23 (Sun, 23 Dec 2018)
Origin message was:
------------------
- move azbox code to libazbox directory
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
52
libazbox/hardware_caps.c
Normal file
52
libazbox/hardware_caps.c
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* determine the capabilities of the hardware.
|
||||
* part of libstb-hal
|
||||
*
|
||||
* (C) 2010-2012 Stefan Seyfried
|
||||
*
|
||||
* License: GPL v2 or later
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <hardware_caps.h>
|
||||
|
||||
static int initialized = 0;
|
||||
static hw_caps_t caps;
|
||||
|
||||
hw_caps_t *get_hwcaps(void)
|
||||
{
|
||||
if (initialized)
|
||||
return ∩︀
|
||||
|
||||
memset(&caps, 0, sizeof(hw_caps_t));
|
||||
|
||||
initialized = 1;
|
||||
caps.can_shutdown = 1;
|
||||
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||
caps.has_HDMI = 1;
|
||||
caps.display_xres = 8;
|
||||
caps.display_can_deepstandby = 0;
|
||||
caps.display_has_statusline = 0;
|
||||
strcpy(caps.boxvendor, "AZBox");
|
||||
const char *tmp;
|
||||
char buf[64];
|
||||
int len = -1;
|
||||
int fd = open("/proc/stb/info/model", O_RDONLY);
|
||||
if (fd != -1) {
|
||||
len = read(fd, buf, sizeof(buf) - 1);
|
||||
close(fd);
|
||||
}
|
||||
if (len > 0) {
|
||||
buf[len] = 0;
|
||||
strcpy(caps.boxname, buf);
|
||||
}
|
||||
else
|
||||
strcpy(caps.boxname, "(unknown model)");
|
||||
|
||||
return ∩︀
|
||||
}
|
Reference in New Issue
Block a user