File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,11 @@ class BlinkerApi
104
104
int8_t num = checkNum (_bName, _Button, _bCount);
105
105
String state = STRING_find_string_value (static_cast <Proto*>(this )->dataParse (), _bName);
106
106
107
- if (state == BLINKER_CMD_BUTTON_PRESSED) {
107
+ if (state != " " ) {
108
+ _fresh = true ;
109
+ }
110
+
111
+ if (state == BLINKER_CMD_BUTTON_PRESSED || state == BLINKER_CMD_BUTTON_TAP) {
108
112
if ( num == BLINKER_OBJECT_NOT_AVAIL ) {
109
113
if ( _bCount < BLINKER_MAX_WIDGET_SIZE ) {
110
114
_Button[_bCount] = new BlinkerButton ();
@@ -304,7 +308,11 @@ class BlinkerApi
304
308
int8_t num = checkNum (_bName, _Button, _bCount);
305
309
String state = STRING_find_string_value (static_cast <Proto*>(this )->dataParse (), _bName);
306
310
307
- if (state == BLINKER_CMD_BUTTON_PRESSED) {
311
+ if (state != " " ) {
312
+ _fresh = true ;
313
+ }
314
+
315
+ if (state == BLINKER_CMD_BUTTON_PRESSED || state == BLINKER_CMD_BUTTON_TAP) {
308
316
if ( num == BLINKER_OBJECT_NOT_AVAIL ) {
309
317
if ( _bCount < BLINKER_MAX_WIDGET_SIZE ) {
310
318
_Button[_bCount] = new BlinkerButton ();
@@ -346,7 +354,7 @@ class BlinkerApi
346
354
return false ;
347
355
}
348
356
349
- return _Button[num]->getState ();;
357
+ return _Button[num]->getState ();
350
358
}
351
359
}
352
360
};
Original file line number Diff line number Diff line change 33
33
34
34
#define BLINKER_CMD_VIBRATE "vibrate"
35
35
36
+ #define BLINKER_CMD_BUTTON_TAP "tap"
37
+
36
38
#define BLINKER_CMD_BUTTON_PRESSED "pressed"
37
39
38
40
#define BLINKER_CMD_BUTTON_RELEASED "released"
Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ class BlinkerTransportESP32_BLE
139
139
if (vlen > 0 ) {
140
140
freshTime = millis ();
141
141
142
+ if (_bufLen == 0 ) {
143
+ memset (BLEBuf, ' \0 ' , BLINKER_BUFFER_SIZE);
144
+ }
145
+
142
146
for (uint8_t _num = 0 ; _num < vlen; _num++) {
143
147
BLEBuf[_bufLen] = value[_num];
144
148
_bufLen++;
You can’t perform that action at this time.
0 commit comments