mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Add hostname
This commit is contained in:
parent
ffb732ce7f
commit
3109960e25
@ -1,6 +1,7 @@
|
|||||||
#if defined(POSIX)
|
#if defined(POSIX)
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
#include "hasp_posix.h"
|
#include "hasp_posix.h"
|
||||||
|
|
||||||
@ -10,14 +11,29 @@
|
|||||||
|
|
||||||
#include "display/monitor.h"
|
#include "display/monitor.h"
|
||||||
|
|
||||||
|
extern monitor_t monitor;
|
||||||
|
|
||||||
namespace dev {
|
namespace dev {
|
||||||
|
|
||||||
void PosixDevice::reboot()
|
void PosixDevice::reboot()
|
||||||
{}
|
{}
|
||||||
void PosixDevice::show_info()
|
void PosixDevice::show_info()
|
||||||
{
|
{
|
||||||
LOG_VERBOSE(0, F("Processor : %s"), "unknown");
|
|
||||||
LOG_VERBOSE(0, F("CPU freq. : %i MHz"), 0);
|
struct utsname uts;
|
||||||
|
|
||||||
|
if (uname(&uts) < 0) {
|
||||||
|
LOG_ERROR(0,"uname() error");
|
||||||
|
} else {
|
||||||
|
LOG_VERBOSE(0,"Sysname: %s", uts.sysname);
|
||||||
|
LOG_VERBOSE(0,"Nodename: %s", uts.nodename);
|
||||||
|
LOG_VERBOSE(0,"Release: %s", uts.release);
|
||||||
|
LOG_VERBOSE(0,"Version: %s", uts.version);
|
||||||
|
LOG_VERBOSE(0,"Machine: %s", uts.machine);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_VERBOSE(0, "Processor : %s", "unknown");
|
||||||
|
LOG_VERBOSE(0, "CPU freq. : %i MHz", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -28,6 +44,7 @@ const char* PosixDevice::get_hostname()
|
|||||||
void PosixDevice::set_hostname(const char* hostname)
|
void PosixDevice::set_hostname(const char* hostname)
|
||||||
{
|
{
|
||||||
_hostname = hostname;
|
_hostname = hostname;
|
||||||
|
SDL_SetWindowTitle(monitor.window, hostname);
|
||||||
}
|
}
|
||||||
const char* PosixDevice::get_core_version()
|
const char* PosixDevice::get_core_version()
|
||||||
{
|
{
|
||||||
@ -73,7 +90,14 @@ bool PosixDevice::get_backlight_power()
|
|||||||
|
|
||||||
void PosixDevice::update_backlight()
|
void PosixDevice::update_backlight()
|
||||||
{
|
{
|
||||||
monitor_backlight(_backlight_power ? map(_backlight_level, 0, 100, 0, 255) : 0);
|
uint8_t level = _backlight_power ? map(_backlight_level, 0, 100, 0, 255) : 0;
|
||||||
|
|
||||||
|
SDL_SetTextureColorMod(monitor.texture, level, level, level);
|
||||||
|
// window_update(&monitor);
|
||||||
|
monitor.sdl_refr_qry = true;
|
||||||
|
// monitor_sdl_refr(NULL);
|
||||||
|
const lv_area_t area = {1,1,0,0};
|
||||||
|
//monitor_flush(NULL,&area,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t PosixDevice::get_free_max_block()
|
size_t PosixDevice::get_free_max_block()
|
||||||
|
@ -49,6 +49,7 @@ const char* Win32Device::get_hostname()
|
|||||||
void Win32Device::set_hostname(const char* hostname)
|
void Win32Device::set_hostname(const char* hostname)
|
||||||
{
|
{
|
||||||
_hostname = hostname;
|
_hostname = hostname;
|
||||||
|
SDL_SetWindowTitle(monitor.window, hostname);
|
||||||
}
|
}
|
||||||
const char* Win32Device::get_core_version()
|
const char* Win32Device::get_core_version()
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,7 @@ lib_deps =
|
|||||||
;lv_drivers=https://github.com/littlevgl/lv_drivers/archive/7d71907c1d6b02797d066f50984b866e080ebeed.zip
|
;lv_drivers=https://github.com/littlevgl/lv_drivers/archive/7d71907c1d6b02797d066f50984b866e080ebeed.zip
|
||||||
https://github.com/eclipse/paho.mqtt.c.git
|
https://github.com/eclipse/paho.mqtt.c.git
|
||||||
bblanchon/ArduinoJson@^6.17.2 ; Json(l) parser
|
bblanchon/ArduinoJson@^6.17.2 ; Json(l) parser
|
||||||
|
https://github.com/fvanroie/lv_drivers
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
paho
|
paho
|
||||||
|
Loading…
x
Reference in New Issue
Block a user