Skip to content

Commit e5e416e

Browse files
committed
Address requests for changes
1 parent bd11b90 commit e5e416e

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

src/TheThingsNode.h

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,49 @@ enum ttn_color: byte
2929

3030
class TheThingsNode
3131
{
32+
private:
33+
34+
// private constructor to achieve singleton pattern
35+
TheThingsNode();
36+
TheThingsNode(TheThingsNode const&); // copy disabled
37+
void operator=(TheThingsNode const&); // assigment disabled
38+
39+
bool intervalEnabled;
40+
uint32_t intervalMs;
41+
uint32_t intervalSince;
42+
bool lightEnabled;
43+
uint8_t lightGain;
44+
bool temperatureEnabled;
45+
bool temperatureSleep;
46+
bool motionStarted;
47+
unsigned long motionStartedAt;
48+
bool motionEnabled;
49+
bool buttonEnabled;
50+
bool buttonPressed;
51+
unsigned long buttonPressedAt;
52+
bool wasUSBDisconnected;
53+
bool USBDeepSleep;
54+
bool wdtStarted;
55+
56+
void (*wakeCallback)(void);
57+
void (*sleepCallback)(void);
58+
void (*temperatureCallback)(void);
59+
void (*motionStartCallback)(void);
60+
void (*motionStopCallback)(unsigned long duration);
61+
void (*buttonPressCallback)(void);
62+
void (*buttonReleaseCallback)(unsigned long duration);
63+
void (*intervalCallback)(void);
64+
65+
void wakeTemperature();
66+
void sleepTemperature();
67+
void wakeMotion();
68+
void sleepMotion();
69+
void writeMotion(unsigned char REG_ADDRESS, unsigned char DATA);
70+
uint8_t readMotion(unsigned char REG_ADDRESS);
71+
void WDT_start();
72+
void WDT_stop();
73+
void deepSleep(void);
74+
3275
public:
3376

3477
// static method to get the instance
@@ -84,49 +127,6 @@ class TheThingsNode
84127
void configUSB(bool deepSleep);
85128

86129
uint16_t getBattery();
87-
88-
private:
89-
90-
// private constructor to achieve singleton pattern
91-
TheThingsNode();
92-
TheThingsNode(TheThingsNode const&); // copy disabled
93-
void operator=(TheThingsNode const&); // assigment disabled
94-
95-
bool intervalEnabled;
96-
uint32_t intervalMs;
97-
uint32_t intervalSince;
98-
bool lightEnabled;
99-
uint8_t lightGain;
100-
bool temperatureEnabled;
101-
bool temperatureSleep;
102-
bool motionStarted;
103-
unsigned long motionStartedAt;
104-
bool motionEnabled;
105-
bool buttonEnabled;
106-
bool buttonPressed;
107-
unsigned long buttonPressedAt;
108-
bool wasUSBDisconnected;
109-
bool USBDeepSleep;
110-
bool wdtStarted;
111-
112-
void (*wakeCallback)(void);
113-
void (*sleepCallback)(void);
114-
void (*temperatureCallback)(void);
115-
void (*motionStartCallback)(void);
116-
void (*motionStopCallback)(unsigned long duration);
117-
void (*buttonPressCallback)(void);
118-
void (*buttonReleaseCallback)(unsigned long duration);
119-
void (*intervalCallback)(void);
120-
121-
void wakeTemperature();
122-
void sleepTemperature();
123-
void wakeMotion();
124-
void sleepMotion();
125-
void writeMotion(unsigned char REG_ADDRESS, unsigned char DATA);
126-
uint8_t readMotion(unsigned char REG_ADDRESS);
127-
void WDT_start();
128-
void WDT_stop();
129-
void deepSleep(void);
130130
};
131131

132132
#endif

test/TheThingsNode/TheThingsNode.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ void onInterval() {
5858
bool blue = node->getBlue();
5959
bool connected = node->isUSBConnected();
6060
uint16_t battery = node->getBattery();
61-
}
61+
}

0 commit comments

Comments
 (0)