Struct resol_vbus::specification::PacketSpec[][src]

pub struct PacketSpec {
    pub packet_id: String,
    pub channel: u8,
    pub destination_address: u16,
    pub source_address: u16,
    pub command: u16,
    pub destination_device: Rc<DeviceSpec>,
    pub source_device: Rc<DeviceSpec>,
    pub name: String,
    pub fields: Vec<PacketFieldSpec>,
}
Expand description

Contains information about a VBus packet and its fields.

Examples

use resol_vbus::{SpecificationFile, Specification, Language};

let spec = Specification::from_file(SpecificationFile::new_default(), Language::De);

let packet_spec = spec.get_packet_spec(0x00, 0x0010, 0x7E11, 0x0100);
assert_eq!("00_0010_7E11_10_0100", packet_spec.packet_id);
assert_eq!(0, packet_spec.channel);
assert_eq!(0x0010, packet_spec.destination_address);
assert_eq!(0x7E11, packet_spec.source_address);
assert_eq!(0x0100, packet_spec.command);
assert_eq!("DFA", packet_spec.destination_device.name);
assert_eq!("DeltaSol MX [Regler]", packet_spec.source_device.name);
assert_eq!("DeltaSol MX [Regler]", packet_spec.name);

Fields

packet_id: String

A packet identifier.

channel: u8

The VBus channel to packet was sent to.

destination_address: u16

The destination VBus address the packet was sent to.

source_address: u16

The source VBus address to packet was send from.

command: u16

The VBus command of the packet.

destination_device: Rc<DeviceSpec>

The DeviceSpec containing information about the destination VBus device.

source_device: Rc<DeviceSpec>

The DeviceSpec containing information about the source VBus device.

name: String

The name of the packet, containing channel, source and optionally destination names.

fields: Vec<PacketFieldSpec>

The fields contained in the frame payload of the VBus packet.

Implementations

Get the position of a PacketFieldSpec by its field ID.

Get a PacketFieldSpec by its position.

Get a PacketFieldSpec by its field ID.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.