HAL_Linux: support receiver based RSSI

This commit is contained in:
Andrew Tridgell 2017-06-20 13:12:40 +10:00
parent 94b5a9c6f0
commit 9868ffe13b
2 changed files with 8 additions and 0 deletions

View File

@ -448,6 +448,7 @@ bool RCInput::add_sumd_input(const uint8_t *bytes, size_t nbytes)
_num_channels = channel_count;
rc_input_count++;
ret = true;
_rssi = rssi;
}
nbytes--;
}
@ -478,6 +479,7 @@ bool RCInput::add_st24_input(const uint8_t *bytes, size_t nbytes)
_num_channels = channel_count;
rc_input_count++;
ret = true;
_rssi = rssi;
}
nbytes--;
}

View File

@ -22,6 +22,10 @@ public:
uint16_t read(uint8_t ch);
uint8_t read(uint16_t* periods, uint8_t len);
int16_t get_rssi(void) override {
return _rssi;
}
bool set_overrides(int16_t *overrides, uint8_t len);
bool set_override(uint8_t channel, int16_t override);
void clear_overrides();
@ -93,6 +97,8 @@ protected:
uint8_t partial_frame_count;
uint32_t last_input_ms;
} sbus;
int16_t _rssi = -1;
};
}