mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Parse as signed int
This commit is contained in:
parent
d0720c63c2
commit
e8646f5ede
1 changed files with 3 additions and 2 deletions
|
|
@ -1228,10 +1228,11 @@ void MyMesh::handleCmdFrame(size_t len) {
|
|||
writeErrFrame(ERR_CODE_ILLEGAL_ARG);
|
||||
}
|
||||
} else if (cmd_frame[0] == CMD_SET_RADIO_TX_POWER) {
|
||||
if (cmd_frame[1] > MAX_LORA_TX_POWER) {
|
||||
int8_t power = (int8_t)cmd_frame[1];
|
||||
if (power < -9 || power > MAX_LORA_TX_POWER) {
|
||||
writeErrFrame(ERR_CODE_ILLEGAL_ARG);
|
||||
} else {
|
||||
_prefs.tx_power_dbm = cmd_frame[1];
|
||||
_prefs.tx_power_dbm = power;
|
||||
savePrefs();
|
||||
radio_set_tx_power(_prefs.tx_power_dbm);
|
||||
writeOKFrame();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue