fix: up to spec

This commit is contained in:
Strix 2023-12-04 14:02:53 +01:00
parent c0929538d2
commit a62fd81bf2
No known key found for this signature in database
GPG key ID: 5F35B3B8537287A7
6 changed files with 7 additions and 8 deletions

View file

@ -7,7 +7,7 @@ use crate::packet::packet_data::PacketData;
pub mod vec;
pub mod errors;
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum NodeManagementCommand {
Ping,
RegisterNode { device_id: Identifier },

View file

@ -8,7 +8,7 @@ use std::io;
pub mod vec;
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PropertyControlCommand {
Register {
property_name: String,

View file

@ -7,7 +7,7 @@ use crate::{
pub mod vec;
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum RawDataTransmission {
SetupTransmission {
/// The total size of the data being sent.

View file

@ -1,7 +1,6 @@
use std::io;
use crate::data_types::{DataType, get_data_types};
use crate::identifier::{Identifier, self};
use crate::prelude::as_u64_be;
use crate::identifier::Identifier;
impl Into<Vec<u8>> for DataType {
fn into(self) -> Vec<u8> {

View file

@ -17,7 +17,7 @@ pub const FULL_PACKET_SIZE: usize = 65559;
pub const BASE_PACKET_SIZE: usize = 65555;
/// The abstraction for all DomoProto packets.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Packet {
pub dest: Identifier,
pub src: Identifier,
@ -40,7 +40,7 @@ impl Default for Packet {
command: 0x00,
packet_id: Identifier::random(),
reply_to: Identifier::default(),
data: PacketData::Unknown(vec![])
data: PacketData::NodeManagement(crate::commands::node_management::NodeManagementCommand::Ping)
}
}
}

View file

@ -5,7 +5,7 @@ use crate::commands::raw_data_transmission::RawDataTransmission;
use crate::packet::raw_packet::RawPacket;
/// Abstraction used for interpreting the data in a packet.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PacketData {
NodeManagement(NodeManagementCommand),
PropertyControl(PropertyControlCommand),