-
Notifications
You must be signed in to change notification settings - Fork 12
/
static.h
939 lines (843 loc) · 31.9 KB
/
static.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
const String appName = "WiTcontroller";
const String appVersion = "v1.73";
#ifndef DEVICE_NAME
#define DEVICE_NAME "WiTcontroller"
#endif
#ifndef MENU_TEXT_MENU
#define MENU_TEXT_MENU "* Menu # Key Defs"
#endif
#ifndef MENU_TEXT_MENU_HASH_IS_FUNCTIONS
#define MENU_TEXT_MENU_HASH_IS_FUNCTIONS "* Menu # Fn"
#endif
#ifndef MENU_TEXT_FINISH
#define MENU_TEXT_FINISH " # Finish"
#endif
#ifndef MENU_TEXT_CANCEL
#define MENU_TEXT_CANCEL "* Cancel"
#endif
#ifndef MENU_TEXT_SHOW_DIRECT
#define MENU_TEXT_SHOW_DIRECT " # Show Direct"
#endif
#ifndef MENU_TEXT_ROSTER
#define MENU_TEXT_ROSTER "* Cancel 0-9 #Pg"
#endif
#ifndef MENU_TEXT_TURNOUT_LIST
#define MENU_TEXT_TURNOUT_LIST "* Cancel 0-9 #Pg"
#endif
#ifndef MENU_TEXT_ROUTE_LIST
#define MENU_TEXT_ROUTE_LIST "* Cancel 0-9 #Pg"
#endif
#ifndef MENU_TEXT_FUNCTION_LIST
#define MENU_TEXT_FUNCTION_LIST "* Cancel 0-9 #Pg"
#endif
#ifndef MENU_TEXT_SELECT_WIT_SERVICE
#define MENU_TEXT_SELECT_WIT_SERVICE "0-4 # Entry E.btn OFF"
#endif
#ifndef MENU_TEXT_SELECT_WIT_ENTRY
#define MENU_TEXT_SELECT_WIT_ENTRY "0-9 * Back # Go E.btn OFF"
#endif
#ifndef MENU_TEXT_SELECT_SSIDS
#define MENU_TEXT_SELECT_SSIDS "0-9 # Search E.btn OFF"
#endif
#ifndef MENU_TEXT_SELECT_SSIDS_FROM_FOUND
#define MENU_TEXT_SELECT_SSIDS_FROM_FOUND "0-4 9 List # Pg E.btn OFF"
#endif
#ifndef MENU_TEXT_ENTER_SSID_PASSWORD
#define MENU_TEXT_ENTER_SSID_PASSWORD "E Chrs E.btn Slct # Go * Bck"
#endif
const String menu_text[14] = {
MENU_TEXT_MENU,
MENU_TEXT_MENU_HASH_IS_FUNCTIONS,
MENU_TEXT_FINISH,
MENU_TEXT_CANCEL,
MENU_TEXT_SHOW_DIRECT,
MENU_TEXT_ROSTER,
MENU_TEXT_TURNOUT_LIST,
MENU_TEXT_ROUTE_LIST,
MENU_TEXT_FUNCTION_LIST,
MENU_TEXT_SELECT_WIT_SERVICE,
MENU_TEXT_SELECT_WIT_ENTRY,
MENU_TEXT_SELECT_SSIDS,
MENU_TEXT_SELECT_SSIDS_FROM_FOUND,
MENU_TEXT_ENTER_SSID_PASSWORD
};
const int menu_menu = 0;
const int menu_menu_hash_is_functions = 1;
const int menu_finish = 2;
const int menu_cancel = 3;
const int menu_show_direct = 4;
const int menu_roster = 5;
const int menu_turnout_list = 6;
const int menu_route_list = 7;
const int menu_function_list = 8;
const int menu_select_wit_service = 9;
const int menu_select_wit_entry = 10;
const int menu_select_ssids = 11;
const int menu_select_ssids_from_found = 12;
const int menu_enter_ssid_password = 13;
const int last_oled_screen_speed = 0;
const int last_oled_screen_roster = 1;
const int last_oled_screen_turnout_list = 2;
const int last_oled_screen_route_list = 3;
const int last_oled_screen_function_list = 4;
const int last_oled_screen_menu = 5;
const int last_oled_screen_extra_submenu = 6;
const int last_oled_screen_all_locos = 7;
const int last_oled_screen_edit_consist = 8;
const int last_oled_screen_direct_commands = 9;
typedef enum ShowBattery {
NONE = 0,
ICON_ONLY = 1,
ICON_AND_PERCENT = 2
} ShowBattery;
#ifndef DIRECT_COMMAND_LIST
#define DIRECT_COMMAND_LIST "Direct Commands"
#endif
#ifndef DIRECTION_FORWARD_TEXT
#define DIRECTION_FORWARD_TEXT "Fwd"
#endif
#ifndef DIRECTION_REVERSE_TEXT
#define DIRECTION_REVERSE_TEXT "Rev"
#endif
#ifndef DIRECTION_FORWARD_TEXT_SHORT
#define DIRECTION_FORWARD_TEXT_SHORT ">"
#endif
#ifndef DIRECTION_REVERSE_TEXT_SHORT
#define DIRECTION_REVERSE_TEXT_SHORT "<"
#endif
#ifndef DIRECTION_REVERSE_INDICATOR
#define DIRECTION_REVERSE_INDICATOR "'"
#endif
// const String function_states = "fn ";
#ifndef MSG_START
#define MSG_START "Start"
#endif
#ifndef MSG_BROWSING_FOR_SERVICE
#define MSG_BROWSING_FOR_SERVICE "Browsing for WiT services"
#endif
#ifndef MSG_BROWSING_FOR_SSIDS
#define MSG_BROWSING_FOR_SSIDS "Browsing for SSIDs"
#endif
#ifndef MSG_NO_SSIDS_FOUND
#define MSG_NO_SSIDS_FOUND "No SSIDs found"
#endif
#ifndef MSG_SSIDS_LISTED
#define MSG_SSIDS_LISTED " SSIDs listed"
#endif
#ifndef MSG_SSIDS_FOUND
#define MSG_SSIDS_FOUND " SSIDs found"
#endif
#ifndef MSG_BOUNJOUR_SETUP_FAILED
#define MSG_BOUNJOUR_SETUP_FAILED "Unable to setup Listener"
#endif
#ifndef MSG_NO_SERVICES_FOUND
#define MSG_NO_SERVICES_FOUND "No services found"
#endif
#ifndef MSG_NO_SERVICES_FOUND_ENTRY_REQUIRED
#define MSG_NO_SERVICES_FOUND_ENTRY_REQUIRED "Enter witServer IP:Port"
#endif
#ifndef MSG_SERVICES_FOUND
#define MSG_SERVICES_FOUND " Service(s) found"
#endif
#ifndef MSG_TRYING_TO_CONNECT
#define MSG_TRYING_TO_CONNECT "Trying to Connect"
#endif
#ifndef MSG_CONNECTED
#define MSG_CONNECTED " Connected"
#endif
#ifndef MSG_CONNECTING
#define MSG_CONNECTING " Connecting..."
#endif
#ifndef MSG_ADDRESS_LABEL
#define MSG_ADDRESS_LABEL "IP address: "
#endif
#ifndef MSG_CONNECTION_FAILED
#define MSG_CONNECTION_FAILED "Connection failed"
#endif
#ifndef MSG_DISCONNECTED
#define MSG_DISCONNECTED "Disconnected"
#endif
#ifndef MSG_AUTO_SLEEP
#define MSG_AUTO_SLEEP "Waited too long for Select"
#endif
#ifndef MSG_BATTERY_SLEEP
#define MSG_BATTERY_SLEEP "Battery critically low"
#endif
#ifndef MSG_START_SLEEP
#define MSG_START_SLEEP "Shutting Down. E.btn ON"
#endif
#ifndef MSG_THROTTLE_NUMBER
#define MSG_THROTTLE_NUMBER " Throttle #"
#endif
#ifndef MSG_NO_LOCO_SELECTED
#define MSG_NO_LOCO_SELECTED " No Loco selected"
#endif
#ifndef MSG_ENTER_PASSWORD
#define MSG_ENTER_PASSWORD "Enter Password"
#endif
#ifndef MSG_GUESSED_EX_CS_WIT_SERVER
#define MSG_GUESSED_EX_CS_WIT_SERVER "'Guessed' EX-CS WiT server"
#endif
#ifndef MSG_BYPASS_WIT_SERVER_SEARCH
#define MSG_BYPASS_WIT_SERVER_SEARCH "Bypass WiT server search"
#endif
#ifndef MSG_NO_FUNCTIONS
#define MSG_NO_FUNCTIONS "Function List - No Functions"
#endif
#ifndef MSG_HEARTBEAT_CHECK_ENABLED
#define MSG_HEARTBEAT_CHECK_ENABLED "Heartbeat Check Enabled"
#endif
#ifndef MSG_HEARTBEAT_CHECK_DISABLED
#define MSG_HEARTBEAT_CHECK_DISABLED "Heartbeat Check Disabled"
#endif
const String label_track_power = "TRK";
const int glyph_heartbeat_off = 0x00b7;
const int glyph_track_power = 0x00eb;
const int glyph_speed_step = 0x00d6;
// const int glyph_direction_forward = 0x0070;
// const int glyph_direction_reverse = 0x006d;
#define SLEEP_REASON_COMMAND 0
#define SLEEP_REASON_INACTIVITY 1
#define SLEEP_REASON_BATTERY 2
#define KEYPAD_USE_OPERATION 0
#define KEYPAD_USE_SELECT_SSID 1
#define KEYPAD_USE_SELECT_SSID_FROM_FOUND 2
#define KEYPAD_USE_SELECT_WITHROTTLE_SERVER 3
#define KEYPAD_USE_ENTER_WITHROTTLE_SERVER 4
#define KEYPAD_USE_SELECT_ROSTER 5
#define KEYPAD_USE_SELECT_TURNOUTS_THROW 6
#define KEYPAD_USE_SELECT_TURNOUTS_CLOSE 7
#define KEYPAD_USE_SELECT_ROUTES 8
#define KEYPAD_USE_SELECT_FUNCTION 9
#define KEYPAD_USE_ENTER_SSID_PASSWORD 10
#define KEYPAD_USE_EDIT_CONSIST 11
#define ENCODER_USE_OPERATION 0
#define ENCODER_USE_SSID_PASSWORD 1
// used for both wit and ssid
#define CONNECTION_STATE_DISCONNECTED 0
#define CONNECTION_STATE_CONNECTED 1
#define CONNECTION_STATE_SELECTION_REQUIRED 2
#define CONNECTION_STATE_ENTRY_REQUIRED 3
#define CONNECTION_STATE_SELECTED 4
#define CONNECTION_STATE_PASSWORD_ENTRY 5
#define CONNECTION_STATE_ENTERED 6
#define SSID_CONNECTION_SOURCE_LIST 0
#define SSID_CONNECTION_SOURCE_BROWSE 1
#define CMD_FUNCTION 0
#define MAX_LOCOS 10 // maximum number of locos that can be added to the consist
#define MAX_FUNCTIONS 32
#ifndef MENU_ITEM_TEXT_TITLE_FUNCTION
#define MENU_ITEM_TEXT_TITLE_FUNCTION "Function"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_ADD_LOCO
#define MENU_ITEM_TEXT_TITLE_ADD_LOCO "Add Loco"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_DROP_LOCO
#define MENU_ITEM_TEXT_TITLE_DROP_LOCO "Drop Loco"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_TOGGLE_DIRECTION
#define MENU_ITEM_TEXT_TITLE_TOGGLE_DIRECTION "Toggle Dir"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_SPEED_STEP_MULTIPLIER
#define MENU_ITEM_TEXT_TITLE_SPEED_STEP_MULTIPLIER "X SpeedStep"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_THROW_POINT
#define MENU_ITEM_TEXT_TITLE_THROW_POINT "Throw Point"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_CLOSE_POINT
#define MENU_ITEM_TEXT_TITLE_CLOSE_POINT "Close Point"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_ROUTE
#define MENU_ITEM_TEXT_TITLE_ROUTE "Route"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_TRACK_POWER
#define MENU_ITEM_TEXT_TITLE_TRACK_POWER "Trk Power"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_EXTRAS
#define MENU_ITEM_TEXT_TITLE_EXTRAS "Extras"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_HEARTBEAT
#define MENU_ITEM_TEXT_TITLE_HEARTBEAT "Heartbeat"
#endif
#ifndef MENU_ITEM_TEXT_TITLE_EDIT_CONSIST
#define MENU_ITEM_TEXT_TITLE_EDIT_CONSIST "Edit Consist Facing"
#endif
#ifndef MENU_ITEM_TEXT_MENU_FUNCTION
#define MENU_ITEM_TEXT_MENU_FUNCTION "no+# Select * Cancel # List"
#endif
#ifndef MENU_ITEM_TEXT_MENU_ADD_LOCO
#define MENU_ITEM_TEXT_MENU_ADD_LOCO "addr+# Add * Cancel # Roster"
#endif
#ifndef MENU_ITEM_TEXT_MENU_DROP_LOCO
#define MENU_ITEM_TEXT_MENU_DROP_LOCO "addr+# One * Cancel # All"
#endif
#ifndef MENU_ITEM_TEXT_MENU_TOGGLE_DIRECTION
#define MENU_ITEM_TEXT_MENU_TOGGLE_DIRECTION "# Toggle "
#endif
#ifndef MENU_ITEM_TEXT_MENU_SPEED_STEP_MULTIPLIER
#define MENU_ITEM_TEXT_MENU_SPEED_STEP_MULTIPLIER "* Cancel # Toggle"
#endif
#ifndef MENU_ITEM_TEXT_MENU_THROW_POINT
#define MENU_ITEM_TEXT_MENU_THROW_POINT "no+# Throw * Cancel # List"
#endif
#ifndef MENU_ITEM_TEXT_MENU_CLOSE_POINT
#define MENU_ITEM_TEXT_MENU_CLOSE_POINT "no+# Close * Cancel # List"
#endif
#ifndef MENU_ITEM_TEXT_MENU_ROUTE
#define MENU_ITEM_TEXT_MENU_ROUTE "no+# Select * Cancel # List"
#endif
// #ifndef MENU_ITEM_TEXT_MENU_TRACK_POWER
// #define MENU_ITEM_TEXT_MENU_TRACK_POWER "* Cancel # Toggle"
// #endif
#ifndef MENU_ITEM_TEXT_MENU_EXTRAS
#define MENU_ITEM_TEXT_MENU_EXTRAS "no Select * Cancel "
#endif
#ifndef MENU_ITEM_TEXT_MENU_HEARTBEAT
#define MENU_ITEM_TEXT_MENU_HEARTBEAT "* Close "
#endif
#ifndef MENU_ITEM_TEXT_MENU_EDIT_CONSIST
#define MENU_ITEM_TEXT_MENU_EDIT_CONSIST "no Chng Facing * Close"
#endif
#define MENU_ITEM_TEXT_MENU_NA "" // for items that don't require showing a menu
#ifndef EXTRA_MENU_TEXT_CHAR_FUNCTION_KEY_TOGGLE
#define EXTRA_MENU_TEXT_CHAR_FUNCTION_KEY_TOGGLE "Fnc/Key Tgl"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_EDIT_CONSIST
#define EXTRA_MENU_TEXT_CHAR_EDIT_CONSIST "Edt Consist"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_TBA
#define EXTRA_MENU_TEXT_CHAR_TBA ""
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_HEARTBEAT_TOGGLE
#define EXTRA_MENU_TEXT_CHAR_HEARTBEAT_TOGGLE "Heartbt Tgl"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_INCREASE_MAX_THROTTLES
#define EXTRA_MENU_TEXT_CHAR_INCREASE_MAX_THROTTLES "#Throttles +"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_DECREASE_MAX_THROTTLES
#define EXTRA_MENU_TEXT_CHAR_DECREASE_MAX_THROTTLES "#Throttles -"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_DISCONNECT
#define EXTRA_MENU_TEXT_CHAR_DISCONNECT "Disconnect"
#endif
#ifndef EXTRA_MENU_TEXT_CHAR_OFF_SLEEP
#define EXTRA_MENU_TEXT_CHAR_OFF_SLEEP "OFF / Sleep"
#endif
#define MENU_ITEM_TYPE_DIRECT_COMMAND 0
#define MENU_ITEM_TYPE_SELECT_FROM_LIST 1
#define MENU_ITEM_TYPE_SUB_MENU 2
#define MENU_ITEM_TYPE_ONE_OR_MORE_CHARS 3
// menu items
#ifndef USER_DEFINED_MENUS
#define MENU_ITEM_FUNCTION '0'
#define MENU_ITEM_ADD_LOCO '1'
#define MENU_ITEM_DROP_LOCO '2'
#define MENU_ITEM_TOGGLE_DIRECTION '3'
#define MENU_ITEM_SPEED_STEP_MULTIPLIER '4'
#define MENU_ITEM_THROW_POINT '5'
#define MENU_ITEM_CLOSE_POINT '6'
#define MENU_ITEM_ROUTE '7'
#define MENU_ITEM_TRACK_POWER '8'
#define MENU_ITEM_EXTRAS '9'
#define MENU_ITEM_FUNCTION_KEY_TOGGLE 'A'
#define MENU_ITEM_EDIT_CONSIST 'B'
#define MENU_ITEM_TBA 'C'
#define MENU_ITEM_HEARTBEAT_TOGGLE 'D'
#define MENU_ITEM_INCREASE_MAX_THROTTLES 'E'
#define MENU_ITEM_DECREASE_MAX_THROTTLES 'F'
#define MENU_ITEM_DISCONNECT 'G'
#define MENU_ITEM_OFF_SLEEP 'H'
//#define MENU_ITEM_TBA 'I'
//#define MENU_ITEM_TBA 'J'
#endif
#ifndef USER_DEFINED_MENUS
// menu item labels, menu to appear at the bottom of the screen
const String menuText[20][2] = {
{MENU_ITEM_TEXT_TITLE_FUNCTION, MENU_ITEM_TEXT_MENU_FUNCTION}, //0
{MENU_ITEM_TEXT_TITLE_ADD_LOCO, MENU_ITEM_TEXT_MENU_ADD_LOCO}, //1
{MENU_ITEM_TEXT_TITLE_DROP_LOCO, MENU_ITEM_TEXT_MENU_DROP_LOCO}, //2
{MENU_ITEM_TEXT_TITLE_TOGGLE_DIRECTION, MENU_ITEM_TEXT_MENU_NA}, //3
{MENU_ITEM_TEXT_TITLE_SPEED_STEP_MULTIPLIER, MENU_ITEM_TEXT_MENU_NA}, //4
{MENU_ITEM_TEXT_TITLE_THROW_POINT, MENU_ITEM_TEXT_MENU_THROW_POINT}, //5
{MENU_ITEM_TEXT_TITLE_CLOSE_POINT, MENU_ITEM_TEXT_MENU_CLOSE_POINT}, //6
{MENU_ITEM_TEXT_TITLE_ROUTE, MENU_ITEM_TEXT_MENU_ROUTE}, //7
{MENU_ITEM_TEXT_TITLE_TRACK_POWER, MENU_ITEM_TEXT_MENU_NA}, //8
{MENU_ITEM_TEXT_TITLE_EXTRAS, MENU_ITEM_TEXT_MENU_EXTRAS}, //9
{EXTRA_MENU_TEXT_CHAR_FUNCTION_KEY_TOGGLE, MENU_ITEM_TEXT_MENU_NA}, // 10 A
{EXTRA_MENU_TEXT_CHAR_EDIT_CONSIST, MENU_ITEM_TEXT_MENU_EDIT_CONSIST}, // 11 B
{EXTRA_MENU_TEXT_CHAR_TBA, MENU_ITEM_TEXT_MENU_NA}, // 12 C
{EXTRA_MENU_TEXT_CHAR_HEARTBEAT_TOGGLE, MENU_ITEM_TEXT_MENU_NA}, // 13 D
{EXTRA_MENU_TEXT_CHAR_INCREASE_MAX_THROTTLES,MENU_ITEM_TEXT_MENU_NA}, // 14 E
{EXTRA_MENU_TEXT_CHAR_DECREASE_MAX_THROTTLES,MENU_ITEM_TEXT_MENU_NA}, // 15 F
{EXTRA_MENU_TEXT_CHAR_DISCONNECT, MENU_ITEM_TEXT_MENU_NA}, // 16 G
{EXTRA_MENU_TEXT_CHAR_OFF_SLEEP, MENU_ITEM_TEXT_MENU_NA}, // 17 H
{EXTRA_MENU_TEXT_CHAR_TBA, MENU_ITEM_TEXT_MENU_NA}, // 18 I
{EXTRA_MENU_TEXT_CHAR_TBA, MENU_ITEM_TEXT_MENU_NA} // 19 J
};
#else
const String menuText[20][2] = MENU_STRUCTURE;
#endif
#ifndef USER_DEFINED_MENUS
const int menuCharsRequired[20] = {
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //0
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //1
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //2
MENU_ITEM_TYPE_DIRECT_COMMAND, //3
MENU_ITEM_TYPE_DIRECT_COMMAND, //4
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //5
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //6
MENU_ITEM_TYPE_ONE_OR_MORE_CHARS, //7
MENU_ITEM_TYPE_DIRECT_COMMAND, //8
MENU_ITEM_TYPE_SUB_MENU, //9
MENU_ITEM_TYPE_DIRECT_COMMAND, //10 A
MENU_ITEM_TYPE_DIRECT_COMMAND, //11 B
MENU_ITEM_TYPE_DIRECT_COMMAND, //12 C
MENU_ITEM_TYPE_DIRECT_COMMAND, //13 D
MENU_ITEM_TYPE_DIRECT_COMMAND, //14 E
MENU_ITEM_TYPE_DIRECT_COMMAND, //15 F
MENU_ITEM_TYPE_DIRECT_COMMAND, //16 G
MENU_ITEM_TYPE_DIRECT_COMMAND, //17 H
MENU_ITEM_TYPE_DIRECT_COMMAND, //18 I
MENU_ITEM_TYPE_DIRECT_COMMAND //19 J
};
#else
const int menuCharsRequired[20] = MENU_CHARS_REQUIRED;
#endif
// if defined in config_buttons.h these values will be overwritten
//
// speed increase for each click of the encoder
#ifdef SPEED_STEP
const int speedStep = SPEED_STEP;
#else
const int speedStep = 4;
#endif
#ifdef SPEED_STEP_MULTIPLIER
const int speedStepMultiplier = SPEED_STEP_MULTIPLIER; // for 'fast' speed steps
#else
const int speedStepMultiplier = 3; // for 'fast' speed steps
#endif
// Additional multiplier. If the multiplier is enabled from the menu, each rotation of the encoder becomes the speedStep * the AdditionalMultiplier
#ifdef SPEED_STEP_MULTIPLIER
const int speedStepAdditionalMultiplier = SPEED_STEP_MULTIPLIER;
#else
const int speedStepAdditionalMultiplier = 2;
#endif
#ifdef DISPLAY_SPEED_AS_PERCENT
const bool speedDisplayAsPercent = DISPLAY_SPEED_AS_PERCENT;
#else
const bool speedDisplayAsPercent = false;
#endif
#ifdef DISPLAY_SPEED_AS_0_TO_28
const bool speedDisplayAs0to28 = DISPLAY_SPEED_AS_0_TO_28;
#else
const bool speedDisplayAs0to28 = false;
#endif
String witServerIpAndPortEntryMask = "###.###.###.###:#####";
#ifndef DEFAULT_IP_AND_PORT
#define DEFAULT_IP_AND_PORT ""
#endif
#ifndef SSID_CONNECTION_TIMEOUT
#define SSID_CONNECTION_TIMEOUT 10000
#endif
const char ssidPasswordBlankChar = 164;
#ifndef SHORT_DCC_ADDRESS_LIMIT
#define SHORT_DCC_ADDRESS_LIMIT 127
#endif
// *******************************************************************************************************************
#define FONT_DEFAULT u8g2_font_NokiaSmallPlain_tf
#define FONT_FUNCTION_INDICATORS u8g2_font_tiny_simon_tr
#define FONT_THROTTLE_NUMBER u8g2_font_neuecraft_tr
#define FONT_PASSWORD u8g2_font_9x15_tf
#define FONT_SPEED u8g2_font_profont29_mr
// #define FONT_DIRECTION u8g2_font_profont17_tr
#define FONT_DIRECTION u8g2_font_neuecraft_tr
// #define FONT_TRACK_POWER u8g2_font_profont10_tf
#define FONT_NEXT_THROTTLE u8g2_font_6x12_m_symbols
#define FONT_GLYPHS u8g2_font_open_iconic_all_1x_t
// *******************************************************************************************************************
# define DCC_EX_TURNOUT_PREFIX ""
# define DCC_EX_ROUTE_PREFIX "R"
#define CONSIST_LEAD_LOCO 0
#define CONSIST_ALL_LOCOS 1
// *******************************************************************************************************************
#ifndef WITCONTROLLER_DEBUG
#define WITCONTROLLER_DEBUG 0
#endif
#ifndef WITHROTTLE_PROTOCOL_DEBUG
#define WITHROTTLE_PROTOCOL_DEBUG 1
#endif
#ifndef DEBUG_LEVEL
#define DEBUG_LEVEL 1
#endif
// *******************************************************************************************************************
#ifndef AUTO_CONNECT_TO_FIRST_DEFINED_SERVER
#define AUTO_CONNECT_TO_FIRST_DEFINED_SERVER false
#endif
#ifndef AUTO_CONNECT_TO_FIRST_WITHROTTLE_SERVER
#define AUTO_CONNECT_TO_FIRST_WITHROTTLE_SERVER true
#endif
#ifndef OUTBOUND_COMMANDS_MINIMUM_DELAY
#define OUTBOUND_COMMANDS_MINIMUM_DELAY 50
#endif
#ifndef SSID_NAME_FOR_COMMANDS_NEED_LEADING_CR_LF
#define SSID_NAME_FOR_COMMANDS_NEED_LEADING_CR_LF "wftrx_"
#endif
#ifndef ROTARY_ENCODER_DEBOUNCE_TIME
#define ROTARY_ENCODER_DEBOUNCE_TIME 200
#endif
// *******************************************************************************************************************
#ifndef F0_LABEL
#define F0_LABEL "Light"
#endif
#ifndef F1_LABEL
#define F1_LABEL "Bell"
#endif
#ifndef F2_LABEL
#define F2_LABEL "Horn"
#endif
// *******************************************************************************************************************
#ifndef ROTARY_ENCODER_DEBOUNCE_TIME
#define ROTARY_ENCODER_DEBOUNCE_TIME 200
#endif
#ifndef SEARCH_ROSTER_ON_ENTRY_OF_DCC_ADDRESS
#define SEARCH_ROSTER_ON_ENTRY_OF_DCC_ADDRESS false
#endif
// *******************************************************************************************************************
// if bare EC11 rotary encoder is used rather than KY040 then ESP32 GPIO internal pullups must be enabled. Set default to be false
// as the prototype build used KY040 encoder module that incorporates physical resistors
#ifndef EC11_PULLUPS_REQUIRED
#define EC11_PULLUPS_REQUIRED false
#endif
// *******************************************************************************************************************
// consists follow functions
#ifndef CONSIST_FUNCTION_FOLLOW_F0
#define CONSIST_FUNCTION_FOLLOW_F0 CONSIST_ALL_LOCOS // lights
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F1
#define CONSIST_FUNCTION_FOLLOW_F1 CONSIST_LEAD_LOCO // bell
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F2
#define CONSIST_FUNCTION_FOLLOW_F2 CONSIST_LEAD_LOCO // horn
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F3
#define CONSIST_FUNCTION_FOLLOW_F3 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F4
#define CONSIST_FUNCTION_FOLLOW_F4 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F5
#define CONSIST_FUNCTION_FOLLOW_F5 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F6
#define CONSIST_FUNCTION_FOLLOW_F6 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F7
#define CONSIST_FUNCTION_FOLLOW_F7 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F8
#define CONSIST_FUNCTION_FOLLOW_F8 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F9
#define CONSIST_FUNCTION_FOLLOW_F9 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F10
#define CONSIST_FUNCTION_FOLLOW_F10 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F11
#define CONSIST_FUNCTION_FOLLOW_F11 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F12
#define CONSIST_FUNCTION_FOLLOW_F12 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F13
#define CONSIST_FUNCTION_FOLLOW_F13 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F14
#define CONSIST_FUNCTION_FOLLOW_F14 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F15
#define CONSIST_FUNCTION_FOLLOW_F15 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F16
#define CONSIST_FUNCTION_FOLLOW_F16 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F17
#define CONSIST_FUNCTION_FOLLOW_F17 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F18
#define CONSIST_FUNCTION_FOLLOW_F18 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F19
#define CONSIST_FUNCTION_FOLLOW_F19 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F20
#define CONSIST_FUNCTION_FOLLOW_F20 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F21
#define CONSIST_FUNCTION_FOLLOW_F21 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F22
#define CONSIST_FUNCTION_FOLLOW_F22 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F23
#define CONSIST_FUNCTION_FOLLOW_F23 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F24
#define CONSIST_FUNCTION_FOLLOW_F24 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F25
#define CONSIST_FUNCTION_FOLLOW_F25 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F26
#define CONSIST_FUNCTION_FOLLOW_F26 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F27
#define CONSIST_FUNCTION_FOLLOW_F27 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F28
#define CONSIST_FUNCTION_FOLLOW_F28 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F29
#define CONSIST_FUNCTION_FOLLOW_F29 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F30
#define CONSIST_FUNCTION_FOLLOW_F30 CONSIST_LEAD_LOCO
#endif
#ifndef CONSIST_FUNCTION_FOLLOW_F31
#define CONSIST_FUNCTION_FOLLOW_F31 CONSIST_LEAD_LOCO
#endif
// *******************************************************************************************************************
// other options
#ifndef HASH_SHOWS_FUNCTIONS_INSTEAD_OF_KEY_DEFS
#define HASH_SHOWS_FUNCTIONS_INSTEAD_OF_KEY_DEFS false // default if not defined in config_buttons.h
#endif
#ifndef MAX_THROTTLES
#define MAX_THROTTLES 2 // default if not defined in config_buttons.h
#endif
#ifndef ENCODER_BUTTON_ACTION
#define ENCODER_BUTTON_ACTION SPEED_STOP_THEN_TOGGLE_DIRECTION // default if not defined in config_buttons.h
#endif
// *******************************************************************************************************************
// OLED
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h> // add to include path [Arduino install]\hardware\arduino\avr\libraries\SPI\src
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h> // add to include path [Arduino install]\hardware\arduino\avr\libraries\Wire\src
#endif
// U8g2 Constructor List (Frame Buffer)
// you can overide this in config_buttons.h DO NOT CHANGE IT HERE
#ifndef OLED_TYPE
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 22, /* data=*/ 23);
#else
OLED_TYPE
#endif
// *******************************************************************************************************************
// additional / optional commands
// these can be any legigitmate WiThrottle protocol command
// refer to https://www.jmri.org/help/en/package/jmri/jmrit/withrottle/Protocol.shtml
#ifndef CUSTOM_COMMAND_1
#define CUSTOM_COMMAND_1 ""
#endif
#ifndef CUSTOM_COMMAND_2
#define CUSTOM_COMMAND_2 ""
#endif
#ifndef CUSTOM_COMMAND_3
#define CUSTOM_COMMAND_3 ""
#endif
#ifndef CUSTOM_COMMAND_4
#define CUSTOM_COMMAND_4 ""
#endif
#ifndef CUSTOM_COMMAND_5
#define CUSTOM_COMMAND_5 ""
#endif
#ifndef CUSTOM_COMMAND_6
#define CUSTOM_COMMAND_6 ""
#endif
#ifndef CUSTOM_COMMAND_7
#define CUSTOM_COMMAND_7 ""
#endif
// *******************************************************************************************************************
// default direct functions
// Labels that will appear in the UI
// These should match the actual command below
#ifndef CHOSEN_KEYPAD_0_DISPLAY_NAME
#define CHOSEN_KEYPAD_0_DISPLAY_NAME "0 Lights"
#endif
#ifndef CHOSEN_KEYPAD_1_DISPLAY_NAME
#define CHOSEN_KEYPAD_1_DISPLAY_NAME "1 Bell"
#endif
#ifndef CHOSEN_KEYPAD_2_DISPLAY_NAME
#define CHOSEN_KEYPAD_2_DISPLAY_NAME "2 Horn"
#endif
#ifndef CHOSEN_KEYPAD_3_DISPLAY_NAME
#define CHOSEN_KEYPAD_3_DISPLAY_NAME "3 F3"
#endif
#ifndef CHOSEN_KEYPAD_4_DISPLAY_NAME
#define CHOSEN_KEYPAD_4_DISPLAY_NAME "4 F4"
#endif
#ifndef CHOSEN_KEYPAD_5_DISPLAY_NAME
#define CHOSEN_KEYPAD_5_DISPLAY_NAME "5 Nxt Ttl"
#endif
#ifndef CHOSEN_KEYPAD_6_DISPLAY_NAME
#define CHOSEN_KEYPAD_6_DISPLAY_NAME "6 X Spd"
#endif
#ifndef CHOSEN_KEYPAD_7_DISPLAY_NAME
#define CHOSEN_KEYPAD_7_DISPLAY_NAME "7 Rev"
#endif
#ifndef CHOSEN_KEYPAD_8_DISPLAY_NAME
#define CHOSEN_KEYPAD_8_DISPLAY_NAME "8 Estop"
#endif
#ifndef CHOSEN_KEYPAD_9_DISPLAY_NAME
#define CHOSEN_KEYPAD_9_DISPLAY_NAME "9 Fwd"
#endif
// actual commands
#ifndef CHOSEN_KEYPAD_0_FUNCTION
#define CHOSEN_KEYPAD_0_FUNCTION FUNCTION_0
#endif
#ifndef CHOSEN_KEYPAD_1_FUNCTION
#define CHOSEN_KEYPAD_1_FUNCTION FUNCTION_1
#endif
#ifndef CHOSEN_KEYPAD_2_FUNCTION
#define CHOSEN_KEYPAD_2_FUNCTION FUNCTION_2
#endif
#ifndef CHOSEN_KEYPAD_3_FUNCTION
#define CHOSEN_KEYPAD_3_FUNCTION FUNCTION_3
#endif
#ifndef CHOSEN_KEYPAD_4_FUNCTION
#define CHOSEN_KEYPAD_4_FUNCTION FUNCTION_4
#endif
#ifndef CHOSEN_KEYPAD_5_FUNCTION
#define CHOSEN_KEYPAD_5_FUNCTION NEXT_THROTTLE
#endif
#ifndef CHOSEN_KEYPAD_6_FUNCTION
#define CHOSEN_KEYPAD_6_FUNCTION SPEED_MULTIPLIER
#endif
#ifndef CHOSEN_KEYPAD_7_FUNCTION
#define CHOSEN_KEYPAD_7_FUNCTION DIRECTION_REVERSE
#endif
#ifndef CHOSEN_KEYPAD_8_FUNCTION
#define CHOSEN_KEYPAD_8_FUNCTION E_STOP
#endif
#ifndef CHOSEN_KEYPAD_9_FUNCTION
#define CHOSEN_KEYPAD_9_FUNCTION DIRECTION_FORWARD
#endif
#ifndef CHOSEN_KEYPAD_A_FUNCTION
#define CHOSEN_KEYPAD_A_FUNCTION CUSTOM_1
#endif
#ifndef CHOSEN_KEYPAD_B_FUNCTION
#define CHOSEN_KEYPAD_B_FUNCTION CUSTOM_2
#endif
#ifndef CHOSEN_KEYPAD_C_FUNCTION
#define CHOSEN_KEYPAD_C_FUNCTION CUSTOM_3
#endif
#ifndef CHOSEN_KEYPAD_D_FUNCTION
#define CHOSEN_KEYPAD_D_FUNCTION CUSTOM_4
#endif
// *******************************************************************************************************************
#ifndef CHOSEN_ADDITIONAL_BUTTON_0_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_0_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_1_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_1_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_2_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_2_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_3_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_3_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_4_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_4_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_5_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_5_FUNCTION FUNCTION_NULL
#endif
#ifndef CHOSEN_ADDITIONAL_BUTTON_6_FUNCTION
#define CHOSEN_ADDITIONAL_BUTTON_6_FUNCTION FUNCTION_NULL
#endif
#ifndef ADDITIONAL_BUTTON_OVERRIDE_DEFAULT_LATCHING
#define ADDITIONAL_BUTTON_OVERRIDE_DEFAULT_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_0_LATCHING
#define ADDITIONAL_BUTTON_0_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_1_LATCHING
#define ADDITIONAL_BUTTON_1_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_2_LATCHING
#define ADDITIONAL_BUTTON_2_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_3_LATCHING
#define ADDITIONAL_BUTTON_3_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_4_LATCHING
#define ADDITIONAL_BUTTON_4_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_5_LATCHING
#define ADDITIONAL_BUTTON_5_LATCHING true
#endif
#ifndef ADDITIONAL_BUTTON_6_LATCHING
#define ADDITIONAL_BUTTON_6_LATCHING true
#endif
// *******************************************************************************************************************
#ifndef USE_ROTARY_ENCODER_FOR_THROTTLE
#define USE_ROTARY_ENCODER_FOR_THROTTLE true
#endif
#ifndef THROTTLE_POT_PIN
#define THROTTLE_POT_PIN 39
#endif
#ifndef THROTTLE_POT_USE_NOTCHES
#define THROTTLE_POT_USE_NOTCHES true
#endif
#ifndef THROTTLE_POT_NOTCH_VALUES
#define THROTTLE_POT_NOTCH_VALUES {1111,1347,1591,1833,2105,2379,2622,2837};
#endif
#ifndef THROTTLE_POT_NOTCH_SPEEDS
#define THROTTLE_POT_NOTCH_SPEEDS {0,18,36,54,72,90,108,127}
#endif
// *******************************************************************************************************************
#ifndef USE_BATTERY_TEST
#define USE_BATTERY_TEST false
#endif
#ifndef BATTERY_TEST_PIN
#define BATTERY_TEST_PIN 34
#endif
#ifndef BATTERY_CONVERSION_FACTOR
#define BATTERY_CONVERSION_FACTOR 1.7
#endif
#ifndef USE_BATTERY_PERCENT_AS_WELL_AS_ICON
#define USE_BATTERY_PERCENT_AS_WELL_AS_ICON false
#endif
#ifndef USE_BATTERY_SLEEP_AT_PERCENT
#define USE_BATTERY_SLEEP_AT_PERCENT 3
#endif
// ***************************************************
// ESPmDNS problem
// #ifndef USING_OLDER_ESPMDNS
// #define USING_OLDER_ESPMDNS false
// #endif
// #if USING_OLDER_ESPMDNS == true
// #define ESPMDNS_IP_ATTRIBUTE_NAME MDNS.IP(i)
// #else
// #define ESPMDNS_IP_ATTRIBUTE_NAME MDNS.address(i)
// #endif
#if ESP_IDF_VERSION_MAJOR < 5
#define ESPMDNS_IP_ATTRIBUTE_NAME MDNS.IP(i)
#else
#define ESPMDNS_IP_ATTRIBUTE_NAME MDNS.address(i)
#endif
// ***************************************************
// Heartbeat
// max period
#ifndef MAX_HEARTBEAT_PERIOD
#define MAX_HEARTBEAT_PERIOD 240000
#endif
#ifndef HEARTBEAT_ENABLED
#define HEARTBEAT_ENABLED true
#endif
// ***************************************************
// roster sorting
#ifndef ROSTER_SORT_SEQUENCE
#define ROSTER_SORT_SEQUENCE 1
#endif