mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-18 18:46:24 +00:00
Fix bytes -> data. Expose real codec error.
This commit is contained in:
parent
f5de67a817
commit
f2e6d77ce4
@ -74,11 +74,7 @@ pub async fn binary_to_struct(
|
|||||||
Ok(match codec {
|
Ok(match codec {
|
||||||
Codec::NONE => None,
|
Codec::NONE => None,
|
||||||
Codec::CAYENNE_LPP => Some(cayenne_lpp::decode(b).context("CayenneLpp decode")?),
|
Codec::CAYENNE_LPP => Some(cayenne_lpp::decode(b).context("CayenneLpp decode")?),
|
||||||
Codec::JS => Some(
|
Codec::JS => Some(js::decode(f_port, variables, decoder_config, b).await?),
|
||||||
js::decode(f_port, variables, decoder_config, b)
|
|
||||||
.await
|
|
||||||
.context("JavaScript decoder")?,
|
|
||||||
),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export function Encode(input) {
|
|||||||
// Input is an object with the following fields:
|
// Input is an object with the following fields:
|
||||||
// - f_port = LoRaWAN fPort
|
// - f_port = LoRaWAN fPort
|
||||||
// - variables = Device variables
|
// - variables = Device variables
|
||||||
// - bytes = Input byte array, e.g. [225, 230, 255, 0]
|
// - data = Input byte array, e.g. [225, 230, 255, 0]
|
||||||
//
|
//
|
||||||
// This function must return an object, e.g. {"temperature": 22.5}
|
// This function must return an object, e.g. {"temperature": 22.5}
|
||||||
export function Decode(input) {
|
export function Decode(input) {
|
||||||
|
Loading…
Reference in New Issue
Block a user