This allows nodes to request all different telemetry types based on the variant tag in the payload (closes #4120). I had to decode the payload in allocReply() to check the tag. Also created getTelemetry() methods that return true if there is valid data, which is used in sendTelemetry() and allocReply().
Tested with DeviceMetrics, and also checked that a NAK with NO_RESPONSE is sent when there's no data available. I couldn't easily test real data with Environment, AirQuality and Power, but logic is the same.
Also remove the check for ignoreRequest in allocReply(). The logic is that a module can set it to true to avoid sending the NAK (e.g. for NodeInfo). So it doesn't need to check the value, because it's always false at the beginning.
This allows nodes to request all different telemetry types based on the variant tag in the payload (closes #4120). I had to decode the payload in
allocReply()
to check the tag. Also createdgetTelemetry()
methods that returntrue
if there is valid data, which is used insendTelemetry()
andallocReply()
.Tested with DeviceMetrics, and also checked that a NAK with
NO_RESPONSE
is sent when there's no data available. I couldn't easily test real data with Environment, AirQuality and Power, but logic is the same.Also remove the check for
ignoreRequest
inallocReply()
. The logic is that a module can set it to true to avoid sending the NAK (e.g. for NodeInfo). So it doesn't need to check the value, because it's alwaysfalse
at the beginning.