Skip to content

Commit 781f7e9

Browse files
author
Scott Powell
committed
* companion: added CMD_GET_TUNING_PARAMS -> RESP_CODE_TUNING_PARAMS
1 parent 797ab85 commit 781f7e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/companion_radio/MyMesh.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#define CMD_GET_CUSTOM_VARS 40
4646
#define CMD_SET_CUSTOM_VAR 41
4747
#define CMD_GET_ADVERT_PATH 42
48+
#define CMD_GET_TUNING_PARAMS 43
4849

4950
#define RESP_CODE_OK 0
5051
#define RESP_CODE_ERR 1
@@ -69,6 +70,7 @@
6970
#define RESP_CODE_SIGNATURE 20
7071
#define RESP_CODE_CUSTOM_VARS 21
7172
#define RESP_CODE_ADVERT_PATH 22
73+
#define RESP_CODE_TUNING_PARAMS 23
7274

7375
#define SEND_TIMEOUT_BASE_MILLIS 500
7476
#define FLOOD_SEND_TIMEOUT_FACTOR 16.0f
@@ -1016,6 +1018,13 @@ void MyMesh::handleCmdFrame(size_t len) {
10161018
_prefs.airtime_factor = ((float)af) / 1000.0f;
10171019
savePrefs();
10181020
writeOKFrame();
1021+
} else if (cmd_frame[0] == CMD_GET_TUNING_PARAMS) {
1022+
uint32_t rx = _prefs.rx_delay_base * 1000, af = _prefs.airtime_factor * 1000;
1023+
int i = 0;
1024+
out_frame[i++] = RESP_CODE_TUNING_PARAMS;
1025+
memcpy(&out_frame[i], &rx, 4); i += 4;
1026+
memcpy(&out_frame[i], &af, 4); i += 4;
1027+
_serial->writeFrame(out_frame, i);
10191028
} else if (cmd_frame[0] == CMD_SET_OTHER_PARAMS) {
10201029
_prefs.manual_add_contacts = cmd_frame[1];
10211030
if (len >= 3) {

0 commit comments

Comments
 (0)