kopia lustrzana https://github.com/helium/longfi-arduino
Updates to decoder function for new API endpoint.
rodzic
3c9dbe770c
commit
5a65d1719b
|
@ -46,7 +46,7 @@ In summary, within the Arduino IDE open Boards Manager from Tools > Board menu a
|
||||||
|
|
||||||
The specific details for adding a Mapper or Cargo integration use a different edge node device than the one detailed here. When prompted to add a function decoder, be sure to use the following decoder. Note: This decoder can also be found within this project in the console-decoders directory.
|
The specific details for adding a Mapper or Cargo integration use a different edge node device than the one detailed here. When prompted to add a function decoder, be sure to use the following decoder. Note: This decoder can also be found within this project in the console-decoders directory.
|
||||||
|
|
||||||
```C
|
```JS
|
||||||
function Decoder(bytes, port) {
|
function Decoder(bytes, port) {
|
||||||
var decoded = {};
|
var decoded = {};
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ function Decoder(bytes, port) {
|
||||||
decoded.hdop = bytes[8] / 10.0;
|
decoded.hdop = bytes[8] / 10.0;
|
||||||
decoded.sats = bytes[9];
|
decoded.sats = bytes[9];
|
||||||
|
|
||||||
|
//additional required field
|
||||||
|
decoded.accuracy = 3;
|
||||||
|
|
||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// Decoder for TTGO_TBeam mapping
|
|
||||||
function Decoder(bytes, port) {
|
function Decoder(bytes, port) {
|
||||||
var decoded = {};
|
var decoded = {};
|
||||||
|
|
||||||
|
@ -16,6 +15,9 @@ function Decoder(bytes, port) {
|
||||||
decoded.hdop = bytes[8] / 10.0;
|
decoded.hdop = bytes[8] / 10.0;
|
||||||
decoded.sats = bytes[9];
|
decoded.sats = bytes[9];
|
||||||
|
|
||||||
|
//additional required field
|
||||||
|
decoded.accuracy = 3;
|
||||||
|
|
||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue