From f2e6d77ce4699906630807abc57a61db62ea3867 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Sun, 24 Apr 2022 12:48:06 +0100 Subject: [PATCH] Fix bytes -> data. Expose real codec error. --- chirpstack/src/codec/mod.rs | 6 +----- ui/src/views/device-profiles/CreateDeviceProfile.tsx | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/chirpstack/src/codec/mod.rs b/chirpstack/src/codec/mod.rs index 77f089af..ab617057 100644 --- a/chirpstack/src/codec/mod.rs +++ b/chirpstack/src/codec/mod.rs @@ -74,11 +74,7 @@ pub async fn binary_to_struct( Ok(match codec { Codec::NONE => None, Codec::CAYENNE_LPP => Some(cayenne_lpp::decode(b).context("CayenneLpp decode")?), - Codec::JS => Some( - js::decode(f_port, variables, decoder_config, b) - .await - .context("JavaScript decoder")?, - ), + Codec::JS => Some(js::decode(f_port, variables, decoder_config, b).await?), }) } diff --git a/ui/src/views/device-profiles/CreateDeviceProfile.tsx b/ui/src/views/device-profiles/CreateDeviceProfile.tsx index aebebb0f..c1c27dec 100644 --- a/ui/src/views/device-profiles/CreateDeviceProfile.tsx +++ b/ui/src/views/device-profiles/CreateDeviceProfile.tsx @@ -45,7 +45,7 @@ export function Encode(input) { // Input is an object with the following fields: // - f_port = LoRaWAN fPort // - 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} export function Decode(input) {