SscCalApi.h 870 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2024 The LineageOS Project
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <cstdint>
  8. enum notify_t {
  9. BRIGHTNESS = 17,
  10. DC_STATE = 18,
  11. DISPLAY_FREQUENCY = 20,
  12. REPORT_VALUE = 201,
  13. POWER_STATE = 202,
  14. };
  15. struct _oem_msg {
  16. uint32_t sensorType;
  17. notify_t notifyType;
  18. float unknown1;
  19. float unknown2;
  20. float notifyTypeFloat;
  21. float value;
  22. float unused[10];
  23. };
  24. typedef void (*init_current_sensors_t)(bool debug);
  25. typedef void (*process_msg_t)(_oem_msg* msg);
  26. class SscCalApiWrapper {
  27. public:
  28. static SscCalApiWrapper& getInstance();
  29. void initCurrentSensors(bool debug);
  30. void processMsg(_oem_msg* msg);
  31. private:
  32. SscCalApiWrapper();
  33. ~SscCalApiWrapper();
  34. void* mSscCalApiHandle;
  35. process_msg_t process_msg;
  36. init_current_sensors_t init_current_sensors;
  37. };