Skip to content

Commit 647081c

Browse files
authored
Merge pull request #597 from meshtastic/device-ui
Add device-ui persistency
2 parents 387d0be + 70a52e7 commit 647081c

File tree

4 files changed

+199
-0
lines changed

4 files changed

+199
-0
lines changed

meshtastic/admin.proto

+21
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import "meshtastic/config.proto";
77
import "meshtastic/connection_status.proto";
88
import "meshtastic/mesh.proto";
99
import "meshtastic/module_config.proto";
10+
import "meshtastic/device_ui.proto";
1011

1112
option csharp_namespace = "Meshtastic.Protobufs";
1213
option go_package = "github.com/meshtastic/go/generated";
@@ -76,6 +77,11 @@ message AdminMessage {
7677
*
7778
*/
7879
SESSIONKEY_CONFIG = 8;
80+
81+
/*
82+
* device-ui config
83+
*/
84+
DEVICEUI_CONFIG = 9;
7985
}
8086

8187
/*
@@ -329,6 +335,21 @@ message AdminMessage {
329335
*/
330336
fixed32 set_time_only = 43;
331337

338+
/*
339+
* Tell the node to send the stored ui data.
340+
*/
341+
bool get_ui_config_request = 44;
342+
343+
/*
344+
* Reply stored device ui data.
345+
*/
346+
DeviceUIConfig get_ui_config_response = 45;
347+
348+
/*
349+
* Tell the node to store UI data persistently.
350+
*/
351+
DeviceUIConfig store_ui_config = 46;
352+
332353
/*
333354
* Begins an edit transaction for config, module config, owner, and channel settings changes
334355
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)

meshtastic/device_ui.options

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*DeviceUIConfig.screen_brightness int_size:8
2+
*DeviceUIConfig.screen_timeout int_size:16
3+
*NodeFilter.node_name max_size:16
4+
*NodeFilter.hops_away int_size:8
5+
*NodeHighlight.node_name max_size:16

meshtastic/device_ui.proto

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
syntax = "proto3";
2+
3+
package meshtastic;
4+
5+
option csharp_namespace = "Meshtastic.Protobufs";
6+
option go_package = "github.com/meshtastic/go/generated";
7+
option java_outer_classname = "LocalOnlyProtos";
8+
option java_package = "com.geeksville.mesh";
9+
option swift_prefix = "";
10+
11+
/*
12+
* Protobuf structures for device-ui persistency
13+
*/
14+
15+
message DeviceUIConfig {
16+
/*
17+
* TFT display brightness 1..255
18+
*/
19+
uint32 screen_brightness = 1;
20+
21+
/*
22+
* Screen timeout 0..900
23+
*/
24+
uint32 screen_timeout = 2;
25+
26+
/*
27+
* Screen lock enabled
28+
*/
29+
bool screen_lock = 3;
30+
31+
/*
32+
* Color theme
33+
*/
34+
Theme theme = 4;
35+
36+
/*
37+
* Audible message alert enabled
38+
*/
39+
bool alert_enabled = 5;
40+
41+
/*
42+
* Localization
43+
*/
44+
Language language = 6;
45+
46+
/*
47+
* Node list filter
48+
*/
49+
NodeFilter node_filter = 7;
50+
51+
/*
52+
* Node list highlightening
53+
*/
54+
NodeHighlight node_highlight = 8;
55+
}
56+
57+
58+
message NodeFilter {
59+
/*
60+
* Filter unknown nodes
61+
*/
62+
bool unknown_switch = 1;
63+
64+
/*
65+
* Filter offline nodes
66+
*/
67+
bool offline_switch = 2;
68+
69+
/*
70+
* Filter nodes w/o public key
71+
*/
72+
bool public_key_switch = 3;
73+
74+
/*
75+
* Filter based on hops away
76+
*/
77+
int32 hops_away = 4;
78+
79+
/*
80+
* Filter nodes w/o position
81+
*/
82+
bool position_switch = 5;
83+
84+
/*
85+
* Filter nodes by matching name string
86+
*/
87+
string node_name = 6;
88+
89+
}
90+
91+
message NodeHighlight {
92+
/*
93+
* Hightlight nodes w/ active chat
94+
*/
95+
bool chat_switch = 1;
96+
97+
/*
98+
* Highlight nodes w/ position
99+
*/
100+
bool position_switch = 2;
101+
102+
/*
103+
* Highlight nodes w/ telemetry data
104+
*/
105+
bool telemetry_switch = 3;
106+
107+
/*
108+
* Highlight nodes w/ iaq data
109+
*/
110+
bool iaq_switch = 4;
111+
112+
/*
113+
* Highlight nodes by matching name string
114+
*/
115+
string node_name = 5;
116+
117+
}
118+
119+
enum Theme {
120+
/*
121+
* Dark
122+
*/
123+
DARK = 0;
124+
/*
125+
* Light
126+
*/
127+
LIGHT = 1;
128+
/*
129+
* Red
130+
*/
131+
RED = 2;
132+
}
133+
134+
/*
135+
* Localization
136+
*/
137+
enum Language {
138+
/*
139+
* English
140+
*/
141+
ENGLISH = 0;
142+
143+
/*
144+
* French
145+
*/
146+
FRENCH = 1;
147+
148+
/*
149+
* German
150+
*/
151+
GERMAN = 2;
152+
153+
/*
154+
* Italian
155+
*/
156+
ITALIAN = 3;
157+
158+
/*
159+
* Portuguese
160+
*/
161+
PORTUGUESE = 4;
162+
163+
/*
164+
* Spanish
165+
*/
166+
SPANISH = 5;
167+
}

meshtastic/mesh.proto

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import "meshtastic/module_config.proto";
88
import "meshtastic/portnums.proto";
99
import "meshtastic/telemetry.proto";
1010
import "meshtastic/xmodem.proto";
11+
import "meshtastic/device_ui.proto";
1112

1213
option csharp_namespace = "Meshtastic.Protobufs";
1314
option go_package = "github.com/meshtastic/go/generated";
@@ -1640,6 +1641,11 @@ message FromRadio {
16401641
* Notification message to the client
16411642
*/
16421643
ClientNotification clientNotification = 16;
1644+
1645+
/*
1646+
* Persistent data for device-ui
1647+
*/
1648+
DeviceUIConfig deviceuiConfig = 17;
16431649
}
16441650
}
16451651

0 commit comments

Comments
 (0)