|
|
|
@ -13,12 +13,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
class HardwareTici : public HardwareNone { |
|
|
|
class HardwareTici : public HardwareNone { |
|
|
|
public: |
|
|
|
public: |
|
|
|
static bool TICI() { return true; } |
|
|
|
|
|
|
|
static bool AGNOS() { return true; } |
|
|
|
|
|
|
|
static std::string get_os_version() { |
|
|
|
|
|
|
|
return "AGNOS " + util::read_file("/VERSION"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static std::string get_name() { |
|
|
|
static std::string get_name() { |
|
|
|
std::string model = util::read_file("/sys/firmware/devicetree/base/model"); |
|
|
|
std::string model = util::read_file("/sys/firmware/devicetree/base/model"); |
|
|
|
return util::strip(model.substr(std::string("comma ").size())); |
|
|
|
return util::strip(model.substr(std::string("comma ").size())); |
|
|
|
@ -56,16 +50,6 @@ public: |
|
|
|
return serial; |
|
|
|
return serial; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void reboot() { std::system("sudo reboot"); } |
|
|
|
|
|
|
|
static void poweroff() { std::system("sudo poweroff"); } |
|
|
|
|
|
|
|
static void set_brightness(int percent) { |
|
|
|
|
|
|
|
float max = std::stof(util::read_file("/sys/class/backlight/panel0-backlight/max_brightness")); |
|
|
|
|
|
|
|
std::ofstream("/sys/class/backlight/panel0-backlight/brightness") << int(percent * (max / 100.0f)) << "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static void set_display_power(bool on) { |
|
|
|
|
|
|
|
std::ofstream("/sys/class/backlight/panel0-backlight/bl_power") << (on ? "0" : "4") << "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void set_ir_power(int percent) { |
|
|
|
static void set_ir_power(int percent) { |
|
|
|
auto device = get_device_type(); |
|
|
|
auto device = get_device_type(); |
|
|
|
if (device == cereal::InitData::DeviceType::TICI || |
|
|
|
if (device == cereal::InitData::DeviceType::TICI || |
|
|
|
@ -104,7 +88,4 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static bool get_ssh_enabled() { return Params().getBool("SshEnabled"); } |
|
|
|
|
|
|
|
static void set_ssh_enabled(bool enabled) { Params().putBool("SshEnabled", enabled); } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|