Skip to content

Commit 107b734

Browse files
committed
Relicense to the EUPL
Before I got any further with making this project actually work it's important that we go full communism mode
1 parent b735b08 commit 107b734

14 files changed

+310
-322
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[package]
22
name = "libmbus"
3+
license = "EUPL-1.2"
4+
authors = ["Lexi Robinson <lexi@lexi.org.uk>"]
35
version = "0.1.0"
46
edition = "2021"
57

LICENSE

+287-201
Large diffs are not rendered by default.

src/bin/test_parse.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use libmbus::parse::iec_60870_5_2::{parse_packet, Packet};
176
use std::error;

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
/*
2+
* Copyright 2023 Lexi Robinson
3+
* Licensed under the EUPL-1.2
4+
*/
15
pub mod parse;

src/parse.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
pub mod dib;
176
pub mod error;

src/parse/dib.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use crate::parse::error::{ParseError, Result};
176
use crate::parse::Datagram;

src/parse/error.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use std::{error, fmt};
176

src/parse/iec_60870_5_2.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* Copyright 2024 Lexi Robinson
3+
* Licensed under the EUPL-1.2
4+
*/
15
use winnow::binary::u8 as parse_u8;
26
use winnow::combinator::alt;
37
use winnow::error::ErrMode;

src/parse/manufacturer.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*
165
* Much of the code in this file is based on code from the rSCADA/libmbus
176
* project by Raditex Control AB (c) 2010-2012
@@ -48,7 +37,9 @@ pub fn unpack_manufacturer_code(packed: u16) -> Result<String> {
4837

4938
const fn pack_manufacturer_code(code: &'static str) -> u16 {
5039
let code = code.as_bytes();
51-
let [a, b, c] = *code else { panic!("Code must be 3 bytes") };
40+
let [a, b, c] = *code else {
41+
panic!("Code must be 3 bytes")
42+
};
5243
assert!(
5344
(a as char).is_ascii_uppercase()
5445
&& (b as char).is_ascii_uppercase()

src/parse/types.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use super::error::Result;
176

src/parse/types/date.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use crate::parse::dib::RawDataType;
176
use crate::parse::error::{ParseError, Result};

src/parse/types/lvar.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use encoding_rs::mem::decode_latin1;
176

src/parse/types/number.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use crate::parse::dib::RawDataType;
176
use crate::parse::error::{ParseError, Result};

src/parse/vib.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
/*
22
* Copyright 2023 Lexi Robinson
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
3+
* Licensed under the EUPL-1.2
154
*/
165
use crate::parse::error::{ParseError, Result};
176
use crate::parse::types::lvar::decode_string;

0 commit comments

Comments
 (0)