Struct resol_vbus::specification_file::SpecificationFile
[−]
[src]
pub struct SpecificationFile { pub datecode: i32, pub texts: Vec<String>, pub localized_texts: Vec<LocalizedText>, pub units: Vec<Unit>, pub device_templates: Vec<DeviceTemplate>, pub packet_templates: Vec<PacketTemplate>, }
Contains the information from a VSF1 file.
Fields
datecode: i32
Date of VSF creation in format 'YYYMMDD'
texts: Vec<String>
List of texts.
localized_texts: Vec<LocalizedText>
List of localized texts.
units: Vec<Unit>
List of units.
device_templates: Vec<DeviceTemplate>
List of device templates.
packet_templates: Vec<PacketTemplate>
List of packet templates.
Methods
impl SpecificationFile
[src]
fn from_bytes(bytes: &[u8]) -> Result<SpecificationFile>
Construct a new SpecificationFile
from a byte slice of VSF1 data.
fn text_by_index(&self, idx: &TextIndex) -> &str
Get text by its index.
fn localized_text_by_index(
&self,
idx: &LocalizedTextIndex,
language: &Language
) -> &str
&self,
idx: &LocalizedTextIndex,
language: &Language
) -> &str
Get localized text by its index and language.
fn unit_family_by_id(&self, id: &UnitFamilyId) -> UnitFamily
Get UnitFamily
by its ID.
fn unit_by_id(&self, id: &UnitId) -> &Unit
Get Unit
by its index.
fn type_by_id(&self, id: &TypeId) -> Type
Get Type
by its ID.
fn find_device_template(
&self,
self_address: u16,
peer_address: u16
) -> Option<&DeviceTemplate>
&self,
self_address: u16,
peer_address: u16
) -> Option<&DeviceTemplate>
Find a DeviceTemplate
matching the self and peer addresses.
fn find_packet_template(
&self,
destination_address: u16,
source_address: u16,
command: u16
) -> Option<&PacketTemplate>
&self,
destination_address: u16,
source_address: u16,
command: u16
) -> Option<&PacketTemplate>
Find a PacketTemplate
matching the self and peer addresses as well as the command.