22 #ifndef AMBIENTLIGHTSENSOR_H
23 #define AMBIENTLIGHTSENSOR_H
27 #include "lunaservice.h"
30 #define ALS_INIT_SAMPLE_SIZE 10
31 #define ALS_SAMPLE_SIZE 10
32 #define ALS_REGION_COUNT 5
34 #define ALS_REGION_UNDEFINED 0
35 #define ALS_REGION_DARK 1
36 #define ALS_REGION_DIM 2
37 #define ALS_REGION_INDOOR 3
38 #define ALS_REGION_OUTDOOR 4
50 bool update (
int intensity);
56 static bool controlStatus(LSHandle *sh, LSMessage *message,
void *ctx);
71 uint32_t m_alsLastOff;
73 int32_t m_alsSubscriptions;
74 int32_t m_alsDisabled;
77 int32_t m_alsSampleCount;
78 int32_t m_alsCountInRegion;
79 int32_t m_alsSamplesNeeded;
80 uint32_t m_alsLastSampleTs;
81 std::list<int32_t> m_alsSampleList;
88 bool updateAls (
int intensity);