Merge pull request #272 from euquiq/RADIOSONDE_METEOMAN_LAT_LON_BUG_FIX

Fix bug on radiosonde Meteoman Lat & lon calculation
This commit is contained in:
Erwin Ried
2021-03-15 11:44:21 +01:00
committed by GitHub

View File

@@ -49,7 +49,7 @@ public:
/* The "start_bit" winds up being the MSB of the returned field value. */ /* The "start_bit" winds up being the MSB of the returned field value. */
/* The BitRemap functor determines which bits are read from the source /* The BitRemap functor determines which bits are read from the source
* packet. */ * packet. */
uint32_t read(const size_t start_bit, const size_t length) const { int32_t read(const size_t start_bit, const size_t length) const { //Euquiq: was uint32_t, used for calculating lat / lon in radiosondes, can be negative too
uint32_t value = 0; uint32_t value = 0;
for(size_t i=start_bit; i<(start_bit + length); i++) { for(size_t i=start_bit; i<(start_bit + length); i++) {
value = (value << 1) | data[bit_remap(i)]; value = (value << 1) | data[bit_remap(i)];