Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device-ui persistency #597

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions meshtastic/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "meshtastic/config.proto";
import "meshtastic/connection_status.proto";
import "meshtastic/mesh.proto";
import "meshtastic/module_config.proto";
import "meshtastic/device_ui.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down Expand Up @@ -76,6 +77,11 @@ message AdminMessage {
*
*/
SESSIONKEY_CONFIG = 8;

/*
* device-ui config
*/
DEVICEUI_CONFIG = 9;
}

/*
Expand Down Expand Up @@ -329,6 +335,21 @@ message AdminMessage {
*/
fixed32 set_time_only = 43;

/*
* Tell the node to send the stored ui data.
*/
bool get_ui_config_request = 44;

/*
* Reply stored device ui data.
*/
DeviceUIConfig get_ui_config_response = 45;

/*
* Tell the node to store UI data persistently.
*/
DeviceUIConfig store_ui_config = 46;

/*
* Begins an edit transaction for config, module config, owner, and channel settings changes
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
Expand Down
5 changes: 5 additions & 0 deletions meshtastic/device_ui.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*DeviceUIConfig.screen_brightness int_size:8
*DeviceUIConfig.screen_timeout int_size:16
*NodeFilter.node_name max_size:16
*NodeFilter.hopys_away int_size:8
thebentern marked this conversation as resolved.
Show resolved Hide resolved
*NodeHighlight.node_name max_size:16
167 changes: 167 additions & 0 deletions meshtastic/device_ui.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
syntax = "proto3";

package meshtastic;

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
option java_outer_classname = "LocalOnlyProtos";
option java_package = "com.geeksville.mesh";
option swift_prefix = "";

/*
* Protobuf structures for device-ui persistency
*/

message DeviceUIConfig {
/*
* TFT display brightness 1..255
*/
uint32 screen_brightness = 1;

/*
* Screen timeout 0..900
*/
uint32 screen_timeout = 2;

/*
* Screen lock enabled
*/
bool screen_lock = 3;

/*
* Color theme
*/
Theme theme = 4;

/*
* Audible message alert enabled
*/
bool alert_enabled = 5;

/*
* Localization
*/
Language language = 6;

/*
* Node list filter
*/
NodeFilter node_filter = 7;

/*
* Node list highlightening
*/
NodeHighlight node_highlight = 8;
}


message NodeFilter {
/*
* Filter unknown nodes
*/
bool unknown_switch = 1;

/*
* Filter offline nodes
*/
bool offline_switch = 2;

/*
* Filter nodes w/o public key
*/
bool public_key_switch = 3;

/*
* Filter based on hops away
*/
int32 hops_away = 4;

/*
* Filter nodes w/o position
*/
bool position_switch = 5;

/*
* Filter nodes by matching name string
*/
string node_name = 6;

}

message NodeHighlight {
/*
* Hightlight nodes w/ active chat
*/
bool chat_switch = 1;

/*
* Highlight nodes w/ position
*/
bool position_switch = 2;

/*
* Highlight nodes w/ telemetry data
*/
bool telemetry_switch = 3;

/*
* Highlight nodes w/ iaq data
*/
bool iaq_switch = 4;

/*
* Highlight nodes by matching name string
*/
string node_name = 5;

}

enum Theme {
/*
* Dark
*/
DARK = 0;
/*
* Light
*/
LIGHT = 1;
/*
* Red
*/
RED = 2;
}

/*
* Localization
*/
enum Language {
/*
* English
*/
ENGLISH = 0;

/*
* French
*/
FRENCH = 1;

/*
* German
*/
GERMAN = 2;

/*
* Italian
*/
ITALIAN = 3;

/*
* Portuguese
*/
PORTUGUESE = 4;

/*
* Spanish
*/
SPANISH = 5;
}
6 changes: 6 additions & 0 deletions meshtastic/mesh.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "meshtastic/module_config.proto";
import "meshtastic/portnums.proto";
import "meshtastic/telemetry.proto";
import "meshtastic/xmodem.proto";
import "meshtastic/device_ui.proto";

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
Expand Down Expand Up @@ -1640,6 +1641,11 @@ message FromRadio {
* Notification message to the client
*/
ClientNotification clientNotification = 16;

/*
* Persistent data for device-ui
*/
DeviceUIConfig deviceuiConfig = 17;
}
}

Expand Down