Revise according to the review comments.
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
1 parent
c50064dad2
commit
4d233249fc
3 files changed
+11
-11
No files matched your search
@@ -46,8 +46,7 @@
|
|||||||
#define CMD_SET_CUSTOM_VAR 41
|
#define CMD_SET_CUSTOM_VAR 41
|
||||||
#define CMD_GET_ADVERT_PATH 42
|
#define CMD_GET_ADVERT_PATH 42
|
||||||
#define CMD_GET_TUNING_PARAMS 43
|
#define CMD_GET_TUNING_PARAMS 43
|
||||||
#define CMD_GET_RADIO_FEM_RXGAIN 44
|
|
||||||
#define CMD_SET_RADIO_FEM_RXGAIN 45
|
|
||||||
// NOTE: CMD range 46..49 parked, potentially for WiFi operations
|
// NOTE: CMD range 46..49 parked, potentially for WiFi operations
|
||||||
#define CMD_SEND_BINARY_REQ 50
|
#define CMD_SEND_BINARY_REQ 50
|
||||||
#define CMD_FACTORY_RESET 51
|
#define CMD_FACTORY_RESET 51
|
||||||
@@ -63,6 +62,8 @@
|
|||||||
#define CMD_SEND_CHANNEL_DATA 62
|
#define CMD_SEND_CHANNEL_DATA 62
|
||||||
#define CMD_SET_DEFAULT_FLOOD_SCOPE 63
|
#define CMD_SET_DEFAULT_FLOOD_SCOPE 63
|
||||||
#define CMD_GET_DEFAULT_FLOOD_SCOPE 64
|
#define CMD_GET_DEFAULT_FLOOD_SCOPE 64
|
||||||
|
#define CMD_GET_RADIO_FEM_RXGAIN 65
|
||||||
|
#define CMD_SET_RADIO_FEM_RXGAIN 66
|
||||||
|
|
||||||
// Stats sub-types for CMD_GET_STATS
|
// Stats sub-types for CMD_GET_STATS
|
||||||
#define STATS_TYPE_CORE 0
|
#define STATS_TYPE_CORE 0
|
||||||
@@ -1808,9 +1809,9 @@ void MyMesh::handleCmdFrame(size_t len) {
|
|||||||
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
|
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
|
||||||
} else {
|
} else {
|
||||||
out_frame[0] = RESP_CODE_OK;
|
out_frame[0] = RESP_CODE_OK;
|
||||||
uint32_t value = board.isLoRaFemLnaEnabled() ? 1 : 0;
|
uint8_t value = board.isLoRaFemLnaEnabled() ? 1 : 0;
|
||||||
memcpy(&out_frame[1], &value, 4);
|
memcpy(&out_frame[1], &value, 1);
|
||||||
_serial->writeFrame(out_frame, 5);
|
_serial->writeFrame(out_frame, 2);
|
||||||
}
|
}
|
||||||
} else if (cmd_frame[0] == CMD_SET_RADIO_FEM_RXGAIN && len >= 2) {
|
} else if (cmd_frame[0] == CMD_SET_RADIO_FEM_RXGAIN && len >= 2) {
|
||||||
uint8_t value = cmd_frame[1];
|
uint8_t value = cmd_frame[1];
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|||||||
#endif
|
#endif
|
||||||
} else if (memcmp(config, "radio.fem.rxgain ", 17) == 0) {
|
} else if (memcmp(config, "radio.fem.rxgain ", 17) == 0) {
|
||||||
if (!_board->canControlLoRaFemLna()) {
|
if (!_board->canControlLoRaFemLna()) {
|
||||||
strcpy(reply, "Error: unsupported by this board");
|
strcpy(reply, "Error: unsupported");
|
||||||
} else if (memcmp(&config[17], "on", 2) == 0) {
|
} else if (memcmp(&config[17], "on", 2) == 0) {
|
||||||
if (_board->setLoRaFemLnaEnabled(true)) {
|
if (_board->setLoRaFemLnaEnabled(true)) {
|
||||||
_prefs->radio_fem_rxgain = 1;
|
_prefs->radio_fem_rxgain = 1;
|
||||||
@@ -750,7 +750,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_prefs->adc_multiplier = 0.0f;
|
_prefs->adc_multiplier = 0.0f;
|
||||||
strcpy(reply, "Error: unsupported by this board");
|
strcpy(reply, "Error: unsupported");
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
strcpy(reply, "unknown config: ");
|
strcpy(reply, "unknown config: ");
|
||||||
@@ -800,7 +800,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|||||||
#endif
|
#endif
|
||||||
} else if (memcmp(config, "radio.fem.rxgain", 16) == 0) {
|
} else if (memcmp(config, "radio.fem.rxgain", 16) == 0) {
|
||||||
if (!_board->canControlLoRaFemLna()) {
|
if (!_board->canControlLoRaFemLna()) {
|
||||||
strcpy(reply, "Error: unsupported by this board");
|
strcpy(reply, "Error: unsupported");
|
||||||
} else {
|
} else {
|
||||||
sprintf(reply, "> %s", _board->isLoRaFemLnaEnabled() ? "on" : "off");
|
sprintf(reply, "> %s", _board->isLoRaFemLnaEnabled() ? "on" : "off");
|
||||||
}
|
}
|
||||||
@@ -885,12 +885,12 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|||||||
strcpy(reply, "> unknown");
|
strcpy(reply, "> unknown");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
strcpy(reply, "ERROR: unsupported");
|
strcpy(reply, "Error: unsupported");
|
||||||
#endif
|
#endif
|
||||||
} else if (memcmp(config, "adc.multiplier", 14) == 0) {
|
} else if (memcmp(config, "adc.multiplier", 14) == 0) {
|
||||||
float adc_mult = _board->getAdcMultiplier();
|
float adc_mult = _board->getAdcMultiplier();
|
||||||
if (adc_mult == 0.0f) {
|
if (adc_mult == 0.0f) {
|
||||||
strcpy(reply, "Error: unsupported by this board");
|
strcpy(reply, "Error: unsupported");
|
||||||
} else {
|
} else {
|
||||||
sprintf(reply, "> %.3f", adc_mult);
|
sprintf(reply, "> %.3f", adc_mult);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ public:
|
|||||||
void onAfterTransmit(void) override;
|
void onAfterTransmit(void) override;
|
||||||
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1);
|
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1);
|
||||||
void powerOff() override;
|
void powerOff() override;
|
||||||
const char* getManufacturerName() const override ;
|
|
||||||
bool setLoRaFemLnaEnabled(bool enable) override;
|
bool setLoRaFemLnaEnabled(bool enable) override;
|
||||||
bool canControlLoRaFemLna() const override;
|
bool canControlLoRaFemLna() const override;
|
||||||
bool isLoRaFemLnaEnabled() const override;
|
bool isLoRaFemLnaEnabled() const override;
|
||||||
|
|||||||
Reference in new issue
Block a user