chirpstack / chirpstack-gateway-bridge

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

Fix: location not passed to MQTT from semtech_udp backend #209

Closed RodionGork closed 2 years ago

RodionGork commented 2 years ago

It is very small fix - when processing push data received from udp in semtech_udp backend, the location is lost.

in backend.go - location just is not copied between two data objects when copying other fields, in handleStats. we can clone it here rather than assign, but since it was freshly created, this makes no difference.

in push_data.go we obviously wanted to check if the whole structure was decoded from JSON and has any non-zero fields, we need OR aggregation here rather than AND - otherwise location is not copied for example if Altitude = 0 which may happen in gateway simulator or even in real device if the field is ignored.

RodionGork commented 2 years ago

Dear Friends, @brocaar and @sagar-patel-sls please have a look at this, if possible. Sorry for disturbing, but of course it would be nice if we can amend it here "in upstream".

sagar-patel-sls commented 2 years ago

Dear Friends, @brocaar and @sagar-patel-sls please have a look at this, if possible. Sorry for disturbing, but of course it would be nice if we can amend it here "in upstream".

Hi @RodionGork thank you for your efforts. Let's wait for @brocaar confirmation/suggestions.