dasdigidings / the_things_stack_v3_tabs_decoder

Decoder in javascript for the family of tabs sensors for the things stack v3
GNU Affero General Public License v3.0
14 stars 8 forks source link

Decode uplink data message failure ReferenceError: acc is not defined at decodeUplink (<eval>:155:49(542)) #1

Closed industrialinternet closed 3 years ago

industrialinternet commented 3 years ago

Thanks for this lib using object tracker on v3 and get this error in the console Decode uplink data message failure ReferenceError: acc is not defined at decodeUplink (:155:49(542))

  // Accuracy Measurement
  154     positionAccuracy = input.bytes[10] >> 5;
  155      positionAccuracy = Math.pow(2, parseInt(acc) + 2);

looks like parseInt(acc) and acc isn't defined // changed to this error gone but not sure if this correct!! positionAccuracy = Math.pow(2, parseInt( positionAccuracy) + 2);

Drasek commented 3 years ago

You are right! At first the variable was named acc but i wanted it to be more decribing so i changed it and forgot one instance. Thank you very much for pointing it out! It is fixed now with the new commit. I have no object locator here to test it, i got just a soundlevel, light, presence detection, door & window and humidity sensor to test.