tcMenu
RemoteTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 https://www.thecoderscorner.com (Nutricherry LTD).
3  * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4  */
11 #ifndef _TCMENU_REMOTETYPES_H_
12 #define _TCMENU_REMOTETYPES_H_
13 
18 #define MAX_VALUE_LEN 40
19 
20 enum AckResponseStatus {
21  // warnings
22  ACK_VALUE_RANGE = -1 ,
23  // success
24  ACK_SUCCESS = 0,
25  //errors
26  ACK_ID_NOT_FOUND = 1, ACK_CREDENTIALS_INVALID = 2,
27 
28  // unknown error, always last
29  ACK_UNKNOWN = 10000
30  // unknown error, always last
31 };
32 
36 #define msgFieldToWord(a,b) ( (((uint16_t)(a))<<8U) | ((uint16_t)(b)) )
37 
38 /*
39  * Definitions for an unknown field key or part thereof.
40  */
41 #define UNKNOWN_FIELD_PART 0x00
42 
46 #define UNKNOWN_MSG_TYPE 0x0000
47 
49 #define MSG_PAIR msgFieldToWord('P','R')
50 
51 #define MSG_ACKNOWLEDGEMENT msgFieldToWord('A','K')
52 
53 #define MSG_JOIN msgFieldToWord('N','J')
54 
55 #define MSG_HEARTBEAT msgFieldToWord('H','B')
56 
57 #define MSG_BOOTSTRAP msgFieldToWord('B','S')
58 
59 #define MSG_BOOT_ANALOG msgFieldToWord('B','A')
60 
61 #define MSG_BOOT_ACTION msgFieldToWord('B', 'C')
62 
63 #define MSG_BOOT_SUBMENU msgFieldToWord('B', 'M')
64 
65 #define MSG_BOOT_ENUM msgFieldToWord('B', 'E')
66 
67 #define MSG_BOOT_BOOL msgFieldToWord('B', 'B')
68 
69 #define MSG_BOOT_TEXT msgFieldToWord('B','T')
70 
71 #define MSG_BOOT_LARGENUM msgFieldToWord('B', 'N')
72 
73 #define MSG_BOOT_FLOAT msgFieldToWord('B','F')
74 
75 #define MSG_BOOT_RGB_COLOR msgFieldToWord('B', 'K')
76 
77 #define MSG_BOOT_SCROLL_CHOICE msgFieldToWord('B', 'Z')
78 
79 #define MSG_BOOT_REMOTE msgFieldToWord('B','R')
80 
81 #define MSG_BOOT_IPADDRESS msgFieldToWord('B','I')
82 
83 #define MSG_BOOT_LIST msgFieldToWord('B','L')
84 
85 #define MSG_CHANGE_INT msgFieldToWord('V', 'C')
86 
87 #define MSG_DIALOG msgFieldToWord('D', 'M')
88 
89 #define FIELD_MSG_NAME msgFieldToWord('N', 'M')
90 #define FIELD_VERSION msgFieldToWord('V', 'E')
91 #define FIELD_PLATFORM msgFieldToWord('P', 'F')
92 #define FIELD_BOOT_TYPE msgFieldToWord('B', 'T')
93 #define FIELD_HB_INTERVAL msgFieldToWord('H', 'I')
94 #define FIELD_HB_MILLISEC msgFieldToWord('H', 'M')
95 #define FIELD_HB_MODE msgFieldToWord('H', 'R')
96 #define FIELD_ID msgFieldToWord('I', 'D')
97 #define FIELD_EEPROM msgFieldToWord('I', 'E')
98 #define FIELD_READONLY msgFieldToWord('R', 'O')
99 #define FIELD_VISIBLE msgFieldToWord('V', 'I')
100 #define FIELD_PARENT msgFieldToWord('P', 'I')
101 #define FIELD_ANALOG_MAX msgFieldToWord('A', 'M')
102 #define FIELD_ANALOG_OFF msgFieldToWord('A', 'O')
103 #define FIELD_ANALOG_DIV msgFieldToWord('A', 'D')
104 #define FIELD_ANALOG_UNIT msgFieldToWord('A', 'U')
105 #define FIELD_CURRENT_VAL msgFieldToWord('V', 'C')
106 #define FIELD_BOOL_NAMING msgFieldToWord('B', 'N')
107 #define FIELD_NO_CHOICES msgFieldToWord('N', 'C')
108 #define FIELD_CHANGE_TYPE msgFieldToWord('T', 'C')
109 #define FIELD_MAX_LEN msgFieldToWord('M', 'L')
110 #define FIELD_REMOTE_NO msgFieldToWord('R', 'N')
111 #define FIELD_FLOAT_DP msgFieldToWord('F', 'D')
112 #define FIELD_UUID msgFieldToWord('U', 'U')
113 #define FIELD_CORRELATION msgFieldToWord('I', 'C')
114 #define FIELD_ACK_STATUS msgFieldToWord('S', 'T')
115 #define FIELD_HEADER msgFieldToWord('H', 'F')
116 #define FIELD_BUTTON1 msgFieldToWord('B', '1')
117 #define FIELD_BUTTON2 msgFieldToWord('B', '2')
118 #define FIELD_BUFFER msgFieldToWord('B', 'U')
119 #define FIELD_MODE msgFieldToWord('M', 'O')
120 #define FIELD_EDIT_MODE msgFieldToWord('E', 'M')
121 #define FIELD_ALPHA msgFieldToWord('R', 'A')
122 #define FIELD_WIDTH msgFieldToWord('W', 'I')
123 
124 #define FIELD_PREPEND_CHOICE 'C'
125 #define FIELD_PREPEND_NAMECHOICE 'c'
126 
131 enum ChangeType: uint8_t {
132  CHANGE_DELTA = 0, CHANGE_ABSOLUTE = 1, CHANGE_LIST = 2
133 };
134 
138 enum ApiPlatform : uint8_t {
139  PLATFORM_ARDUINO_8BIT = 0,
140  PLATFORM_JAVA_API = 1,
141  PLATFORM_ARDUINO_32BIT = 2,
142  PLATFORM_DOTNET = 3
143 };
144 
148 enum HeartbeatMode : uint8_t {
155 };
156 
157 #endif /* _TCMENU_REMOTETYPES_H_ */
Definition: RemoteTypes.h:154
Definition: RemoteTypes.h:150
ApiPlatform
Definition: RemoteTypes.h:138
HeartbeatMode
Definition: RemoteTypes.h:148
Definition: RemoteTypes.h:152
ChangeType
Definition: RemoteTypes.h:131