ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
dumbdisplay.h
1/*
2
3============================
4
5if want to disable int parameter encoding, define DD_DISABLE_PARAM_ENCODING before including dumbdisplay.h, like
6
7#define DD_DISABLE_PARAM_ENCODING
8
9=============================
10
11*/
12
13#ifdef DD_DISABLE_PARAM_ENCODING
14 #pragma "message ***** DD_DISABLE_PARAM_ENCODING *****"
15#endif
16
17
18
19
20#ifndef dumbdisplay_h
21#define dumbdisplay_h
22
23
24// not used???
25// #ifdef DD_4_ESP32
26// #include <esp_spp_api.h>
27// #include "HardwareSerial.h"
28// #endif
29
30
31#define DUMBDISPLAY_BAUD 115200
32#define DD_SERIAL_BAUD DUMBDISPLAY_BAUD
33#define DD_WIFI_PORT 10201
34
35
36#define DD_DEF_SEND_BUFFER_SIZE 128
37#define DD_DEF_IDLE_TIMEOUT 5000
38#define DD_DEF_TUNNEL_TIMEOUT 150000
39
40
41#include "_dd_util.h"
42
43
44#define DD_CONDENSE_COMMAND
45
46
47#define DD_HEX_COLOR(color) ("#" + String(color, 16))
48
49
50#ifdef DD_CONDENSE_COMMAND
51 #define DD_INT_COLOR(color) ("+" + DDIntEncoder(color).encoded())
52 #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) || defined(DD_DISABLE_PARAM_ENCODING)
53 #define DD_RGB_COLOR(r, g, b) (String(r) + "-" + String(g) + "-" + String(b))
54 #else
55 #define DD_RGB_COLOR(r, g, b) ("+" + DDIntEncoder(0xffffff & ((((((int32_t) (r)) << 8) + ((int32_t) (g))) << 8) + ((int32_t) (b)))).encoded())
56 #endif
57 // #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO)
58 // #define DD_RGB_COLOR(r, g, b) (String(r) + "-" + String(g) + "-" + String(b))
59 // //#define DD_RGB_COLOR(r, g, b) (String(r<0?0:(r>255?255:r)) + "-" + String(g<0?0:(g>255?255:g)) + "-" + String(b<0?0:(b>255?255:b)))
60 // #else
61 // #if defined(DD_DISABLE_PARAM_ENCODING)
62 // #define DD_RGB_COLOR(r, g, b) ("#" + String(0xffffff & ((((((int32_t) (r)) << 8) + ((int32_t) (g))) << 8) + ((int32_t) (b))), 16))
63 // #else
64 // #define DD_RGB_COLOR(r, g, b) ("+" + DDIntEncoder(0xffffff & ((((((int32_t) (r)) << 8) + ((int32_t) (g))) << 8) + ((int32_t) (b)))).encoded())
65 // #endif
66 // #endif
67#else
68 #define DD_RGB_COLOR(r, g, b) (String(r<0?0:(r>255?255:r)) + "-" + String(g<0?0:(g>255?255:g)) + "-" + String(b<0?0:(b>255?255:b)))
69 #define DD_INT_COLOR(color) ("+" + String(color))
70#endif
71
72
73
74#define DD_AP_HORI "H(*)"
75#define DD_AP_VERT "V(*)"
76#define DD_AP_STACK "S(*)"
77#define DD_AP_HORI_2(id1, id2) ("H(" + id1 + "+" + id2 + ")")
78#define DD_AP_VERT_2(id1, id2) ("V(" + id1 + "+" + id2 + ")")
79#define DD_AP_STACK_2(id1, id2) ("S(" + id1 + "+" + id2 + ")")
80#define DD_AP_HORI_3(id1, id2, id3) ("H(" + id1 + "+" + id2 + "+" + id3 + ")")
81#define DD_AP_VERT_3(id1, id2, id3) ("V(" + id1 + "+" + id2 + "+" + id3 + ")")
82#define DD_AP_STACK_3(id1, id2, id3) ("S(" + id1 + "+" + id2 + "+" + id3 + ")")
83#define DD_AP_HORI_4(id1, id2, id3, id4) ("H(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + ")")
84#define DD_AP_VERT_4(id1, id2, id3, id4) ("V(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + ")")
85#define DD_AP_STACK_4(id1, id2, id3, id4) ("S(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + ")")
86#define DD_AP_HORI_5(id1, id2, id3, id4, id5) ("H(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")")
87#define DD_AP_VERT_5(id1, id2, id3, id4, id5) ("V(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")")
88#define DD_AP_STACK_5(id1, id2, id3, id4, id5) ("S(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")")
89#define DD_AP_HORI_6(id1, id2, id3, id4, id5, id6) ("H(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")" + "+" + id6 + ")")
90#define DD_AP_VERT_6(id1, id2, id3, id4, id5, id6) ("V(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")" + "+" + id6 + ")")
91#define DD_AP_STACK_6(id1, id2, id3, id4, id5, id6) ("S(" + id1 + "+" + id2 + "+" + id3 + "+" + id4 + "+" + id5 + ")" + "+" + id6 + ")")
92
93#define DD_AP_PADDING(lp, tp, rp, bp, id) ("S/" + String(lp) + "-" + String(tp) + "-" + String(rp) + "-" + String(bp) + "(" + id + ")")
94
95#define DD_AP_SPACER(w, h) (String("<") + String(w) + "x" + String(h) + String(">"))
96
97#define DD_PROGRAM_SPACE_COMPRESS_BA_0 '!'
98#define DD_COMPRESS_BA_0 '0'
99
100#ifndef DD_TUNNEL_DEF_BUFFER_SIZE
101 #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO)
102 #define DD_TUNNEL_DEF_BUFFER_SIZE 2
103 #else
104 #define DD_TUNNEL_DEF_BUFFER_SIZE 4
105 #endif
106#endif
107#if DD_TUNNEL_DEF_BUFFER_SIZE < 2
108 #error "DD_TUNNEL_DEF_BUFFER_SIZE must be at least 2"
109#endif
110
111
112#define DDIO_USE_DD_SERIAL
113
114#include "_dd_serial.h"
115#ifdef DDIO_USE_DD_SERIAL
116 extern DDSerial* _The_DD_Serial;
117#endif
118
119#include "_dd_io.h"
120#include "_dd_feedback.h"
121#include "_dd_colors.h"
122
123
124class DDLayer;
125
132typedef void (*DDFeedbackHandler)(DDLayer* pLayer, DDFeedbackType type, const DDFeedback& feedback);
133
134
135const int8_t DD_OBJECT_TYPE_LAYER = 0;
136const int8_t DD_OBJECT_TYPE_TUNNEL = 1;
137
138
140struct DDObject {
143#ifdef DD_NO_CUSTOM_DATA
144 #warning ??? DD_NO_CUSTOM_DATA set ???
145#else
148#endif
149public:
150 // since 20230601
151 virtual ~DDObject() {}
152};
153
154
156class DDLayer: public DDObject {
157 public:
167 void border(float size, const String& color, const String& shape = "flat", float extraSize = 0);
170 void noBorder();
174 void padding(float size);
178 void padding(float left, float top, float right, float bottom);
181 void noPadding();
185 void margin(float size);
189 void margin(float left, float top, float right, float bottom);
192 void noMargin();
197 void backgroundColor(const String& color, int opacity = 100);
203 void visible(bool visible);
209 void disabled(bool disabled = true);
213 void opacity(int opacity);
217 void alpha(int alpha);
223 void blend(const String& color, int alpha = 255, const String& mode = "darken");
226 void noblend();
228 void clear();
230 void flash();
232 void flashArea(int x, int y);
241 void explicitFeedback(int16_t x = 0, int16_t y = 0, const String& text = "", DDFeedbackType type = CLICK, const String& option = "");
242 inline const String& getLayerId() const { return layerId; }
248 void setFeedbackHandler(DDFeedbackHandler handler, const String& autoFeedbackMethod = "", const String& allowFeedbackTypes = "");
259 void enableFeedback(const String& autoFeedbackMethod = "", const String& allowFeedbackTypes = "");
266 void debugOnly(int i);
267 public:
268#ifndef DD_NO_FEEDBACK
270 inline DDFeedbackManager* getFeedbackManager() const { return pFeedbackManager; }
272 inline DDFeedbackHandler getFeedbackHandler() const { return feedbackHandler; }
273#endif
274 protected:
275 DDLayer(int8_t layerId);
276 public:
277 // made virtual since 20230601
278 virtual ~DDLayer();
279 protected:
280 void _enableFeedback();
281 protected:
282 String layerId;
283#ifndef DD_NO_FEEDBACK
284 // either feedbackManager or feedbackHandler is used
285 DDFeedbackManager *pFeedbackManager;
286 DDFeedbackHandler feedbackHandler;
287#endif
288};
289
290#define DD_DEF_LAYER_LEVEL_ID "_"
291
296 public:
301 void addLevel(const String& levelId, float width = 0, float height = 0, bool switchToIt = false);
303 inline void addLevel(const String& levelId, bool switchToIt) {
304 addLevel(levelId, 0, 0, switchToIt);
305 }
309 void switchLevel(const String& levelId, bool addIfMissing = true);
311 void pushLevel();
314 void pushLevelAndSwitchTo(const String& switchTolevelId, bool addIfMissing = true);
316 void popLevel();
323 void setLevelAnchor(float x, float y, long reachInMillis = 0);
325 void moveLevelAnchorBy(float byX, float byY, long reachInMillis = 0);
330 void registerLevelBackground(const String& backgroundId, const String& backgroundImageName, const String& drawBackgroundOptions = "");
335 void setLevelBackground(const String& backgroundId, const String& backgroundImageName = "", const String& drawBackgroundOptions = "");
342 void animateLevelBackground(int fps, bool reset = true, const String& options = "");
345 void stopAnimateLevelBackground(bool reset = true);
348 void reorderLevel(const String& levelId, const String& how);
350 void exportLevelsAsImage(const String& imageFileName, bool cacheItNotSave = false);
352 void deleteLevel(const String& levelId);
353 protected:
354 MultiLevelDDLayer(int8_t layerId): DDLayer(layerId) {}
355};
356
357
358
359enum MbArrow { North, NorthEast, East, SouthEast, South, SouthWest, West, NorthWest };
360enum MbIcon { Heart, SmallHeart, Yes, No, Happy, Sad, Confused, Angry, Asleep, Surprised,
361 Silly, Fabulous, Meh, TShirt, Rollerskate, Duck, House, Tortoise, Butterfly, StickFigure,
362 Ghost, Sword, Giraffe, Skull, Umbrella, Snake, Rabbit, Cow, QuarterNote, EigthNote,
363 Pitchfork, Target, Triangle, LeftTriangle, Chessboard, Diamond, SmallDiamond, Square, SmallSquare, Scissors };
364
365class MbImage {
366 public:
367 MbImage(int8_t imageId) {
368 this->imageId = String(imageId);
369 }
370 inline const String& getImageId() const { return this->imageId; }
371 private:
372 String imageId;
373};
374
376class MbDDLayer: public DDLayer {
377 public:
379 MbDDLayer(int8_t layerId): DDLayer(layerId) {
380 }
382 void showIcon(MbIcon icon);
384 void showArrow(MbArrow arrow);
386 void showNumber(int num);
388 void showString(const String& str);
390 void plot(int x, int y);
392 void unplot(int x, int y);
394 void toggle(int x, int y);
400 void showLeds(const String& ledPattern);
403 void ledColor(const String& color);
404 MbImage* createImage(const String& ledPattern);
405 void releaseImage(MbImage *pImage);
406 void showImage(MbImage *pImage, int xOff);
407 void scrollImage(MbImage *pImage, int xOff, long interval);
408};
409
412 public:
414 TurtleDDLayer(int8_t layerId): MultiLevelDDLayer(layerId) {
415 }
417 void forward(int distance, bool withPen = true);
419 void backward(int distance, bool withPen = true);
421 void leftTurn(int angle);
423 void rightTurn(int angle);
425 void home(bool withPen = true);
427 void goTo(int x, int y, bool withPen = true);
429 void goBy(int byX, int byY, bool withPen = true);
431 void setHeading(int angle);
433 void penSize(int size);
436 void penColor(const String& color);
439 void fillColor(const String& color);
443 void penFilled(bool filled);
445 void setTextSize(int size);
448 void setTextFont(const String& fontName = "", int textSize = 0);
450 void penUp();
452 void penDown();
453 void beginFill();
454 void endFill();
456 void dot(int size, const String& color);
458 void circle(int radius, bool centered = false);
460 void oval(int width, int height, bool centered = false);
462 void arc(int width, int height, int startAngle, int sweepAngle, bool centered = false);
464 void triangle(int side1, int angle, int side2);
466 void isoscelesTriangle(int side, int angle);
468 void rectangle(int width, int height, bool centered = false);
470 void polygon(int side, int vertexCount);
474 void centeredPolygon(int radius, int vertexCount, bool inside = false);
476 void write(const String& text, bool draw = false);
477};
478
480class LedGridDDLayer: public DDLayer {
481 public:
483 LedGridDDLayer(int8_t layerId): DDLayer(layerId) {
484 }
486 void turnOn(int x = 0, int y = 0);
488 void turnOff(int x = 0, int y = 0);
490 void toggle(int x = 0, int y = 0);
493 void turnOnEx(int x = 0, int y = 0, const String& onColor = "");
498 void bitwise(unsigned int bits, int y = 0, bool reverse = false);
501 void bitwise2(unsigned int bits_0, unsigned int bits_1, int y = 0, bool reverse = false);
504 void bitwise3(unsigned int bits_0, unsigned int bits_1, unsigned int bits_2, int y = 0, bool reverse = false);
507 void bitwise4(unsigned int bits_0, unsigned int bits_1, unsigned int bits_2, unsigned int bits_3, int y = 0, bool reverse = false);
510 void horizontalBar(int count, bool rightToLeft = false);
513 void verticalBar(int count, bool bottomToTop = true);
518 void horizontalBarEx(int count, int startX = 0, const String& color = "");
523 void verticalBarEx(int count, int startY = 0, const String& color = "");
526 void onColor(const String& color);
529 void offColor(const String& color);
532};
533
539class LcdDDLayer: public DDLayer {
540 public:
542 LcdDDLayer(int8_t layerId): DDLayer(layerId) {
543 }
545 void print(const String& text);
547 void home();
551 void setCursor(int x, int y);
553 void cursor();
555 void noCursor();
560 void display();
561 void noDisplay();
562 void scrollDisplayLeft();
563 void scrollDisplayRight();
566 void writeLine(const String& text, int y = 0, const String& align = "L");
568 void writeRightAlignedLine(const String& text, int y = 0);
570 void writeCenteredLine(const String& text, int y = 0);
573 void pixelColor(const String &color);
576 void bgPixelColor(const String &color);
579};
580
586 public:
588 SelectionDDLayer(int8_t layerId): DDLayer(layerId) {
589 _enableFeedback();
590 }
593 void pixelColor(const String &color);
596 void text(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0, const String& align = "L");
598 void textCentered(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0);
600 void textRightAligned(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0);
603 void unselectedText(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0, const String& align = "L");
605 void unselectedTextCentered(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0);
607 void unselectedTextRightAligned(const String& text, int y = 0, int horiSelectionIdx = 0, int vertSelectionIdx = 0);
609 void select(int horiSelectionIdx = 0, int vertSelectionIdx = 0, bool deselectTheOthers = true);
611 void deselect(int horiSelectionIdx = 0, int vertSelectionIdx = 0, bool selectTheOthers = false);
613 void selectAll();
617 void selected(bool selected, int horiSelectionIdx = 0, int vertSelectionIdx = 0, bool reverseTheOthers = false);
621 void highlightBorder(bool forSelected, const String& borderColor = "", const String& borderShape = "");
622 };
623
626 public:
628 GraphicalDDLayer(int8_t layerId): MultiLevelDDLayer(layerId) {
629 }
631 void setRotation(int8_t rotationType);
633 void setCursor(int x, int y);
635 void moveCursorBy(int byX, int byY);
639 void setTextColor(const String& color, const String& bgColor = "");
641 void setTextSize(int size);
645 void setTextFont(const String& fontName);
649 inline void setTextFont(const String& fontName, int textSize) {
650 setTextFont(fontName);
651 if (textSize > 0) {
652 setTextSize(textSize);
653 }
654 }
656 void setTextWrap(bool wrapOn);
659 void fillScreen(const String& color);
661 void print(const String& text);
663 void println(const String& text = "");
668 void drawChar(int x, int y, char c, const String& color = "", const String& bgColor = "", int size = 0);
673 void drawStr(int x, int y, const String& string, const String& color = "", const String& bgColor = "", int size = 0);
676 void drawTextLine(const String& text, int y, const String& align = "L", const String& color = "", const String& bgColor = "", int size = 0);
679 void drawPixel(int x, int y, const String& color = "");
682 void drawLine(int x1, int y1, int x2, int y2, const String& color = "");
685 void drawCircle(int x, int y, int r, const String& color = "", bool filled = false);
686 // draw filled circle
688 inline void fillCircle(int x, int y, int r, const String& color = "") {
689 drawCircle(x, y, r, color, true);
690 }
693 void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const String& color = "", bool filled = false);
696 inline void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const String& color = "") {
697 drawTriangle(x1, y1, x2, y2, x3, y3, color, true);
698 }
701 void drawRect(int x, int y, int w, int h, const String& color = "", bool filled = false);
704 inline void fillRect(int x, int y, int w, int h, const String& color = "") {
705 drawRect(x, y, w, h, color, true);
706 }
709 void drawRoundRect(int x, int y, int w, int h, int r, const String& color = "", bool filled = false);
712 inline void fillRoundRect(int x, int y, int w, int h, int r, const String& color = "") {
713 drawRoundRect(x, y, w, h, r, color, true);
714 }
717 void drawOval(int x, int y, int w, int h, const String& color = "", bool filled = false);
720 inline void fillOval(int x, int y, int w, int h, const String& color = "") {
721 drawOval(x, y, w, h, color, true);
722 }
725 void drawArc(int x, int y, int w, int h, int startAngle, int sweepAngle, bool useCenter, const String& color = "", bool filled = false);
728 inline void fillArc(int x, int y, int w, int h, int startAngle, int sweepAngle, bool useCenter, const String& color = "") {
729 drawArc(x, y, w, h, startAngle, sweepAngle, useCenter, color, true);
730 }
732 void forward(int distance);
734 void leftTurn(int angle);
736 void rightTurn(int angle);
738 void setHeading(int angle);
740 void penSize(int size);
743 void penColor(const String& color);
746 void fillColor(const String& color);
750 void circle(int radius, bool centered = false);
752 void oval(int width, int height, bool centered = false);
754 void arc(int width, int height, int startAngle, int sweepAngle, bool centered = false);
756 void triangle(int side1, int angle, int side2);
758 void isoscelesTriangle(int side, int angle);
760 void rectangle(int width, int height, bool centered = false);
762 void polygon(int side, int vertexCount);
767 void centeredPolygon(int radius, int vertexCount, bool inside = false);
770 void write(const String& text, bool draw = false);
774 void loadImageFile(const String& imageFileName, int w = 0, int h = 0, const String& asImageFileName = "");
780 inline void loadImageFileScaled(const String& imageFileName, int w, int h, const String& asImageFileName) {
781 loadImageFile(imageFileName, w, h, asImageFileName);
782 }
783 void loadImageFileCropped(const String& imageFileName, int x, int y, int w, int h, const String& asImageFileName, int scaleW = 0, int scaleH = 0);
785 void unloadImageFile(const String& imageFileName);
791 void drawImageFile(const String& imageFileName, int x = 0, int y = 0, int w = 0, int h = 0, const String& options = "");
793 inline void drawImageFile(const String& imageFileName, const String& options) {
794 drawImageFile(imageFileName, 0, 0, 0, 0, options);
795 }
798 inline void drawImageFileScaled(const String& imageFileName, int w, int h, const String& options = "") {
799 drawImageFile(imageFileName, 0, 0, w, h, options);
800 }
804 void drawImageFileFit(const String& imageFileName, int x = 0, int y = 0, int w = 0, int h = 0, const String& options = "");
806 inline void drawImageFileFit(const String& imageFileName, const String& options) {
807 drawImageFileFit(imageFileName, 0, 0, 0, 0, options);
808 }
810 void cacheImage(const String& imageName, const uint8_t *bytes, int byteCount, char compressionMethod = 0);
811 void cacheImageWithTS(const String& imageName, const uint8_t *bytes, int byteCount, long imageTimestamp, char compressionMethod = 0);
813 void cachePixelImage(const String& imageName, const uint8_t *bytes, int width, int height, const String& color = "", char compressionMethod = 0);
815 void cachePixelImage16(const String& imageName, const uint16_t *data, int width, int height, const String& options = "", char compressMethod = 0);
817 void cachePixelImageGS(const String& imageName, const uint8_t *data, int width, int height, const String& options = "", char compressMethod = 0);
820 void saveCachedImageFile(const String& imageName, const String& asImageName = "");
821#ifdef ESP32
824 void saveCachedImageFileWithTS(const String& imageName, const String& asImageName, int64_t imageTimestamp);
825#endif
828 void saveCachedImageFileAsync(const String& imageName, const String& asImageName = "");
829#ifdef ESP32
832 void saveCachedImageFileWithTSAsync(const String& imageName, const String& asImageName, int64_t imageTimestamp);
833#endif
836 void saveCachedImageFiles(const String& stitchAsImageName = "");
837};
838
839
842 public:
844 SevenSegmentRowDDLayer(int8_t layerId): DDLayer(layerId) {
845 }
848 void segmentColor(const String& color);
851 void resetSegmentOffColor(const String& color);
857 void turnOn(const String& segments, int digitIdx = 0);
861 void turnOff(const String& segments, int digitIdx = 0);
864 void setOn(const String& segments = "", int digitIdx = 0);
866 void showDigit(int digit, int digitIdx = 0);
868 void showNumber(float number, const String& padding = " ");
870 void showHexNumber(int16_t number);
873 void showFormatted(const String& formatted, bool completeReplace = true, int startIdx = 0);
874};
875
876
881 public:
883 JoystickDDLayer(int8_t layerId): DDLayer(layerId) {
884 _enableFeedback();
885 }
888 void autoRecenter(bool autoRecenter = true);
890 void colors(const String& stickColor, const String& stickOutlineColor, const String& socketColor = "", const String& socketOutlineColor = "");
895 void moveToPos(int16_t x, int16_t y, bool sendFeedback = false);
898 void moveToCenter(bool sendFeedback = false);
903 void valueRange(int16_t minValue, int16_t maxValue, int valueStep = 1, bool sendFeedback = false);
905 void snappy(bool snappy = true);
907 void showValue(bool show = true, const String& color = "");
908};
909
911class PlotterDDLayer: public DDLayer {
912 public:
914 PlotterDDLayer(int8_t layerId): DDLayer(layerId) {
915 }
918 void label(const String& key, const String& lab);
919 inline void label(const String& lab) { label("", lab); }
922 void set(const String& key, float value);
924 inline void set(float value) { set("", value); }
925 void set(const String& key1, float value1, const String& key2, float value2);
926 void set(const String& key1, float value1, const String& key2, float value2, const String& key3, float value3);
927 void set(const String& key1, float value1, const String& key2, float value2, const String& key3, float value3, const String& key4, float value4);
928};
929
930
934 public:
936 TomTomMapDDLayer(int8_t layerId): DDLayer(layerId) {
937 }
938 void goTo(float latitude, float longitude, const String& label = "");
939 void zoomTo(float latitude, float longitude, float zoomLevel = 15.0, const String& label = "");
940 void zoom(float zoomLevel);
941};
942
943
946 public:
948 TerminalDDLayer(int8_t layerId): DDLayer(layerId) {
949 }
950 void print(const String& val);
951 void println(const String& val);
952 inline void print(int intVal) {
953 String val(intVal);
954 print(val);
955 }
956 inline void println(int intVal) {
957 String val(intVal);
958 print(val);
959 }
960 inline void print(float floatVal) {
961 String val(floatVal);
962 print(val);
963 }
964 inline void println(float floatVal) {
965 String val(floatVal);
966 print(val);
967 }
968 inline void println() {
969 println("");
970 }
971};
972
975class WebViewDDLayer: public DDLayer {
976 public:
978 WebViewDDLayer(int8_t layerId): DDLayer(layerId) {
979 _enableFeedback();
980 }
981 void loadUrl(const String& url);
982 void loadHtml(const String& html);
983 void execJs(const String& js);
984};
985
986
990 public:
992 DumbDisplayWindowDDLayer(int8_t layerId): DDLayer(layerId) {
993 }
994 void connect(const String& deviceType, const String& deviceName, const String& deviceAddress);
995 void disconnect();
996};
997
998
999
1002 public:
1003 DDTunnelEndpoint(const String& endPoint) {
1004 this->endPoint = endPoint;
1005 this->headers = "";
1006 this->params = "";
1007 }
1009 void resetEndpoint(const String& endPoint) {
1010 this->endPoint = endPoint;
1011 }
1014 void resetSoundAttachment(const String& soundName) {
1015 if (soundName == "") {
1016 this->attachmentId = "";
1017 } else {
1018 this->attachmentId = "sound:" + soundName;
1019 }
1020 }
1023 this->headers = "";
1024 }
1027 this->params = "";
1028 }
1030 void addParam(const String& param) {
1031 if (true) {
1032 if (this->params.length() > 0) {
1033 this->params.concat(',');
1034 }
1035 this->params.concat(param);
1036 } else {
1037 if (this->params == "") {
1038 this->params = param;
1039 } else {
1040 this->params = this->params + "," + param;
1041 }
1042 }
1043 }
1045 void addNamedParam(const String& paramName, const String& paramValue) {
1046 addParam(paramName + "=" + paramValue);
1047 }
1049 void addHeader(const String& headerKey, const String& headerValue) {
1050 if (true) {
1051 if (this->headers.length() > 0) {
1052 this->headers.concat('|');
1053 }
1054 this->headers.concat(headerKey);
1055 this->headers.concat(":");
1056 this->headers.concat(headerValue);
1057 } else {
1058 if (this->headers == "") {
1059 this->headers = String(headerKey) + ":" + headerValue;
1060 } else {
1061 this->headers = this->headers + "|" + headerKey + ":" + headerValue;
1062 }
1063 }
1064 }
1065 public:
1066 String endPoint;
1067 String headers;
1068 String attachmentId;
1069 String params;
1070};
1071
1072
1074class DDTunnel: public DDObject {
1075 public:
1077 DDTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/);
1078 void afterConstruct(bool connectNow);
1079 virtual ~DDTunnel();
1080 public:
1081 const String& getEndpoint() { return endPoint; }
1082 public:
1083 virtual void release();
1084 virtual void reconnect();
1085 void reconnectTo(const String& endPoint);
1089 void reconnectToSetParams(const String& endPoint, const String& params) {
1090 this->endPoint = endPoint;
1091 this->params = params;
1092 reconnect();
1093 }
1096 this->endPoint = endpoint.endPoint;
1097 this->headers = endpoint.headers;
1098 this->attachmentId = endpoint.attachmentId;
1099 this->params = endpoint.params;
1100 reconnect();
1101 }
1102 const String& getTunnelId() const { return tunnelId; }
1103 protected:
1104 inline bool _pending() { return doneState == 0; }
1105 //int _count();
1106 inline bool _timedOut() { return /*timedOut*/doneState == -1; }
1107 virtual bool _eof(long timeoutMillis);
1108 //void _readLine(String &buffer);
1109 void _writeLine(const String& data);
1110 void _writeSound(const String& soundName);
1111 public:
1112 virtual void handleInput(const String& data, uint8_t* fbBytes, bool final) { doneHandleInput(final); }
1113 protected:
1114 void doneHandleInput(bool final);
1115 protected:
1116 String type;
1117 String tunnelId;
1118 String endPoint;
1119 String headers;
1120 String attachmentId;
1121 String params;
1122 unsigned long connectMillis;
1123 // int arraySize;
1124 // String* dataArray;
1125 // int nextArrayIdx;
1126 // int validArrayIdx;
1127 private:
1128 //bool done;
1129 //bool timedOut;
1130 int8_t doneState; // 0 not done; 1 done; -1 timed out
1131};
1132
1133
1136 public:
1138 DDBufferedTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/, int8_t bufferSize);
1139 virtual ~DDBufferedTunnel();
1140 virtual void release();
1141 virtual void reconnect();
1142 //const String& getTunnelId() { return tunnelId; }
1143 protected:
1144 int _count();
1145 virtual bool _eof(long timeoutMillis);
1146 bool _readLine(String &buffer, uint8_t** pFBBytes = NULL);
1147 //void _writeLine(const String& data);
1148 public:
1150 virtual void handleInput(const String& data, uint8_t* fbBytes, bool final);
1151 private:
1152 // String endPoint;
1153 // String tunnelId;
1154 int8_t arraySize;
1155 String* dataArray;
1156 uint8_t** fbByesArray;
1157 int8_t nextArrayIdx;
1158 int8_t validArrayIdx;
1159 //bool done;
1160 public:
1161 bool pending();
1163 inline int count() { return _count(); }
1167 inline bool eof(long timeoutMillis = DD_DEF_TUNNEL_TIMEOUT) { return _eof(timeoutMillis); }
1169 inline bool timedOut() { return _timedOut(); }
1171 String readLine();
1173 inline bool readLine(String &buffer) { return _readLine(buffer); }
1175 inline void writeLine(const String& data) { _writeLine(data); }
1177 bool read(String& fieldId, String& fieldValue);
1178};
1179
1180
1187
1214
1217 public:
1219 SimpleToolDDTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/, int bufferSize):
1220 BasicDDTunnel(type, tunnelId, params, endPoint/*, connectNow*/, bufferSize) {
1221 this->result = 0;
1222 }
1223 public:
1224 virtual void reconnect();
1227 private:
1228 int result;
1229};
1230
1233 float latitude;
1234 float longitude;
1235};
1238 public:
1240 GpsServiceDDTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/, int8_t bufferSize):
1241 BasicDDTunnel(type, tunnelId, params, endPoint/*, connectNow*/, bufferSize) {
1242 }
1243 public:
1245 void reconnectForLocation(int repeat = -1);
1246 bool readLocation(DDLocation& location);
1247};
1248
1249
1252 int left;
1253 int top;
1254 int right;
1255 int bottom;
1256 String label;
1257};
1260 public:
1262 ObjectDetectDemoServiceDDTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/, int8_t bufferSize):
1263 BasicDDTunnel(type, tunnelId, params, endPoint/*, connectNow*/, bufferSize) {
1264 }
1265 public:
1266 void reconnectForObjectDetect(const String& imageName);
1267 void reconnectForObjectDetectFrom(GraphicalDDLayer* pGraphicalLayer, const String& imageName);
1268 bool readObjectDetectResult(DDObjectDetectDemoResult& objectDetectResult);
1269};
1270
1272 DDImageData(): bytes(NULL) {};
1273 ~DDImageData();
1274 boolean isValid() { return width > 0 && height > 0; }
1275 void release();
1276 int width;
1277 int height;
1278 int byteCount;
1279 uint8_t* bytes;
1280protected:
1281 void transferTo(DDImageData& imageData);
1282};
1284 void transferDataTo(DDPixelImage& pixelImage) { DDImageData::transferTo(pixelImage); }
1285};
1287 DDPixelImage16(): data(NULL) {};
1289 boolean isValid() { return width > 0 && height > 0; }
1290 void transferTo(DDPixelImage16& pixelImage16);
1291 void release();
1292 int width;
1293 int height;
1294 int byteCount;
1295 uint16_t* data;
1296};
1297struct DDJpegImage: public DDImageData {
1298 void transferTo(DDJpegImage& jpegImage) { DDImageData::transferTo(jpegImage); }
1299};
1307 public:
1309 ImageRetrieverDDTunnel(const String& type, int8_t tunnelId, const String& params, const String& endPoint/*, bool connectNow*/, int8_t bufferSize):
1310 BasicDDTunnel(type, tunnelId, params, endPoint/*, connectNow*/, bufferSize) {
1311 }
1312 public:
1315 void reconnectForPixelImage(const String& imageName, int width, int height, bool fit = false);
1318 void reconnectForPixelImage16(const String& imageName, int width, int height, bool fit = false, bool grayscale = false);
1319 void reconnectForPixelImageGS(const String& imageName, int width, int height, bool fit = false);
1322 void reconnectForJpegImage(const String& imageName, int width, int height, int quality=100, bool fit = false);
1324 bool readPixelImage(DDPixelImage& pixelImage);
1326 bool readPixelImage16(DDPixelImage16& pixelImage16);
1327 bool readPixelImageGS(DDPixelImage& pixelImage);
1332 private:
1333 bool _readImageData(DDImageData& imageData, short type);
1334};
1335
1336
1337
1341 public:
1343 JsonDDTunnelMultiplexer(JsonDDTunnel** tunnels, int8_t tunnelCount);
1345 int count();
1346 bool eof();
1348 int read(String& fieldId, String& fieldValue);
1349 void release();
1350 void reconnect();
1351 private:
1352 int8_t tunnelCount;
1353 JsonDDTunnel** tunnels;
1354};
1355
1356#ifndef DD_NO_IDLE_CALLBACK
1360enum DDIdleConnectionState { IDLE_NOT_CONNECTED, IDLE_CONNECTING, IDLE_RECONNECTING };
1366typedef void (*DDIdleCallback)(long idleForMillis, DDIdleConnectionState connectionState);
1367#endif
1368
1369#ifndef DD_NO_CONNECT_VERSION_CHANGED_CALLBACK
1373typedef void (*DDConnectVersionChangedCallback)(int connectVersion);
1374#endif
1375
1376#ifndef DD_NO_DEBUG_INTERFACE
1380enum DDDebugConnectionState { DEBUG_NOT_CONNECTED, DEBUG_CONNECTING, DEBUG_CONNECTED, DEBUG_RECONNECTING, DEBUG_RECONNECTED };
1383 public:
1385 virtual void logConnectionState(DDDebugConnectionState connectionState) {}
1387 virtual void logSendCommand(int state) {}
1388 virtual void logError(const String& errMsg) {}
1389};
1390#endif
1391
1392
1393#ifndef DD_NO_PASSIVE_CONNECT
1402};
1403#endif
1404
1405
1406extern bool _DDDisableParamEncoding;
1407inline void DDDebugDisableParamEncoding() { _DDDisableParamEncoding = true; }
1408
1409
1414 public:
1415 DumbDisplay(DDInputOutput* pIO, uint16_t sendBufferSize = DD_DEF_SEND_BUFFER_SIZE, long idleTimeout = DD_DEF_IDLE_TIMEOUT/*, bool enableDoubleClick = true*/) {
1416#ifdef DD_DISABLE_PARAM_ENCODING
1417 DDDebugDisableParamEncoding();
1418#endif
1419#ifdef DD_NO_SERIAL
1420 #warning ***** DD_NO_SERIAL defined *****
1421#else
1422 #ifdef DDIO_USE_DD_SERIAL
1423 if (pIO->isForSerial() || pIO->isBackupBySerial()) {
1424 _The_DD_Serial = new DDSerial();
1425 }
1426 #endif
1427#endif
1428 initialize(pIO, sendBufferSize, idleTimeout/*, enableDoubleClick*/);
1429 }
1432 void connect();
1434 bool connected() const;
1442 void setFeedbackSingleClickOnly(bool singleClickOnly = true);
1450 void configAutoPin(const String& layoutSpec = DD_AP_VERT, bool autoShowHideLayers = false);
1451 // /// in addition to DumbDisplay::configAutoPin(), also configure the remaining layout spec for the remaining layers not mentioned in the layoutSpec
1452 // /// @see configAutoPin
1453 // /// @see addRemainingAutoPinConfig
1454 // void configAutoPinEx(const String& layoutSpec = DD_AP_VERT, const String& remainingLayoutSpec);
1456 void addRemainingAutoPinConfig(const String& remainingLayoutSpec);
1460 void configPinFrame(int xUnitCount = 100, int yUnitCount = 100, bool autoShowHideLayers = false);
1464 void pinLayer(DDLayer *pLayer, int uLeft, int uTop, int uWidth, int uHeight, const String& align = "");
1468 void pinAutoPinLayers(const String& layoutSpec, int uLeft, int uTop, int uWidth, int uHeight, const String& align = "");
1470 MbDDLayer* createMicrobitLayer(int width = 5, int height = 5);
1472 TurtleDDLayer* createTurtleLayer(int width, int height);
1474 LedGridDDLayer* createLedGridLayer(int colCount = 1, int rowCount = 1, int subColCount = 1, int subRowCount = 1);
1476 LcdDDLayer* createLcdLayer(int colCount = 16, int rowCount = 2, int charHeight = 0, const String& fontName = "");
1478 SelectionDDLayer* createSelectionLayer(int colCount = 16, int rowCount = 2,
1479 int horiSelectionCount = 1, int vertSelectionCount = 1,
1480 int charHeight = 0, const String& fontName = "",
1481 bool canDrawDots = true, float selectionBorderSizeCharHeightFactor = 0.3);
1497 JoystickDDLayer* createJoystickLayer(int maxStickValue = 1023, const String& directions = "", float stickSizeFactor = 1.0/*, int stickValueDivider = 1*/);
1499 PlotterDDLayer* createPlotterLayer(int width, int height, int pixelsPerSecond = 10);
1503 PlotterDDLayer* createFixedRatePlotterLayer(int width, int height, int pixelsPerScale = 5);
1508 TomTomMapDDLayer* createTomTomMapLayer(const String& mapKey, int width, int height);
1511 TerminalDDLayer* createTerminalLayer(int width, int height);
1514 WebViewDDLayer* createWebViewLayer(int width, int height, const String& jsObjectName = "DD");
1521 BasicDDTunnel* createBasicTunnel(const String& endPoint, bool connectNow = true, int8_t bufferSize = DD_TUNNEL_DEF_BUFFER_SIZE);
1525 JsonDDTunnel* createJsonTunnel(const String& endPoint, bool connectNow = true, int8_t bufferSize = DD_TUNNEL_DEF_BUFFER_SIZE);
1530 JsonDDTunnel* createFilteredJsonTunnel(const String& endPoint, const String& fileNames, bool connectNow = true, int8_t bufferSize = DD_TUNNEL_DEF_BUFFER_SIZE);
1535 SimpleToolDDTunnel* createImageDownloadTunnel(const String& endPoint, const String& imageName, boolean redownload = true);
1550 ObjectDetectDemoServiceDDTunnel* createObjectDetectDemoServiceTunnel(int scaleToWidth = 0, int scaleToHeight = 0, int maxNumObjs = 1);
1551 ImageRetrieverDDTunnel* createImageRetrieverTunnel();
1553 void deleteTunnel(DDTunnel *pTunnel);
1556 void backgroundColor(const String& color);
1563 void playbackLayerSetupCommands(const String& layerSetupPersistId);
1572 void stopRecordLayerCommands(const String& saveId = "", bool persistSave = false);
1579 void saveLayerCommands(const String& id, bool persist = false, bool stopAfterSave = false);
1584 void loadLayerCommands(const String& id);
1590 void capture(const String& imageFileName, int width, int height);
1592 void sendNoOp();
1594 void writeComment(const String& comment);
1596 void tone(uint32_t freq, uint32_t duration);
1597 void notone();
1599 void playSound(const String& soundName);
1600 void stopSound();
1602 void saveSound8(const String& soundName, const int8_t *bytes, int sampleCount, int sampleRate, int numChannels = 1);
1604 void saveSound16(const String& soundName, const int16_t *data, int sampleCount, int sampleRate, int numChannels = 1);
1606 void cacheSound8(const String& soundName, const int8_t *bytes, int sampleCount, int sampleRate, int numChannels = 1);
1608 void cacheSound16(const String& soundName, const int16_t *data, int sampleCount, int sampleRate, int numChannels = 1);
1610 void saveCachedSound(const String& soundName);
1613 void saveCachedSoundAsH(const String& soundName);
1615 int streamSound8(int sampleRate, int numChannels = 1);
1617 int streamSound16(int sampleRate, int numChannels = 1);
1620 int saveSoundChunked8(const String& soundName/*, const int8_t *bytes, int sampleCount*/, int sampleRate, int numChannels = 1);
1623 int saveSoundChunked16(const String& soundName/*, const int16_t *data, int sampleCount*/, int sampleRate, int numChannels = 1);
1626 int cacheSoundChunked8(const String& soundName/*, const int8_t *bytes, int sampleCount*/, int sampleRate, int numChannels = 1);
1629 int cacheSoundChunked16(const String& soundName/*, const int16_t *data, int sampleCount*/, int sampleRate, int numChannels = 1);
1631 void sendSoundChunk8(int chunkId, const int8_t *bytes, int sampleCount, bool isFinal = false);
1633 void sendSoundChunk16(int chunkId, const int16_t *data, int sampleCount, bool isFinal = false);
1635 void saveImage(const String& imageName, const uint8_t *bytes, int byteCount);
1637 void savePixelImage(const String& imageName, const uint8_t *bytes, int width, int height, const String& color = "", char compressMethod = 0);
1639 void savePixelImage16(const String& imageName, const uint16_t *data, int width, int height, const String& options = "", char compressMethod = 0);
1641 void savePixelImageGS(const String& imageName, const uint8_t *data, int width, int height, const String& options = "", char compressMethod = 0);
1645 void stitchImages(const String& imageNames, const String& asImageName);
1647 void alert(const String& message, const String& title = "");
1650 void reorderLayer(DDLayer *pLayer, const String& how);
1652 void deleteLayer(DDLayer *pLayer);
1654 void walkLayers(void (*walker)(DDLayer *));
1655 #ifndef DD_NO_IDLE_CALLBACK
1660 void setIdleCallback(DDIdleCallback idleCallback);
1661#endif
1662#ifndef DD_NO_CONNECT_VERSION_CHANGED_CALLBACK
1666#endif
1670 void logToSerial(const String& logLine, bool force = false);
1672 void log(const String& logLine, boolean isError = false);
1673 public:
1674 #ifndef DD_NO_PASSIVE_CONNECT
1687#endif
1688 public:
1691#ifndef DD_NO_DEBUG_INTERFACE
1692 void debugSetup(DDDebugInterface *debugInterface);
1693#endif
1694 void debugOnly(int i);
1695 private:
1696 void initialize(DDInputOutput* pIO, uint16_t sendBufferSize, long idleTimeout/*, bool enableDoubleClick*/);
1697 //bool canLogToSerial();
1698};
1699
1700#include "_dd_misc.h"
1701
1702#endif
Class for DD "tunnel", with buffering support; created with DumbDisplay::createBasicTunnel()
Definition: dumbdisplay.h:1135
bool readLine(String &buffer)
read a line from buffer, in to the buffer passed in
Definition: dumbdisplay.h:1173
bool timedOut()
check whether EOF caused by timeout or not; note that timeout is only due to check of EOF with DDBuff...
Definition: dumbdisplay.h:1169
bool read(String &fieldId, String &fieldValue)
read a piece of JSON data
void writeLine(const String &data)
write a line
Definition: dumbdisplay.h:1175
bool eof(long timeoutMillis=DD_DEF_TUNNEL_TIMEOUT)
Definition: dumbdisplay.h:1167
virtual void handleInput(const String &data, uint8_t *fbBytes, bool final)
String readLine()
read a line from buffer
DDBufferedTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
for internal use only
int count()
count buffer ready read
Definition: dumbdisplay.h:1163
Base class for debug callback set by calling DumbDisplay::debugSetup()
Definition: dumbdisplay.h:1382
virtual void logConnectionState(DDDebugConnectionState connectionState)
See DDDebugConnectionState.
Definition: dumbdisplay.h:1385
virtual void logSendCommand(int state)
Definition: dumbdisplay.h:1387
Class for DD input/output; you explicitly constructed it, pass in when instantiate DumbDisplay,...
Definition: _dd_io.h:9
Base class for the different layers support by DumbDisplay; created with various layer creation metho...
Definition: dumbdisplay.h:156
void visible(bool visible)
void explicitFeedback(int16_t x=0, int16_t y=0, const String &text="", DDFeedbackType type=CLICK, const String &option="")
void noBorder()
void enableFeedback(const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
void padding(float left, float top, float right, float bottom)
void blend(const String &color, int alpha=255, const String &mode="darken")
void setFeedbackHandler(DDFeedbackHandler handler, const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
void noblend()
void clear()
clear the layer
void disabled(bool disabled=true)
DDFeedbackHandler getFeedbackHandler() const
Definition: dumbdisplay.h:272
void transparent(bool transparent)
DDFeedbackManager * getFeedbackManager() const
Definition: dumbdisplay.h:270
void noMargin()
void opacity(int opacity)
void noPadding()
void backgroundColor(const String &color, int opacity=100)
const DDFeedback * getFeedback()
void alpha(int alpha)
void border(float size, const String &color, const String &shape="flat", float extraSize=0)
void flash()
normally used for "feedback" – flash the default way (layer + border)
void margin(float left, float top, float right, float bottom)
void debugOnly(int i)
for debug use
void margin(float size)
void noBackgroundColor()
void disableFeedback()
disable "feedback"
void flashArea(int x, int y)
normally used for "feedback" – flash the area (x, y) where the layer is clicked
void padding(float size)
Helper class for constructing "tunnel" endpoint, if the endpoint is not a simple URL....
Definition: dumbdisplay.h:1001
void resetParams()
reset params (to the endpoint query string)
Definition: dumbdisplay.h:1026
void resetSoundAttachment(const String &soundName)
Definition: dumbdisplay.h:1014
void addParam(const String &param)
add param (to the endpoint query string)
Definition: dumbdisplay.h:1030
void resetHeaders()
reset headers
Definition: dumbdisplay.h:1022
void addHeader(const String &headerKey, const String &headerValue)
add header to the request
Definition: dumbdisplay.h:1049
void resetEndpoint(const String &endPoint)
reset the endpoint
Definition: dumbdisplay.h:1009
void addNamedParam(const String &paramName, const String &paramValue)
add named param (to the endpoint query string)
Definition: dumbdisplay.h:1045
Base class for DD "tunnel".
Definition: dumbdisplay.h:1074
void reconnectToEndpoint(const DDTunnelEndpoint endpoint)
reconnect to specified endpoint. See DDTunnelEndpoint.
Definition: dumbdisplay.h:1095
void reconnectToSetParams(const String &endPoint, const String &params)
Definition: dumbdisplay.h:1089
DDTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint)
for internal use only
The core class for DumbDisplay; everything starts here. The most important argument to DumbDisplay is...
Definition: dumbdisplay.h:1413
int cacheSoundChunked8(const String &soundName, int sampleRate, int numChannels=1)
int getConnectVersion() const
void debugSetup(DDDebugInterface *debugInterface)
BasicDDTunnel * createGeneralServiceTunnel()
ObjectDetectDemoServiceDDTunnel * createObjectDetectDemoServiceTunnel(int scaleToWidth=0, int scaleToHeight=0, int maxNumObjs=1)
void backgroundColor(const String &color)
PlotterDDLayer * createFixedRatePlotterLayer(int width, int height, int pixelsPerScale=5)
void savePixelImage16(const String &imageName, const uint16_t *data, int width, int height, const String &options="", char compressMethod=0)
save 16-bit "pixel" image (i.e. 565 RGB image) with the given image data
void connect()
void saveCachedSoundAsH(const String &soundName)
void stitchImages(const String &imageNames, const String &asImageName)
bool canPrintToSerial()
check if it is safe to print to Serial
BasicDDTunnel * createDateTimeServiceTunnel()
GraphicalDDLayer * createGraphicalLayer(int width, int height)
SimpleToolDDTunnel * createImageDownloadTunnel(const String &endPoint, const String &imageName, boolean redownload=true)
TurtleDDLayer * createTurtleLayer(int width, int height)
create a Turtle-like layer
bool connectPassive(DDConnectPassiveStatus *pStatus=NULL)
void recordLayerCommands()
void saveCachedSound(const String &soundName)
save the cached sound
void setConnectVersionChangedCallback(DDConnectVersionChangedCallback connectVersionChangedCallback)
void setIdleCallback(DDIdleCallback idleCallback)
int cacheSoundChunked16(const String &soundName, int sampleRate, int numChannels=1)
LcdDDLayer * createLcdLayer(int colCount=16, int rowCount=2, int charHeight=0, const String &fontName="")
create a LCD layer
TerminalDDLayer * createTerminalLayer(int width, int height)
int saveSoundChunked16(const String &soundName, int sampleRate, int numChannels=1)
int streamSound8(int sampleRate, int numChannels=1)
stream sound 8-bit sample (for playing sound)
void sendNoOp()
send "no-op" command
void configAutoPin(const String &layoutSpec=DD_AP_VERT, bool autoShowHideLayers=false)
int streamSound16(int sampleRate, int numChannels=1)
stream sound 16-bit sample (for playing sound)
void deleteTunnel(DDTunnel *pTunnel)
if finished using a "tunnel", delete it to release resource
void pinLayer(DDLayer *pLayer, int uLeft, int uTop, int uWidth, int uHeight, const String &align="")
WebViewDDLayer * createWebViewLayer(int width, int height, const String &jsObjectName="DD")
MbDDLayer * createMicrobitLayer(int width=5, int height=5)
create a Microbit-like layer
void savePixelImage(const String &imageName, const uint8_t *bytes, int width, int height, const String &color="", char compressMethod=0)
save single-bit "pixel" image (i.e. B&W image) with the given image data
void addRemainingAutoPinConfig(const String &remainingLayoutSpec)
add the "auto pin" config for layers not included in "auto pin" set by configAutoPin()
int saveSoundChunked8(const String &soundName, int sampleRate, int numChannels=1)
void log(const String &logLine, boolean isError=false)
like to Serial (if safe to do so); and if connected, will log as comment to DD as well
void cacheSound16(const String &soundName, const int16_t *data, int sampleCount, int sampleRate, int numChannels=1)
cache 16-bit sound with the given sound samples
void masterReset()
JsonDDTunnel * createJsonTunnel(const String &endPoint, bool connectNow=true, int8_t bufferSize=DD_TUNNEL_DEF_BUFFER_SIZE)
void recordLayerSetupCommands()
basically, functions the same as recordLayerCommands()
void alert(const String &message, const String &title="")
pop up a dialog to alert
SevenSegmentRowDDLayer * create7SegmentRowLayer(int digitCount=1)
JoystickDDLayer * createJoystickLayer(int maxStickValue=1023, const String &directions="", float stickSizeFactor=1.0)
void loadLayerCommands(const String &id)
void cacheSound8(const String &soundName, const int8_t *bytes, int sampleCount, int sampleRate, int numChannels=1)
cache 8-bit sound with the given sound samples
void playSound(const String &soundName)
make DD app play the sound of the given sound file
void deleteLayer(DDLayer *pLayer)
if layer is no longer used; delete it to release resources
void reorderLayer(DDLayer *pLayer, const String &how)
DumbDisplayWindowDDLayer * createDumbDisplayWindowLayer(int width, int height)
void playbackLayerSetupCommands(const String &layerSetupPersistId)
void setFeedbackSingleClickOnly(bool singleClickOnly=true)
void savePixelImageGS(const String &imageName, const uint8_t *data, int width, int height, const String &options="", char compressMethod=0)
save grayscale "pixel" image with the given image data
void saveLayerCommands(const String &id, bool persist=false, bool stopAfterSave=false)
int getCompatibilityVersion() const
void writeComment(const String &comment)
write out a comment to DD app
void playbackLayerCommands()
playback recorded commands (unfreeze the display)
JsonDDTunnel * createFilteredJsonTunnel(const String &endPoint, const String &fileNames, bool connectNow=true, int8_t bufferSize=DD_TUNNEL_DEF_BUFFER_SIZE)
void saveSound16(const String &soundName, const int16_t *data, int sampleCount, int sampleRate, int numChannels=1)
save 16-bit sound with the given sound samples
void saveImage(const String &imageName, const uint8_t *bytes, int byteCount)
svae image with the given image data
BasicDDTunnel * createBasicTunnel(const String &endPoint, bool connectNow=true, int8_t bufferSize=DD_TUNNEL_DEF_BUFFER_SIZE)
void capture(const String &imageFileName, int width, int height)
void logToSerial(const String &logLine, bool force=false)
log line to Serial; if it is not safe to output to Serial, will write comment with DumbDisplay::write...
void stopRecordLayerCommands(const String &saveId="", bool persistSave=false)
void walkLayers(void(*walker)(DDLayer *))
loop through all the existing layers calling the function passed in
TomTomMapDDLayer * createTomTomMapLayer(const String &mapKey, int width, int height)
LedGridDDLayer * createLedGridLayer(int colCount=1, int rowCount=1, int subColCount=1, int subRowCount=1)
create a LED-grid layer
void saveSound8(const String &soundName, const int8_t *bytes, int sampleCount, int sampleRate, int numChannels=1)
save 8-bit sound with the given sound samples
bool connected() const
void sendSoundChunk8(int chunkId, const int8_t *bytes, int sampleCount, bool isFinal=false)
send 8-bit sound data chunk for saving/caching after calling saveSoundChunked8() or cacheSoundChunked...
void sendSoundChunk16(int chunkId, const int16_t *data, int sampleCount, bool isFinal=false)
send 16-bit sound data chunk for saving/caching after calling saveSoundChunked16() or cacheSoundChunk...
void pinAutoPinLayers(const String &layoutSpec, int uLeft, int uTop, int uWidth, int uHeight, const String &align="")
void configPinFrame(int xUnitCount=100, int yUnitCount=100, bool autoShowHideLayers=false)
SelectionDDLayer * createSelectionLayer(int colCount=16, int rowCount=2, int horiSelectionCount=1, int vertSelectionCount=1, int charHeight=0, const String &fontName="", bool canDrawDots=true, float selectionBorderSizeCharHeightFactor=0.3)
create a "selection" layer
PlotterDDLayer * createPlotterLayer(int width, int height, int pixelsPerSecond=10)
create a plotter layer
void tone(uint32_t freq, uint32_t duration)
make DD app sound a tone
GpsServiceDDTunnel * createGpsServiceTunnel()
Definition: dumbdisplay.h:989
DumbDisplayWindowDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:992
Class for GPS service "tunnel".
Definition: dumbdisplay.h:1237
GpsServiceDDTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
Definition: dumbdisplay.h:1240
void reconnectForLocation(int repeat=-1)
Class for graphical LCD layer; created with DumbDisplay::createGraphicalLayer()
Definition: dumbdisplay.h:625
void drawImageFileFit(const String &imageFileName, const String &options)
another version of drawImageFileFit() with options
Definition: dumbdisplay.h:806
void setTextSize(int size)
set text size
void drawCircle(int x, int y, int r, const String &color="", bool filled=false)
void println(const String &text="")
print text with line feed
void cachePixelImage16(const String &imageName, const uint16_t *data, int width, int height, const String &options="", char compressMethod=0)
cache 16-bit "pixel" image (i.e. 565 RGB image); not saved
void print(const String &text)
print text
void noFillColor()
set no fill color (for shape)
void loadImageFile(const String &imageFileName, int w=0, int h=0, const String &asImageFileName="")
void setTextWrap(bool wrapOn)
set whether "print" will auto wrap or not
void forward(int distance)
move forward (relative to cursor)
void saveCachedImageFiles(const String &stitchAsImageName="")
void penSize(int size)
set pen size
void setHeading(int angle)
set heading angle (degree)
void circle(int radius, bool centered=false)
draw a circle; centered or not
void setTextFont()
reset text font and size
void setTextFont(const String &fontName, int textSize)
Definition: dumbdisplay.h:649
void isoscelesTriangle(int side, int angle)
draw isosceles triangle; given size and angle
void drawRect(int x, int y, int w, int h, const String &color="", bool filled=false)
void setTextColor(const String &color, const String &bgColor="")
void drawRoundRect(int x, int y, int w, int h, int r, const String &color="", bool filled=false)
void fillCircle(int x, int y, int r, const String &color="")
Definition: dumbdisplay.h:688
void drawOval(int x, int y, int w, int h, const String &color="", bool filled=false)
void arc(int width, int height, int startAngle, int sweepAngle, bool centered=false)
draw arc; centered or not
void fillRect(int x, int y, int w, int h, const String &color="")
Definition: dumbdisplay.h:704
void cachePixelImageGS(const String &imageName, const uint8_t *data, int width, int height, const String &options="", char compressMethod=0)
cache grayscale "pixel" image; as if image saved and loaded
void rightTurn(int angle)
turn right
void setCursor(int x, int y)
set cursor to position
void saveCachedImageFile(const String &imageName, const String &asImageName="")
void fillScreen(const String &color)
void drawStr(int x, int y, const String &string, const String &color="", const String &bgColor="", int size=0)
void drawImageFile(const String &imageFileName, const String &options)
another version of drawImageFile() with options
Definition: dumbdisplay.h:793
GraphicalDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:628
void unloadImageFile(const String &imageFileName)
unload image file from cache
void unloadAllImageFiles()
unload all image files from cache
void fillArc(int x, int y, int w, int h, int startAngle, int sweepAngle, bool useCenter, const String &color="")
Definition: dumbdisplay.h:728
void write(const String &text, bool draw=false)
void cachePixelImage(const String &imageName, const uint8_t *bytes, int width, int height, const String &color="", char compressionMethod=0)
cache single-bit "pixel" image (i.e. B&W image); not saved
void drawChar(int x, int y, char c, const String &color="", const String &bgColor="", int size=0)
void penColor(const String &color)
void saveCachedImageFileAsync(const String &imageName, const String &asImageName="")
void polygon(int side, int vertexCount)
draw polygon given side and vertex count
void centeredPolygon(int radius, int vertexCount, bool inside=false)
void drawPixel(int x, int y, const String &color="")
void fillColor(const String &color)
void drawTextLine(const String &text, int y, const String &align="L", const String &color="", const String &bgColor="", int size=0)
void drawImageFileFit(const String &imageFileName, int x=0, int y=0, int w=0, int h=0, const String &options="")
void drawImageFileScaled(const String &imageFileName, int w, int h, const String &options="")
Definition: dumbdisplay.h:798
void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const String &color="", bool filled=false)
void setTextFont(const String &fontName)
void drawLine(int x1, int y1, int x2, int y2, const String &color="")
void leftTurn(int angle)
turn left
void triangle(int side1, int angle, int side2)
draw triangle (SAS)
void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const String &color="")
Definition: dumbdisplay.h:696
void drawImageFile(const String &imageFileName, int x=0, int y=0, int w=0, int h=0, const String &options="")
void cacheImage(const String &imageName, const uint8_t *bytes, int byteCount, char compressionMethod=0)
cache image; not saved
void moveCursorBy(int byX, int byY)
move cursor by some amount
void drawArc(int x, int y, int w, int h, int startAngle, int sweepAngle, bool useCenter, const String &color="", bool filled=false)
void fillRoundRect(int x, int y, int w, int h, int r, const String &color="")
Definition: dumbdisplay.h:712
void oval(int width, int height, bool centered=false)
draw an oval; centered or not
void setRotation(int8_t rotationType)
rotate the screen
void loadImageFileScaled(const String &imageFileName, int w, int h, const String &asImageFileName)
Definition: dumbdisplay.h:780
void rectangle(int width, int height, bool centered=false)
draw rectangle; centered or not
void fillOval(int x, int y, int w, int h, const String &color="")
Definition: dumbdisplay.h:720
Definition: dumbdisplay.h:1306
ImageRetrieverDDTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
Definition: dumbdisplay.h:1309
bool readPixelImage16(DDPixelImage16 &pixelImage16)
get 16-bit image data retrieved with reconnectForPixelImage16
bool readJpegImage(DDJpegImage &jpeg)
get JPEG image data retrieved with reconnectForJpegImage
bool readPixelImage(DDPixelImage &pixelImage)
get single-bit image data retrieved with reconnectForPixelImage
bool readPixelImageGS16(DDPixelImage16 &pixelImage16)
get grayscale 16-bit image data retrieved with reconnectForPixelImageGS
void reconnectForJpegImage(const String &imageName, int width, int height, int quality=100, bool fit=false)
void reconnectForPixelImage16(const String &imageName, int width, int height, bool fit=false, bool grayscale=false)
void reconnectForPixelImage(const String &imageName, int width, int height, bool fit=false)
Class for virtual joystick layer; created with DumbDisplay::createJoystickLayer()
Definition: dumbdisplay.h:880
void moveToPos(int16_t x, int16_t y, bool sendFeedback=false)
void colors(const String &stickColor, const String &stickOutlineColor, const String &socketColor="", const String &socketOutlineColor="")
set the colors of the stick UI
void valueRange(int16_t minValue, int16_t maxValue, int valueStep=1, bool sendFeedback=false)
void snappy(bool snappy=true)
set 'snappy' makes stick snaps to closest value when moved
JoystickDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:883
void autoRecenter(bool autoRecenter=true)
void moveToCenter(bool sendFeedback=false)
void showValue(bool show=true, const String &color="")
show value on top of the stick
Definition: dumbdisplay.h:1340
JsonDDTunnelMultiplexer(JsonDDTunnel **tunnels, int8_t tunnelCount)
int read(String &fieldId, String &fieldValue)
Class for LCD layer; created with DumbDisplay::createLcdLayer()
Definition: dumbdisplay.h:539
void cursor()
show cursor
void noBgPixelColor()
set no "background" (off) pixel color
void bgPixelColor(const String &color)
void setCursor(int x, int y)
void print(const String &text)
print text, moving cursor
void pixelColor(const String &color)
void autoscroll()
enable auto-scroll
void writeCenteredLine(const String &text, int y=0)
write text as a line, with align "centered"
void writeRightAlignedLine(const String &text, int y=0)
write text as a right-aligned line
void noAutoscroll()
disable auto-scroll
LcdDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:542
void home()
move cursor to home
void noCursor()
hide cursor
void writeLine(const String &text, int y=0, const String &align="L")
Class for LED grid layer; created with DumbDisplay::createLedGridLayer()
Definition: dumbdisplay.h:480
LedGridDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:483
void onColor(const String &color)
void turnOff(int x=0, int y=0)
turn off LED @ (x, y)
void toggle(int x=0, int y=0)
toggle LED @ (x, y)
void bitwise3(unsigned int bits_0, unsigned int bits_1, unsigned int bits_2, int y=0, bool reverse=false)
void verticalBarEx(int count, int startY=0, const String &color="")
void verticalBar(int count, bool bottomToTop=true)
void bitwise(unsigned int bits, int y=0, bool reverse=false)
void bitwise4(unsigned int bits_0, unsigned int bits_1, unsigned int bits_2, unsigned int bits_3, int y=0, bool reverse=false)
void horizontalBar(int count, bool rightToLeft=false)
void offColor(const String &color)
void turnOn(int x=0, int y=0)
turn on LED @ (x, y)
void noOffColor()
set no LED off color
void turnOnEx(int x=0, int y=0, const String &onColor="")
void horizontalBarEx(int count, int startX=0, const String &color="")
void bitwise2(unsigned int bits_0, unsigned int bits_1, int y=0, bool reverse=false)
Class for Microbit-like DD layer; created with DumbDisplay::createMicrobitLayer()
Definition: dumbdisplay.h:376
void plot(int x, int y)
turn on LED @ (x, y)
void showString(const String &str)
show string; scroll if more than a single character; but you get to control timing by using delay()
void unplot(int x, int y)
turn off LED @ (x, y)
void showLeds(const String &ledPattern)
MbDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:379
void showIcon(MbIcon icon)
show Microbit icon
void showNumber(int num)
show number; scroll if more than a single digit; but you get to control timing by using delay()
void ledColor(const String &color)
void toggle(int x, int y)
toggle LED @ (x, y) on / off
void showArrow(MbArrow arrow)
show Microbit arrow
Definition: dumbdisplay.h:365
Definition: dumbdisplay.h:295
void pushLevelAndSwitchTo(const String &switchTolevelId, bool addIfMissing=true)
void moveLevelAnchorBy(float byX, float byY, long reachInMillis=0)
move the level anchor
void switchLevel(const String &levelId, bool addIfMissing=true)
void setLevelNoBackground()
set that the current level uses no background image
void popLevel()
pop a level from the level stack and make it the current level
void reorderLevel(const String &levelId, const String &how)
void stopAnimateLevelBackground(bool reset=true)
void addLevel(const String &levelId, bool switchToIt)
another version of addLevel()
Definition: dumbdisplay.h:303
void setLevelAnchor(float x, float y, long reachInMillis=0)
set the anchor of the level; note that level anchor is the top-left corner of the level "opening"
void levelOpacity(int opacity)
void registerLevelBackground(const String &backgroundId, const String &backgroundImageName, const String &drawBackgroundOptions="")
void deleteLevel(const String &levelId)
delete the specified level
void animateLevelBackground(int fps, bool reset=true, const String &options="")
void pushLevel()
push the current level onto the level stack, to be pop with popLevel()
void levelTransparent(bool transparent)
set whether level is transparent
void setLevelBackground(const String &backgroundId, const String &backgroundImageName="", const String &drawBackgroundOptions="")
void exportLevelsAsImage(const String &imageFileName, bool cacheItNotSave=false)
export (and save) the levels as an image (without the decorations of the layer like border)
void addLevel(const String &levelId, float width=0, float height=0, bool switchToIt=false)
Class for "object detection demo" service "tunnel".
Definition: dumbdisplay.h:1259
ObjectDetectDemoServiceDDTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
Definition: dumbdisplay.h:1262
Class for plotter layer; created with DumbDisplay::createPlotterLayer() or DumbDisplay::createFixedRa...
Definition: dumbdisplay.h:911
void label(const String &key, const String &lab)
void set(float value)
set value with empty key
Definition: dumbdisplay.h:924
void set(const String &key, float value)
PlotterDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:914
Class for "selection" layer of multiple LCD-like "selection" units; created with DumbDisplay::createS...
Definition: dumbdisplay.h:585
void unselectedTextRightAligned(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0)
set a "selection" unit right-aligned text (of y-th row) when unselected (it defaults to the same text...
void textCentered(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0)
set a "selection" unit centered text (of y-th row)
void deselectAll()
deselect all "selection" units
void pixelColor(const String &color)
void selected(bool selected, int horiSelectionIdx=0, int vertSelectionIdx=0, bool reverseTheOthers=false)
set a "selection" unit selected or not
void unselectedTextCentered(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0)
set a "selection" unit centered text (of y-th row) when unselected (it defaults to the same text as s...
void text(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0, const String &align="L")
void selectAll()
select all "selection" units
void select(int horiSelectionIdx=0, int vertSelectionIdx=0, bool deselectTheOthers=true)
select a "selection" unit
SelectionDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:588
void textRightAligned(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0)
set a "selection" unit right-aligned text (of y-th row)
void highlightBorder(bool forSelected, const String &borderColor="", const String &borderShape="")
void unselectedText(const String &text, int y=0, int horiSelectionIdx=0, int vertSelectionIdx=0, const String &align="L")
void deselect(int horiSelectionIdx=0, int vertSelectionIdx=0, bool selectTheOthers=false)
deselect a "selection" unit
Class for 7-segment row layer; created with DumbDisplay::create7SegmentRowLayer()
Definition: dumbdisplay.h:841
void turnOn(const String &segments, int digitIdx=0)
void showFormatted(const String &formatted, bool completeReplace=true, int startIdx=0)
void resetSegmentOffColor(const String &color)
SevenSegmentRowDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:844
void setOn(const String &segments="", int digitIdx=0)
void showHexNumber(int16_t number)
show HEX number
void showNumber(float number, const String &padding=" ")
show number (can be float)
void segmentColor(const String &color)
void showDigit(int digit, int digitIdx=0)
show a digit
void resetSegmentOffNoColor()
reset segment off color to no color; note that this will clear all digits
void turnOff(const String &segments, int digitIdx=0)
Class for basic tool "tunnel".
Definition: dumbdisplay.h:1216
SimpleToolDDTunnel(const String &type, int8_t tunnelId, const String &params, const String &endPoint, int bufferSize)
Definition: dumbdisplay.h:1219
Class for a terminal-like "device dependent view" layer, for logging etc; created with DumbDisplay::c...
Definition: dumbdisplay.h:945
TerminalDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:948
Definition: dumbdisplay.h:933
TomTomMapDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:936
Class for Turtle-like DD layer; created with DumbDisplay::createTurtleLayer()
Definition: dumbdisplay.h:411
void penColor(const String &color)
void arc(int width, int height, int startAngle, int sweepAngle, bool centered=false)
draw arc; centered or not
void isoscelesTriangle(int side, int angle)
draw isosceles triangle; given size and angle
void penFilled(bool filled)
set pen filled or not; if filled, shape drawn will be filled
void goBy(int byX, int byY, bool withPen=true)
go by (byX, byY); with pen or not
void polygon(int side, int vertexCount)
draw polygon given side and vertex count
void goTo(int x, int y, bool withPen=true)
go to (x, y); with pen or not
void forward(int distance, bool withPen=true)
forward; with pen or not
void centeredPolygon(int radius, int vertexCount, bool inside=false)
void triangle(int side1, int angle, int side2)
draw triangle (SAS)
void oval(int width, int height, bool centered=false)
draw oval; centered or not
void circle(int radius, bool centered=false)
draw circle; centered or not
void dot(int size, const String &color)
draw a dot
void setTextFont(const String &fontName="", int textSize=0)
void write(const String &text, bool draw=false)
write text; draw means draw the text (honor heading)
void penUp()
pen up
TurtleDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:414
void home(bool withPen=true)
go home (0, 0); with pen or not
void leftTurn(int angle)
left turn
void setTextSize(int size)
set text size
void penDown()
pen down
void noFillColor()
set no fill color
void rightTurn(int angle)
right turn
void penSize(int size)
set pen size
void backward(int distance, bool withPen=true)
backward; with pen or not
void setHeading(int angle)
set heading angle (degree)
void fillColor(const String &color)
void rectangle(int width, int height, bool centered=false)
draw rectangle; centered or not
Definition: dumbdisplay.h:975
WebViewDDLayer(int8_t layerId)
for internal use only
Definition: dumbdisplay.h:978
Struct for the status values of calling DumbDisplay::connectPassive()
Definition: dumbdisplay.h:1395
bool reconnecting
reconnecting: when connected; detected reconnecting (after lost of connection)
Definition: dumbdisplay.h:1401
bool connecting
connecting: when not connected; starting to establish connection by sending hand-shake messages
Definition: dumbdisplay.h:1399
bool connected
connection made or not – same as the return value of DumbDisplay::connectPassive()
Definition: dumbdisplay.h:1397
Type signature for callback function that will be called when connect version (counting up) changed....
See DDDebugInterface.
Type signature for "feedback" handler. See DDLayer::setFeedbackHandler()
The struct that captures info about "feedback". See DDLayer::enableFeedback()
Definition: _dd_feedback.h:29
The enum indicating the type of "feedback". See DDFeedback.
Type signature for callback function that will be called when idle. See DumbDisplay::setIdleCallback(...
See DDIdleCallback.
Definition: dumbdisplay.h:1271
Definition: dumbdisplay.h:1297
Output struct of GpsServiceDDTunnel.
Definition: dumbdisplay.h:1232
Output struct of ObjectDetectDemoServiceDDTunnel.
Definition: dumbdisplay.h:1251
Base class for DD objects.
Definition: dumbdisplay.h:140
int8_t objectType
object type – DD_OBJECT_TYPE_LAYER or DD_OBJECT_TYPE_TUNNEL
Definition: dumbdisplay.h:142
String customData
custom data
Definition: dumbdisplay.h:147
Definition: dumbdisplay.h:1286
Definition: dumbdisplay.h:1283