Skip to content

Commit 98e95ee

Browse files
Remote Shell Protobufs (#892)
* Add initial dmshell * Remove unused code * Internally use RemoteShell * Formatting fix * Clarify comment for REMOTE_SHELL_APP Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
1 parent 0e5eab1 commit 98e95ee

3 files changed

Lines changed: 77 additions & 0 deletions

File tree

meshtastic/mesh.options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
*StoreForwardPlusPlus.root_hash max_size:32
7575
*StoreForwardPlusPlus.message max_size:240
7676

77+
*RemoteShell.payload max_size:200
78+
7779
*StatusMessage.status max_size:80
7880

7981
# MyMessage.name max_size:40

meshtastic/mesh.proto

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,76 @@ message StoreForwardPlusPlus {
12881288
uint32 chain_count = 10;
12891289
}
12901290

1291+
/*
1292+
* The actual over-the-mesh message doing RemoteShell
1293+
*/
1294+
message RemoteShell {
1295+
/*
1296+
* Frame op code for PTY session control and stream transport.
1297+
*
1298+
* Values 1-63 are client->server requests.
1299+
* Values 64-127 are server->client responses/events.
1300+
*/
1301+
enum OpCode {
1302+
OP_UNSET = 0;
1303+
1304+
// Client -> server
1305+
OPEN = 1;
1306+
INPUT = 2;
1307+
RESIZE = 3;
1308+
CLOSE = 4;
1309+
PING = 5;
1310+
ACK = 6;
1311+
1312+
// Server -> client
1313+
OPEN_OK = 64;
1314+
OUTPUT = 65;
1315+
CLOSED = 66;
1316+
ERROR = 67;
1317+
PONG = 68;
1318+
}
1319+
1320+
/*
1321+
* Structured frame operation.
1322+
*/
1323+
OpCode op = 1;
1324+
1325+
/*
1326+
* Logical PTY session identifier.
1327+
*/
1328+
uint32 session_id = 2;
1329+
1330+
/*
1331+
* Monotonic sequence number for this frame.
1332+
*/
1333+
uint32 seq = 3;
1334+
1335+
/*
1336+
* Cumulative ack sequence number.
1337+
*/
1338+
uint32 ack_seq = 4;
1339+
1340+
/*
1341+
* Opaque bytes payload for INPUT/OUTPUT/ERROR and other frame bodies.
1342+
*/
1343+
bytes payload = 5;
1344+
1345+
/*
1346+
* Terminal size columns used for OPEN/RESIZE signaling.
1347+
*/
1348+
uint32 cols = 6;
1349+
1350+
/*
1351+
* Terminal size rows used for OPEN/RESIZE signaling.
1352+
*/
1353+
uint32 rows = 7;
1354+
1355+
/*
1356+
* Bit flags for protocol extensions.
1357+
*/
1358+
uint32 flags = 8;
1359+
}
1360+
12911361
/*
12921362
* Waypoint message, used to share arbitrary locations across the mesh
12931363
*/

meshtastic/portnums.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ enum PortNum {
115115
*/
116116
KEY_VERIFICATION_APP = 12;
117117

118+
/*
119+
* Module/port for handling primitive remote shell access.
120+
*/
121+
REMOTE_SHELL_APP = 13;
122+
118123
/*
119124
* Provides a 'ping' service that replies to any packet it receives.
120125
* Also serves as a small example module.

0 commit comments

Comments
 (0)