-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommandTable.h
More file actions
186 lines (172 loc) · 13.5 KB
/
Copy pathCommandTable.h
File metadata and controls
186 lines (172 loc) · 13.5 KB
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
#pragma once
#include <string>
#include <vector>
// One entry per item that appears in the "Command" dropdown.
// This table is populated from the MeshCore CLI command reference:
// https://docs.meshcore.io/cli_commands/
struct CommandDef
{
std::wstring category; // shown as a "[Category]" prefix in the dropdown
std::wstring displayName; // shown in the combo box after the category
std::string command; // ASCII text sent to the device (CRLF added automatically)
bool takesParam; // if true, whatever is in the parameter edit box is
// appended after a space - for multi-value commands
// (e.g. "set radio <freq>,<bw>,<sf>,<cr>") type the
// whole comma-separated value into the parameter box.
};
// NOTE ON RESPONSES: most of these commands reply with a single line of text,
// which the dialog code shows next to the command in the status list. A few
// (neighbors, sensor list, log, region dump/list) reply with MULTIPLE lines -
// for those, only the last line will show in the status list; check the raw
// log panel to see the full multi-line reply.
//
// NOTE ON "erase": this factory-resets the node. It's included here for
// completeness but you may want to remove it, or add a confirmation prompt
// in OnBnClickedButtonSend, before shipping this to end users.
inline const std::vector<CommandDef>& GetCommandTable()
{
static const std::vector<CommandDef> table = {
// --- Operational ---
{ L"Operational", L"Reboot", "reboot", false },
{ L"Operational", L"Power Off", "poweroff", false },
{ L"Operational", L"Reset Clock & Reboot", "clkreboot", false },
{ L"Operational", L"Sync Clock With Remote Device", "clock sync", false },
{ L"Operational", L"Display Current UTC Time", "clock", false },
{ L"Operational", L"Set Time (epoch seconds)", "time", true },
{ L"Operational", L"Start OTA Firmware Update", "start ota", false },
{ L"Operational", L"Erase / Factory Reset (DESTRUCTIVE)", "erase", false },
// --- Neighbors (Repeater only) ---
{ L"Neighbors", L"List Nearby Neighbors", "neighbors", false },
{ L"Neighbors", L"Send Flood Advert", "advert", false },
{ L"Neighbors", L"Send Zero-Hop Advert", "advert.zerohop", false },
{ L"Neighbors", L"Remove Neighbor (pubkey prefix)", "neighbor.remove", true },
{ L"Neighbors", L"Discover Zero-Hop Neighbors", "discover.neighbors",false },
// --- Statistics ---
{ L"Statistics", L"Clear Stats", "clear stats", false },
{ L"Statistics", L"System Stats", "stats-core", false },
{ L"Statistics", L"Radio Stats", "stats-radio", false },
{ L"Statistics", L"Packet Stats", "stats-packets", false },
// --- Logging ---
{ L"Logging", L"Start RX Log Capture", "log start", false },
{ L"Logging", L"Stop RX Log Capture", "log stop", false },
{ L"Logging", L"Erase Captured Log", "log erase", false },
{ L"Logging", L"Print Captured Log", "log", false },
// --- Info ---
{ L"Info", L"Get Firmware Version", "ver", false },
{ L"Info", L"Show Hardware/Board Name", "board", false },
// --- Radio ---
{ L"Radio", L"Get Radio Params", "get radio", false },
{ L"Radio", L"Set Radio Params (freq,bw,sf,cr)", "set radio", true },
{ L"Radio", L"Get TX Power", "get tx", false },
{ L"Radio", L"Set TX Power (dBm)", "set tx", true },
{ L"Radio", L"Temp Radio Params (freq,bw,sf,cr,mins)","tempradio", true },
{ L"Radio", L"Get Frequency", "get freq", false },
{ L"Radio", L"Set Frequency (MHz)", "set freq", true },
{ L"Radio", L"Get RX Boosted Gain Mode", "get radio.rxgain", false },
{ L"Radio", L"Set RX Boosted Gain Mode (on/off)", "set radio.rxgain", true },
// --- System ---
{ L"System", L"Get Node Name", "get name", false },
{ L"System", L"Set Node Name", "set name", true },
{ L"System", L"Get Latitude", "get lat", false },
{ L"System", L"Set Latitude", "set lat", true },
{ L"System", L"Get Longitude", "get lon", false },
{ L"System", L"Set Longitude", "set lon", true },
{ L"System", L"Get Identity/Private Key", "get prv.key", false },
{ L"System", L"Set Identity/Private Key (hex)", "set prv.key", true },
{ L"System", L"Change Admin Password", "password", true },
{ L"System", L"Get Guest Password", "get guest.password",false },
{ L"System", L"Set Guest Password", "set guest.password",true },
{ L"System", L"Get Owner Info", "get owner.info", false },
{ L"System", L"Set Owner Info", "set owner.info", true },
{ L"System", L"Get Battery ADC Multiplier", "get adc.multiplier",false },
{ L"System", L"Set Battery ADC Multiplier", "set adc.multiplier",true },
{ L"System", L"Get Public Key", "get public.key", false },
{ L"System", L"Get Role", "get role", false },
{ L"System", L"Get Power Saving Status", "powersaving", false },
{ L"System", L"Power Saving On", "powersaving on", false },
{ L"System", L"Power Saving Off", "powersaving off", false },
// --- Routing ---
{ L"Routing", L"Get Repeat Flag", "get repeat", false },
{ L"Routing", L"Set Repeat Flag (on/off)", "set repeat", true },
{ L"Routing", L"Get Advert Path Hash Mode", "get path.hash.mode",false },
{ L"Routing", L"Set Advert Path Hash Mode (0-2)", "set path.hash.mode",true },
{ L"Routing", L"Get Loop Detection", "get loop.detect", false },
{ L"Routing", L"Set Loop Detection", "set loop.detect", true },
{ L"Routing", L"Get Flood TX Delay Factor", "get txdelay", false },
{ L"Routing", L"Set Flood TX Delay Factor", "set txdelay", true },
{ L"Routing", L"Get Direct TX Delay Factor", "get direct.txdelay",false },
{ L"Routing", L"Set Direct TX Delay Factor", "set direct.txdelay",true },
{ L"Routing", L"Get RX Processing Delay (experimental)","get rxdelay", false },
{ L"Routing", L"Set RX Processing Delay (experimental)","set rxdelay", true },
{ L"Routing", L"Get Duty Cycle Limit", "get dutycycle", false },
{ L"Routing", L"Set Duty Cycle Limit (1-100)", "set dutycycle", true },
{ L"Routing", L"Get Airtime Factor (deprecated)", "get af", false },
{ L"Routing", L"Set Airtime Factor (deprecated)", "set af", true },
{ L"Routing", L"Get Local Interference Threshold", "get int.thresh", false },
{ L"Routing", L"Set Local Interference Threshold", "set int.thresh", true },
{ L"Routing", L"Get AGC Reset Interval", "get agc.reset.interval", false },
{ L"Routing", L"Set AGC Reset Interval", "set agc.reset.interval", true },
{ L"Routing", L"Get Multi-Acks", "get multi.acks", false },
{ L"Routing", L"Set Multi-Acks (0/1)", "set multi.acks", true },
{ L"Routing", L"Get Flood Advert Interval (hrs)", "get flood.advert.interval", false },
{ L"Routing", L"Set Flood Advert Interval (hrs)", "set flood.advert.interval", true },
{ L"Routing", L"Get Zero-Hop Advert Interval (mins)", "get advert.interval", false },
{ L"Routing", L"Set Zero-Hop Advert Interval (mins)", "set advert.interval", true },
{ L"Routing", L"Get Flood Max Hops", "get flood.max", false },
{ L"Routing", L"Set Flood Max Hops (0-64)", "set flood.max", true },
{ L"Routing", L"Get Unscoped Flood Max Hops", "get flood.max.unscoped", false },
{ L"Routing", L"Set Unscoped Flood Max Hops (0-64)", "set flood.max.unscoped", true },
{ L"Routing", L"Get Advert Flood Max Hops", "get flood.max.advert", false },
{ L"Routing", L"Set Advert Flood Max Hops (0-64)", "set flood.max.advert", true },
// --- ACL ---
{ L"ACL", L"Set Companion Permission (pubkey perm)", "setperm", true },
{ L"ACL", L"Get ACL", "get acl", false },
{ L"ACL", L"Get Read-Only Flag", "get allow.read.only", false },
{ L"ACL", L"Set Read-Only Flag (on/off)", "set allow.read.only", true },
// --- Region ---
{ L"Region", L"Region Save", "region save", false },
{ L"Region", L"Region Allow (name or *)", "region allowf", true },
{ L"Region", L"Region Deny (name or *)", "region denyf", true },
{ L"Region", L"Region Info (name or *)", "region get", true },
{ L"Region", L"Get Home Region", "region home", false },
{ L"Region", L"Set Home Region", "region home", true },
{ L"Region", L"Get Default Scope Region", "region default", false },
{ L"Region", L"Set Default Scope Region", "region default", true },
{ L"Region", L"Create Region (name [parent])", "region put", true },
{ L"Region", L"Define Region Hierarchy (tokens)", "region def", true },
{ L"Region", L"Remove Region (name)", "region remove", true },
{ L"Region", L"List Regions (allowed/denied)", "region list", true },
{ L"Region", L"Dump All Regions", "region", false },
// --- GPS ---
{ L"GPS", L"Get GPS State", "gps", false },
{ L"GPS", L"Set GPS State (on/off)", "gps", true },
{ L"GPS", L"Sync Clock With GPS", "gps sync", false },
{ L"GPS", L"Set Location From GPS", "gps setloc", false },
{ L"GPS", L"Get GPS Advert Policy", "gps advert", false },
{ L"GPS", L"Set GPS Advert Policy (none/share/prefs)", "gps advert", true },
// --- Sensors ---
{ L"Sensors", L"List Sensors", "sensor list", false },
{ L"Sensors", L"Get Sensor Value (key)", "sensor get", true },
{ L"Sensors", L"Set Sensor Value (key value)", "sensor set", true },
// --- Bridge ---
{ L"Bridge", L"Get Bridge Type", "get bridge.type", false },
{ L"Bridge", L"Get Bridge Enabled", "get bridge.enabled",false },
{ L"Bridge", L"Set Bridge Enabled (on/off)", "set bridge.enabled",true },
{ L"Bridge", L"Get Bridge Delay (ms)", "get bridge.delay", false },
{ L"Bridge", L"Set Bridge Delay (0-10000 ms)", "set bridge.delay", true },
{ L"Bridge", L"Get Bridge Source", "get bridge.source", false },
{ L"Bridge", L"Set Bridge Source (logRx/logTx)", "set bridge.source", true },
{ L"Bridge", L"Get Bridge Baud (RS-232)", "get bridge.baud", false },
{ L"Bridge", L"Set Bridge Baud (RS-232)", "set bridge.baud", true },
{ L"Bridge", L"Get Bridge Channel (ESPNow)", "get bridge.channel",false },
{ L"Bridge", L"Set Bridge Channel (ESPNow)", "set bridge.channel",true },
{ L"Bridge", L"Get ESP-Now Secret", "get bridge.secret", false },
{ L"Bridge", L"Set ESP-Now Secret", "set bridge.secret", true },
{ L"Bridge", L"Get Bootloader Version (nRF52)", "get bootloader.ver",false },
{ L"Bridge", L"Get Power Mgmt Support", "get pwrmgt.support",false },
{ L"Bridge", L"Get Power Source", "get pwrmgt.source", false },
{ L"Bridge", L"Get Boot/Shutdown Reason", "get pwrmgt.bootreason", false },
{ L"Bridge", L"Get Boot Voltage", "get pwrmgt.bootmv", false },
};
return table;
}