2021-09-26 15:08:29 -04:00
|
|
|
/*
|
2022-09-12 12:18:05 -04:00
|
|
|
* Copyright (C) 2021-2022 The LineageOS Project
|
2021-09-26 15:08:29 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace aidl {
|
|
|
|
namespace android {
|
|
|
|
namespace hardware {
|
|
|
|
namespace light {
|
|
|
|
|
2023-11-12 19:39:17 -05:00
|
|
|
struct rgb {
|
2023-11-12 19:38:12 -05:00
|
|
|
rgb(uint8_t r, uint8_t g, uint8_t b) : red(r), green(g), blue(b){};
|
2022-09-12 15:00:23 -04:00
|
|
|
rgb(uint32_t color);
|
2023-11-12 19:38:12 -05:00
|
|
|
rgb() : red(0), green(0), blue(0){};
|
2022-09-12 15:00:23 -04:00
|
|
|
|
2022-09-12 12:18:05 -04:00
|
|
|
uint8_t red;
|
|
|
|
uint8_t green;
|
|
|
|
uint8_t blue;
|
2022-09-12 15:00:23 -04:00
|
|
|
|
|
|
|
bool isLit();
|
|
|
|
uint8_t toBrightness();
|
2023-11-12 19:39:17 -05:00
|
|
|
};
|
2021-09-26 15:08:29 -04:00
|
|
|
|
|
|
|
bool fileWriteable(const std::string& file);
|
2023-11-12 19:38:12 -05:00
|
|
|
bool readFromFile(const std::string& file, std::string* content);
|
|
|
|
bool readFromFile(const std::string& file, uint32_t* content);
|
2021-09-26 15:08:29 -04:00
|
|
|
bool writeToFile(const std::string& file, uint32_t content);
|
|
|
|
|
2023-11-12 19:38:12 -05:00
|
|
|
} // namespace light
|
|
|
|
} // namespace hardware
|
|
|
|
} // namespace android
|
|
|
|
} // namespace aidl
|