Skip to content

Commit

Permalink
seems it needs more defmt commits, trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Aebli committed Jan 28, 2025
1 parent 22efc96 commit 507902d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "m-bus-parser"
version = "0.0.19"
version = "0.0.20"
edition = "2021"
description = "A library for parsing M-Bus frames"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ keywords = ["m-bus", "parser", "parse", "cli"]


[dependencies]
m-bus-parser = { path = "..", version = "0.0.19", features = ["std", "serde"] }
m-bus-parser = { path = "..", version = "0.0.20", features = ["std", "serde"] }
clap = { version = "4.5.4", features = ["derive"] }
2 changes: 1 addition & 1 deletion examples/cortex-m/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cortex-m = "0.7.7"
cortex-m-rt = "0.7.3"
cortex-m-semihosting = "0.5.0"
panic-halt = "0.2.0"
m-bus-parser = { path = "../../", version = "0.0.19" }
m-bus-parser = { path = "../../", version = "0.0.20" }
# Uncomment for the panic example.
# panic-itm = "0.4.1"

Expand Down
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://maebli.github.io/"
repository = "https://github.com/maebli/m-bus-parser"

[dependencies]
m-bus-parser = { path = "..", version = "0.0.19", features = ["std", "serde"] }
m-bus-parser = { path = "..", version = "0.0.20", features = ["std", "serde"] }
serde_json = "1.0"
pyo3 = { version = "0.23.1", features = ["extension-module","generate-import-lib"] }
hex = "0.4.2"
Expand Down
6 changes: 6 additions & 0 deletions src/user_data/data_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,15 @@ impl std::fmt::Display for Month {
}
}

#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub type Year = u16;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub type DayOfMonth = u8;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub type Hour = u8;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub type Minute = u8;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub type Second = u8;

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down Expand Up @@ -372,6 +377,7 @@ pub enum DataType<'a> {
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(PartialEq, Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct Data<'a> {
pub value: Option<DataType<'a>>,
pub size: usize,
Expand Down
1 change: 1 addition & 0 deletions src/user_data/data_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl<'a> DataRecord<'a> {

#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct DataRecordHeader<'a> {
pub raw_data_record_header: RawDataRecordHeader<'a>,
pub processed_data_record_header: ProcessedDataRecordHeader,
Expand Down
6 changes: 4 additions & 2 deletions src/user_data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub struct DataRecords<'a> {
}

#[cfg(feature = "serde")]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
impl<'a> From<DataRecords<'a>> for Vec<DataRecord<'a>> {
fn from(value: DataRecords<'a>) -> Self {
let value: Result<Vec<_>, _> = value.collect();
Expand Down Expand Up @@ -94,7 +93,6 @@ bitflags::bitflags! {
}

#[cfg(feature = "std")]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
impl fmt::Display for StatusField {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut status = String::new();
Expand Down Expand Up @@ -403,6 +401,7 @@ impl Counter {

#[derive(Debug, PartialEq)]
#[allow(dead_code)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct FixedDataHeder {
identification_number: IdentificationNumber,
manufacturer_code: ManufacturerCode,
Expand Down Expand Up @@ -436,6 +435,7 @@ pub enum UserDataBlock<'a> {
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Medium {
Other,
Oil,
Expand Down Expand Up @@ -542,6 +542,7 @@ pub struct FixedDataHeader {
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct ManufacturerCode {
pub code: [char; 3],
}
Expand Down Expand Up @@ -573,6 +574,7 @@ impl fmt::Display for ManufacturerCode {
}

#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct MeasuredMedium {
pub medium: Medium,
}
Expand Down
3 changes: 3 additions & 0 deletions src/user_data/value_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl ValueInformationFieldExtension {
}

#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ValueInformationCoding {
Primary,
PlainText,
Expand Down Expand Up @@ -832,6 +833,7 @@ fn consume_orthhogonal_vife(
}

#[derive(Debug, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ValueInformationError {
InvalidValueInformation,
}
Expand Down Expand Up @@ -888,6 +890,7 @@ impl fmt::Display for ValueInformation {
}
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ValueLabel {
Instantaneous,
ReservedForObjectActions,
Expand Down

0 comments on commit 507902d

Please sign in to comment.