aei_tag_parser

Crates.ioaei_tag_parser
lib.rsaei_tag_parser
version1.2.2
sourcesrc
created_at2022-10-28 15:52:44.872701
updated_at2023-11-04 07:06:40.987998
descriptionA simple tool and library to parse AEI RFID tags
homepagehttps://github.com/tbornon/aei-tag-parser
repositoryhttps://github.com/tbornon/aei-tag-parser
max_upload_size
id700505
size38,139
Théophile Bornon (tbornon)

documentation

https://docs.rs/aei_tag_parser/latest/aei_tag_parser

README

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
Commit count: 12

cargo fmt