Actualizar lsn50-v2-xkc-y25-v-drainage/docs/decoder-pa12.md
This commit is contained in:
parent
45ced2c42b
commit
3dc0632ab1
@ -13,8 +13,31 @@ Expresión correcta:
|
|||||||
```js
|
```js
|
||||||
const byte6 = (b.length > 6) ? b[6] : 0x00;
|
const byte6 = (b.length > 6) ? b[6] : 0x00;
|
||||||
const pa12 = (byte6 & 0x02) ? 1 : 0;
|
const pa12 = (byte6 & 0x02) ? 1 : 0;
|
||||||
|
````
|
||||||
|
|
||||||
|
## Lo que se descartó
|
||||||
|
|
||||||
|
Se descartó el uso de `byte5` como indicador fiable del estado de `PA12`.
|
||||||
|
|
||||||
|
Durante una fase del diagnóstico parecía que dos tramas diferían en `byte5`, pero la prueba determinista sin sensor demostró que ese byte variaba por otros motivos y no era el bit correcto.
|
||||||
|
|
||||||
|
## Prueba determinista que cerró el diagnóstico
|
||||||
|
|
||||||
|
### Forzando `PA12` a `VDD`
|
||||||
|
|
||||||
|
* `raw_hex: "0e647fff003f02ffffffff"`
|
||||||
|
* `byte6 = 0x02`
|
||||||
|
* `PA12 = 1`
|
||||||
|
|
||||||
|
### Forzando `PA12` a `GND`
|
||||||
|
|
||||||
|
* `raw_hex: "0e647fff003700ffffffff"`
|
||||||
|
* `byte6 = 0x00`
|
||||||
|
* `PA12 = 0`
|
||||||
|
|
||||||
|
## Decoder limpio mínimo
|
||||||
|
|
||||||
|
```js
|
||||||
function decodeUplink(input) {
|
function decodeUplink(input) {
|
||||||
const b = input.bytes;
|
const b = input.bytes;
|
||||||
const byte6 = (b.length > 6) ? b[6] : 0;
|
const byte6 = (b.length > 6) ? b[6] : 0;
|
||||||
@ -30,3 +53,11 @@ function decodeUplink(input) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Conclusión
|
||||||
|
|
||||||
|
En este kit:
|
||||||
|
|
||||||
|
* `byte6 = 0x02` -> `drenaje = 1`
|
||||||
|
* `byte6 = 0x00` -> `drenaje = 0`
|
||||||
Loading…
x
Reference in New Issue
Block a user