Commit ae79f041 authored by Alan Mitchell's avatar Alan Mitchell

Added SNR to fields recorded from Things Network.

parent 95f8a19b
......@@ -272,7 +272,14 @@ def store_readings_things(request):
for fld, val in req_data['payload_fields'].items():
if fld not in EXCLUDE_THINGS_FIELDS:
readings.append( [ts, f'{hdw_serial}_{fld}', val] )
# Also extract the max SNR received by gateways that received this
# message
snrs = [gtw['snr'] for gtw in req_data['metadata']['gateways']]
readings.append([ts, f'{hdw_serial}_snr', max(snrs)])
msg = storereads.store_many({'readings': readings})
return HttpResponse(msg)
else:
_logger.warning('Invalid Storage Key in Reading Post: %s', storeKey)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment