chirpstack / chirpstack-gateway-bridge

ChirpStack Gateway Bridge abstracts Packet Forwarder protocols into Protobuf or JSON over MQTT.
https://www.chirpstack.io
MIT License
422 stars 270 forks source link

fake rxInfo.Time if empty #2 #109

Closed comet-GmbH closed 5 years ago

comet-GmbH commented 5 years ago

The Semtech packet-forwarder does not fill up the time and tmms fields if the gateway has no GPS.

Does nobody want to get a receive-time ?

This patch is for setting the time from system-time if it is empty. A configuration flag is included to control behavior. Should work on V2 + V3.

Something wrong ?

comet-GmbH commented 5 years ago

For accessing config.C package config needs to be imported. This ends up in import cycle because config imports semtech. Don't know how to prevent this at the moment.

calvernaz commented 5 years ago

Hm, it's unfortunate. I tested before and had no issues but maybe in a different package.

comet-GmbH commented 5 years ago

Found a solution. It looks much better now.

brocaar commented 5 years ago

:+1: this has been merged as https://github.com/brocaar/lora-gateway-bridge/commit/d844441757cb057a4a5b689c2650c34fa4ba10b1.

I do agree that passing the global config might be better, however changing this now while the v3 branch already contains a refactor of this does make it more complex merging your work also into that branch (which I will do shortly). So I have reverted your PR until the point where you pass the setting instead of the config object.