7 stable releases
1.2.2 | Nov 4, 2023 |
---|---|
1.2.1 | Jan 31, 2023 |
1.2.0 | Dec 16, 2022 |
1.1.0 | Nov 28, 2022 |
1.0.0 | Oct 28, 2022 |
#1 in #initial
33KB
506 lines
AEI TAG PARSER
This library provides a way to deserialize RFID AEI tags used in railway industry to identify wagons. It can be used both a CLI util or a library
Usage
CLI
Deserialize one or multiple tags passed as parameters :
# One tag :
$ aei-tag-parser 9EA488C030426A179000000000000331
# Output :
# 9EA488C030426A179000000000000331 : Initials : IOCC Car number : 3088
# Multiple tags :
$ aei-tag-parser 2F3E06C007DB1E139000000000000331 9EA488C030426A179000000000000331 9EA488C5320CC01B9000000000000331
# Output :
# 2F3E06C007DB1E139000000000000331 : Initials : QNSL Car number : 502
# 9EA488C030426A179000000000000331 : Initials : IOCC Car number : 3088
# 9EA488C5320CC01B9000000000000331 : Initials : IOCC Car number : 85123
Tag deserialization from a file :
# tags.txt content :
$ cat tags.txt
# Output :
# 2F3E06C007DB1E139000000000000331
# 9EA488C030426A179000000000000331
# 9EA488C5320CC01B9000000000000331
$ aei-tag-parser -f test.txt
# Output :
# 2F3E06C007DB1E139000000000000331 : Initials : QNSL Car number : 502
# 9EA488C030426A179000000000000331 : Initials : IOCC Car number : 3088
# 9EA488C5320CC01B9000000000000331 : Initials : IOCC Car number : 85123
Tag deserialization from a UNIX pipe :
# tags.txt content :
$ cat tags.txt
# Output :
# 2F3E06C007DB1E139000000000000331
# 9EA488C030426A179000000000000331
# 9EA488C5320CC01B9000000000000331
$ cat tags.txt | aei-tag-parser
# Output :
# 2F3E06C007DB1E139000000000000331 : Initials : QNSL Car number : 502
# 9EA488C030426A179000000000000331 : Initials : IOCC Car number : 3088
# 9EA488C5320CC01B9000000000000331 : Initials : IOCC Car number : 85123
Librairie
This project can also be used as an external library. Documentation is available here : https://docs.rs/aei_tag_parser/latest/aei_tag_parser/
Usage
let tag_str : String = String::from("9EA488C030426A179000000000000331");
let tag : AEITagData = AEITagData::new(&tag_str);
println!("Tag {} content is : \r\n\tInitials: {}\r\n\tCar number: {}", &tag_str, tag.equipment_initial(), tag.car_number());
Install
To install the CLI util, you must have Rust installed (cf RustUp).
Then you can simply do :
$ cargo install aei_tag_parser
Dependencies
~1.8–2.8MB
~49K SLoC