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 {
|
|
|
|
|
2022-09-12 14:59:45 -04:00
|
|
|
typedef struct rgb {
|
2022-09-12 15:00:23 -04:00
|
|
|
rgb(uint8_t r, uint8_t g, uint8_t b) : red(r), green(g), blue(b) {};
|
|
|
|
rgb(uint32_t color);
|
|
|
|
rgb() : red(0), green(0), blue(0) {};
|
|
|
|
|
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();
|
2022-09-12 14:59:45 -04:00
|
|
|
} rgb_t;
|
2021-09-26 15:08:29 -04:00
|
|
|
|
|
|
|
bool fileWriteable(const std::string& file);
|
|
|
|
bool readFromFile(const std::string& file, std::string *content);
|
|
|
|
bool readFromFile(const std::string& file, uint32_t *content);
|
|
|
|
bool writeToFile(const std::string& file, uint32_t content);
|
|
|
|
|
|
|
|
} // namespace light
|
|
|
|
} // namespace hardware
|
|
|
|
} // namespace android
|
|
|
|
} // namespace aidl
|