Enum resol_vbus::specification_file::Language
source · pub enum Language {
En,
De,
Fr,
}
Expand description
Languages supported by VSF1 specification.
Examples
use resol_vbus::{Specification, SpecificationFile, Language};
let get_loc_text = |language| {
// Create a new `Specification` for the provided language
let spec = Specification::from_file(SpecificationFile::new_default(), language);
// Get the `PacketSpec` for the standard info packet of the "DeltaSol MX"
let packet_spec = spec.get_packet_spec(0x11, 0x0010, 0x7E11, 0x0100);
// Get the first `PacketFieldSpec`'s name.
packet_spec.get_field_spec("000_2_0").map(|field_spec| field_spec.name.clone()).unwrap()
};
assert_eq!("Temperature sensor 1", get_loc_text(Language::En));
assert_eq!("Temperatur Sensor 1", get_loc_text(Language::De));
assert_eq!("Température sonde 1", get_loc_text(Language::Fr));