Compare commits

...

7 Commits

16 changed files with 27 additions and 61 deletions

8
Cargo.lock generated
View File

@ -635,7 +635,7 @@ dependencies = [
[[package]]
name = "backend"
version = "4.0.0-rc.4"
version = "4.0.0"
dependencies = [
"aes-kw",
"anyhow",
@ -879,7 +879,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chirpstack"
version = "4.0.0-rc.4"
version = "4.0.0"
dependencies = [
"aes 0.7.5",
"anyhow",
@ -958,7 +958,7 @@ dependencies = [
[[package]]
name = "chirpstack_api"
version = "4.0.0-rc.4"
version = "4.0.0"
dependencies = [
"hex",
"pbjson",
@ -2222,7 +2222,7 @@ dependencies = [
[[package]]
name = "lrwn"
version = "4.0.0-rc.4"
version = "4.0.0"
dependencies = [
"aes 0.7.5",
"anyhow",

View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api-grpc-web",
"version": "4.0.0-rc.4",
"version": "4.0.0",
"description": "Chirpstack gRPC-web API",
"license": "MIT",
"devDependencies": {

2
api/js/package.json vendored
View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api",
"version": "4.0.0-rc.4",
"version": "4.0.0",
"description": "Chirpstack JS and TS API",
"license": "MIT",
"devDependencies": {

View File

@ -18,7 +18,7 @@ CLASSIFIERS = [
setup(
name='chirpstack-api',
version = "4.0.0-rc.4",
version = "4.0.0",
url='https://github.com/brocaar/chirpstack-api',
author='Orne Brocaar',
author_email='info@brocaar.com',

2
api/rust/Cargo.toml vendored
View File

@ -1,7 +1,7 @@
[package]
name = "chirpstack_api"
description = "ChirpStack Protobuf / gRPC API definitions."
version = "4.0.0-rc.4"
version = "4.0.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
license = "MIT"
homepage = "https://www.chirpstack.io"

View File

@ -1,6 +1,6 @@
[package]
name = "backend"
version = "4.0.0-rc.4"
version = "4.0.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
publish = false

View File

@ -3,7 +3,7 @@ name = "chirpstack"
description = "ChirpStack is an open-source LoRaWAN(TM) Network Server"
repository = "https://github.com/chirpstack/chirpstack"
homepage="https://www.chirpstack.io/"
version = "4.0.0-rc.4"
version = "4.0.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2021"
publish = false

View File

@ -170,7 +170,11 @@ pub async fn encode(
}
}
let v: Vec<u8> = res.get("bytes")?;
// Directly into u8 can result into the following error:
// Error converting from js 'float' into type 'i32'
let v: Vec<f64> = res.get("bytes")?;
let v: Vec<u8> = v.iter().map(|v| *v as u8).collect();
Ok(v)
})
}

View File

@ -89,52 +89,10 @@ pub async fn struct_to_binary(
Ok(match codec {
Codec::NONE => Vec::new(),
Codec::CAYENNE_LPP => cayenne_lpp::encode(obj).context("CayenneLpp encode")?,
Codec::JS => js::encode(f_port, variables, encoder_config, obj)
.await
.context("JavaScript encoder")?,
Codec::JS => js::encode(f_port, variables, encoder_config, obj).await?,
})
}
/*
pub fn get_data_keys(s: &pbjson_types::Struct) -> Vec<String> {
let mut out: Vec<String> = Vec::new();
for (k, v) in &s.fields {
out.extend_from_slice(&_get_data_keys(k, v));
}
out
}
fn _get_data_keys(prefix: &str, v: &pbjson_types::Value) -> Vec<String> {
match &v.kind {
None => vec![prefix.to_string()],
Some(v) => match v {
pbjson_types::value::Kind::NullValue(_)
| pbjson_types::value::Kind::NumberValue(_)
| pbjson_types::value::Kind::StringValue(_)
| pbjson_types::value::Kind::BoolValue(_) => {
vec![prefix.to_string()]
}
pbjson_types::value::Kind::StructValue(v) => {
let mut out: Vec<String> = Vec::new();
for (k, v) in &v.fields {
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, k), v));
}
out
}
pbjson_types::value::Kind::ListValue(v) => {
let mut out: Vec<String> = Vec::new();
for (i, v) in v.values.iter().enumerate() {
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, i), v));
}
out
}
},
}
}
*/
pub fn get_measurements(s: &pbjson_types::Struct) -> HashMap<String, pbjson_types::value::Kind> {
let mut out: HashMap<String, pbjson_types::value::Kind> = HashMap::new();

View File

@ -157,7 +157,7 @@ impl<'a> MqttBackend<'a> {
if !conf.ca_cert.is_empty() {
ssl_opts_b
.ca_path(&conf.ca_cert)
.trust_store(&conf.ca_cert)
.context("Failed to set gateway ca_cert")?;
}

View File

@ -3,7 +3,7 @@ name = "lrwn"
description = "Library for encoding / decoding LoRaWAN frames."
homepage = "https://www.chirpstack.io"
license = "MIT"
version = "4.0.0-rc.4"
version = "4.0.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
repository = "https://github.com/chirpstack/chirpstack"

View File

@ -1,6 +1,6 @@
{
"name": "chirpstack-ui",
"version": "4.0.0-rc.4",
"version": "4.0.0",
"private": true,
"dependencies": {
"@ant-design/colors": "^6.0.0",

View File

@ -17,10 +17,13 @@ interface IProps {
class MetricChart extends Component<IProps> {
render() {
let unit: TimeUnit = "hour";
let tooltipFormat = "LT";
if (this.props.aggregation === Aggregation.DAY) {
unit = "day";
tooltipFormat = "MMM Do";
} else if (this.props.aggregation === Aggregation.MONTH) {
unit = "month";
tooltipFormat = "MMM YYYY";
}
const animation: false = false;
@ -41,6 +44,7 @@ class MetricChart extends Component<IProps> {
type: "time" as const,
time: {
unit: unit,
tooltipFormat: tooltipFormat,
},
},
},

View File

@ -34,7 +34,7 @@ class CreateDeviceProfileTemplate extends Component<RouteComponentProps> {
// - data = Object representing the decoded payload.
function decodeUplink(input) {
return {
object: {
data: {
temp: 22.5
}
};
@ -50,7 +50,7 @@ function decodeUplink(input) {
// - bytes = Byte array containing the downlink payload.
function encodeDownlink(input) {
return {
data: [225, 230, 255, 0]
bytes: [225, 230, 255, 0]
};
}
`;

View File

@ -59,7 +59,7 @@ function decodeUplink(input) {
// - bytes = Byte array containing the downlink payload.
function encodeDownlink(input) {
return {
data: [225, 230, 255, 0]
bytes: [225, 230, 255, 0]
};
}
`;

View File

@ -1881,7 +1881,7 @@
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@chirpstack/chirpstack-api-grpc-web@file:../api/grpc-web":
version "4.0.0-rc.3"
version "4.0.0-rc.4"
dependencies:
"@types/google-protobuf" "^3.15.2"
google-protobuf "^3.17.3"