Initial
This commit is contained in:
33
src/enums.rs
Normal file
33
src/enums.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use enum_stringify::EnumStringify;
|
||||
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||
|
||||
/// Message Identifier used in the communication protocol. This is specified by Viessmann
|
||||
/// and UNACKED is rarely to never used.
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, TryFromPrimitive, IntoPrimitive, Clone, Copy, PartialEq, EnumStringify)]
|
||||
pub enum MessageIdentifier {
|
||||
Request = 0x00,
|
||||
Response = 0x01,
|
||||
Unacked = 0x02,
|
||||
CommError = 0x03,
|
||||
}
|
||||
|
||||
/// Function Code used in the communication protocol. This is specified by Viessmann
|
||||
/// and Read and Write are usually used for simpler values, RPC can maybe be used for
|
||||
/// more complex things, but this is currently unclear
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, TryFromPrimitive, IntoPrimitive, Clone, Copy, PartialEq, EnumStringify)]
|
||||
pub enum FunctionCode {
|
||||
VirtualREAD = 0x01,
|
||||
VirtualWRITE = 0x02,
|
||||
RemoteProcedureCall = 0x07,
|
||||
}
|
||||
|
||||
/// Response code used in the communication protocol. This is specified by Viessmann
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, TryFromPrimitive)]
|
||||
pub enum ResponseCode {
|
||||
Ack = 0x06,
|
||||
Nack = 0x15,
|
||||
Enq = 0x05,
|
||||
}
|
||||
Reference in New Issue
Block a user