Skip to content

Commit

Permalink
dronecan 1140.RCInput: add flags to represent LQ, RSSi dbm and SNR li…
Browse files Browse the repository at this point in the history
…nk statistics
  • Loading branch information
olliw42 committed Oct 10, 2024
1 parent 993be80 commit e5fd0de
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions dronecan/sensors/rc/1140.RCInput.uavcan
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
uint8 STATUS_QUALITY_VALID = 1 # quality field is valid
#
# RC channels
#
# The quality field can carry different information on the quality of a radio link, as determined by the flags in the status bitmask:
# - STATUS_QUALITY_VALID: The quality field is valid and represents RSSI in scaled units, 0 is no signal, 255 is "full" signal. The
# mapping of a link's internal RSSI representation onto the scaled units is device dependent. A common mapping can be
# RSSI >= -50 dB: 255
# RSSI > -120 dB and RSSI < -50 dBm: 255 / 70 * (RSSI + 120) but not smaller than 1
# RSSI <= -120 dB: 1
# - STATUS_QUALITY_LQ: The quality field is valid and represents LQ in percent, 0 is no signal, 100 is 100% link quality
# - STATUS_QUALITY_RSSI_DBM: The quality field is valid and represents RSSI in inverted dBm, 0 is no signal, 1 = -1 dBm, 255 = -255 dBm
# - STATUS_QUALITY_SNR: The quality field is valid and represents SNR in device dependent units, value is shifted by 128 to allow
# representing positive and negative values: 128 = 0, 255 = +127, 1 = -127, 0 is no signal
# Only one of these flags can be set at any time.

uint8 STATUS_QUALITY_VALID = 1 # quality field is valid and represents RSSI in scaled uints, 0 is no signal, 255 is "full" signal
uint8 STATUS_FAILSAFE = 2 # receiver has lost contact with transmitter
uint8 STATUS_QUALITY_LQ = 4 # quality field is valid and represents LQ in percent, 0 is no signal, 100 is 100% link quality
uint8 STATUS_QUALITY_RSSI_DBM = 8 # rssi in inverted dBm, 0 is no signal, 1 = -1 dBm, 255 = -255 dBm
uint8 STATUS_QUALITY_SNR = 16 # quality field is valid and represents SNR in device dependent units, shifted by 128

uint16 status # bitmask of status bits, enumerated above with STATUS_*

uint8 quality # scaled, 0 is no signal, 255 is "full" signal
uint8 quality # see descriptions for status bits STATUS_QUALITY_VALID, STATUS_QUALITY_LQ, STATUS_QUALITY_SNR
uint4 id # ID of this RC input device

uint12[<=32] rcin # RC channel values between 0 and 4095
uint12[<=32] rcin # RC channel values between 0 and 4095, 2048 represents the mid position

0 comments on commit e5fd0de

Please sign in to comment.