From cc1ec56b335c73d5a534221256dadd590640a749 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 25 Jul 2023 00:42:31 +0200 Subject: [PATCH 1/9] change for common pdu conf --- CHANGELOG.md | 2 ++ src/cfdp/pdu/file_data.rs | 10 ++++---- src/cfdp/pdu/mod.rs | 49 ++++++++++++++++++++++++++------------- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 646a7db..29ab0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). classes. The old `PusTm` class is deprecated now. - Implement `Display` and `Error` for `StdTimestampError` properly. - Remove some redundant `Error` suffixes for enum error variants. +- `CommonPduConfig`: `new_with_defaults` replaced by `new_with_byte_fields` + and `new_with_defaults` has not empty argument list. ## Added diff --git a/src/cfdp/pdu/file_data.rs b/src/cfdp/pdu/file_data.rs index ee6846c..bcc214f 100644 --- a/src/cfdp/pdu/file_data.rs +++ b/src/cfdp/pdu/file_data.rs @@ -235,7 +235,7 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_num = UbfU8::new(3); let common_conf = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num).unwrap(); + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num).unwrap(); let pdu_header = PduHeader::new_for_file_data_default(common_conf, 0); let file_data: [u8; 4] = [1, 2, 3, 4]; let fd_pdu = FileDataPdu::new_no_seg_metadata(pdu_header, 10, &file_data); @@ -254,7 +254,7 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_num = UbfU8::new(3); let common_conf = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num).unwrap(); + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num).unwrap(); let pdu_header = PduHeader::new_for_file_data_default(common_conf, 0); let file_data: [u8; 4] = [1, 2, 3, 4]; let fd_pdu = FileDataPdu::new_no_seg_metadata(pdu_header, 10, &file_data); @@ -289,7 +289,7 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_num = UbfU8::new(3); let common_conf = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num).unwrap(); + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num).unwrap(); let pdu_header = PduHeader::new_for_file_data_default(common_conf, 0); let file_data: [u8; 4] = [1, 2, 3, 4]; let fd_pdu = FileDataPdu::new_no_seg_metadata(pdu_header, 10, &file_data); @@ -307,7 +307,7 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_num = UbfU8::new(3); let common_conf = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num).unwrap(); + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num).unwrap(); let pdu_header = PduHeader::new_for_file_data( common_conf, 0, @@ -372,7 +372,7 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_num = UbfU8::new(3); let common_conf = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num).unwrap(); + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num).unwrap(); let pdu_header = PduHeader::new_for_file_data( common_conf, 0, diff --git a/src/cfdp/pdu/mod.rs b/src/cfdp/pdu/mod.rs index adaa6c4..1321cd7 100644 --- a/src/cfdp/pdu/mod.rs +++ b/src/cfdp/pdu/mod.rs @@ -1,6 +1,6 @@ //! CFDP Packet Data Unit (PDU) support. use crate::cfdp::*; -use crate::util::{UnsignedByteField, UnsignedEnum}; +use crate::util::{UnsignedByteField, UnsignedByteFieldU8, UnsignedEnum}; use crate::CRC_CCITT_FALSE; use crate::{ByteConversionError, SizeMissmatch}; use core::fmt::{Display, Formatter}; @@ -204,7 +204,7 @@ impl CommonPduConfig { }) } - pub fn new_with_defaults( + pub fn new_with_byte_fields( source_id: impl Into, dest_id: impl Into, transaction_seq_num: impl Into, @@ -220,6 +220,20 @@ impl CommonPduConfig { ) } + /// The defaults for the source ID, destination ID and the transaction sequence number is the + /// [UnsignedByteFieldU8] with an intitial value of 0 + pub fn new_with_defaults() -> Result { + Self::new( + UnsignedByteFieldU8::new(0), + UnsignedByteFieldU8::new(0), + UnsignedByteFieldU8::new(0), + TransmissionMode::Acknowledged, + LargeFileFlag::Normal, + CrcFlag::NoCrc, + Direction::TowardsReceiver, + ) + } + pub fn source_id(&self) -> UnsignedByteField { self.source_entity_id } @@ -574,8 +588,9 @@ mod tests { let src_id = UbfU8::new(5); let dest_id = UbfU8::new(10); let transaction_seq_num = UbfU8::new(20); - let mut pdu_conf = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_num) - .expect("Generating common PDU config"); + let mut pdu_conf = + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_num) + .expect("Generating common PDU config"); pdu_conf.crc_flag = crc_flag; pdu_conf.file_flag = fss; pdu_conf @@ -647,7 +662,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); assert_eq!(pdu_header.pdu_type(), PduType::FileDirective); @@ -671,7 +686,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; @@ -687,7 +702,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; @@ -706,7 +721,7 @@ mod tests { let dest_id = UnsignedByteFieldU16::new(0x0203); let transaction_id = UnsignedByteFieldU16::new(0x0405); let mut common_pdu_cfg = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); common_pdu_cfg.crc_flag = CrcFlag::WithCrc; common_pdu_cfg.direction = Direction::TowardsSender; @@ -733,7 +748,7 @@ mod tests { let dest_id = UnsignedByteFieldU16::new(0x0203); let transaction_id = UnsignedByteFieldU16::new(0x0405); let mut common_pdu_cfg = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); common_pdu_cfg.crc_flag = CrcFlag::WithCrc; common_pdu_cfg.direction = Direction::TowardsSender; @@ -760,7 +775,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; @@ -799,7 +814,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; @@ -822,7 +837,8 @@ mod tests { let dest_id = UbfU8::new(2); let transaction_seq_id = UbfU8::new(3); let invalid_byte_field = UnsignedByteField::new(3, 5); - let pdu_conf_res = CommonPduConfig::new_with_defaults(src_id, dest_id, invalid_byte_field); + let pdu_conf_res = + CommonPduConfig::new_with_byte_fields(src_id, dest_id, invalid_byte_field); assert!(pdu_conf_res.is_err()); let error = pdu_conf_res.unwrap_err(); if let PduError::InvalidTransactionSeqNumLen(len) = error { @@ -830,7 +846,7 @@ mod tests { } else { panic!("Invalid exception: {}", error) } - let pdu_conf_res = CommonPduConfig::new_with_defaults( + let pdu_conf_res = CommonPduConfig::new_with_byte_fields( invalid_byte_field, invalid_byte_field, transaction_seq_id, @@ -848,7 +864,8 @@ mod tests { let src_id = UnsignedByteField::new(1, 5); let dest_id = UnsignedByteField::new(2, 5); let transaction_seq_id = UbfU8::new(3); - let pdu_conf_res = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_seq_id); + let pdu_conf_res = + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_seq_id); assert!(pdu_conf_res.is_err()); let error = pdu_conf_res.unwrap_err(); if let PduError::SourceDestIdLenMissmatch((src_len, dest_len)) = error { @@ -862,7 +879,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; @@ -886,7 +903,7 @@ mod tests { let src_id = UnsignedByteFieldU8::new(1); let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); - let common_pdu_cfg = CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + let common_pdu_cfg = CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let pdu_header = PduHeader::new_no_file_data(common_pdu_cfg, 5); let mut buf: [u8; 7] = [0; 7]; From 041959e546e6e72b24eb50986c425a924015e3f4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Jul 2023 22:00:03 +0200 Subject: [PATCH 2/9] no error handling necessary here --- src/cfdp/pdu/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cfdp/pdu/mod.rs b/src/cfdp/pdu/mod.rs index 1321cd7..b18a058 100644 --- a/src/cfdp/pdu/mod.rs +++ b/src/cfdp/pdu/mod.rs @@ -222,7 +222,8 @@ impl CommonPduConfig { /// The defaults for the source ID, destination ID and the transaction sequence number is the /// [UnsignedByteFieldU8] with an intitial value of 0 - pub fn new_with_defaults() -> Result { + pub fn new_with_defaults() -> Self { + // new can not fail for these input parameters Self::new( UnsignedByteFieldU8::new(0), UnsignedByteFieldU8::new(0), @@ -231,7 +232,7 @@ impl CommonPduConfig { LargeFileFlag::Normal, CrcFlag::NoCrc, Direction::TowardsReceiver, - ) + ).unwrap() } pub fn source_id(&self) -> UnsignedByteField { From c65a024d9718d1521e4d82f47d9e8f3835a93657 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Jul 2023 22:53:05 +0200 Subject: [PATCH 3/9] make metadata params accessible --- src/cfdp/pdu/metadata.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cfdp/pdu/metadata.rs b/src/cfdp/pdu/metadata.rs index fbdb982..f8e4be7 100644 --- a/src/cfdp/pdu/metadata.rs +++ b/src/cfdp/pdu/metadata.rs @@ -14,9 +14,9 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MetadataGenericParams { - closure_requested: bool, - checksum_type: ChecksumType, - file_size: u64, + pub closure_requested: bool, + pub checksum_type: ChecksumType, + pub file_size: u64, } impl MetadataGenericParams { @@ -145,6 +145,10 @@ impl<'src_name, 'dest_name, 'opts> MetadataPdu<'src_name, 'dest_name, 'opts> { pdu } + pub fn metadata_params(&self) -> &MetadataGenericParams { + &self.metadata_params + } + pub fn src_file_name(&self) -> Lv<'src_name> { self.src_file_name } From 105c598c53b44dbfd946997a59ad07812e5f3a27 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 Jul 2023 23:27:40 +0200 Subject: [PATCH 4/9] some more extensions for PDU impl --- src/cfdp/mod.rs | 6 ++++++ src/cfdp/pdu/metadata.rs | 2 +- src/cfdp/pdu/mod.rs | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cfdp/mod.rs b/src/cfdp/mod.rs index b6c082f..27e5524 100644 --- a/src/cfdp/mod.rs +++ b/src/cfdp/mod.rs @@ -134,6 +134,12 @@ pub enum ChecksumType { NullChecksum = 15, } +impl Default for ChecksumType { + fn default() -> Self { + Self::NullChecksum + } +} + pub const NULL_CHECKSUM_U32: [u8; 4] = [0; 4]; #[derive(Debug, Copy, Clone, PartialEq, Eq)] diff --git a/src/cfdp/pdu/metadata.rs b/src/cfdp/pdu/metadata.rs index f8e4be7..2e3b5f0 100644 --- a/src/cfdp/pdu/metadata.rs +++ b/src/cfdp/pdu/metadata.rs @@ -11,7 +11,7 @@ use alloc::vec::Vec; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct MetadataGenericParams { pub closure_requested: bool, diff --git a/src/cfdp/pdu/mod.rs b/src/cfdp/pdu/mod.rs index b18a058..4723431 100644 --- a/src/cfdp/pdu/mod.rs +++ b/src/cfdp/pdu/mod.rs @@ -232,7 +232,8 @@ impl CommonPduConfig { LargeFileFlag::Normal, CrcFlag::NoCrc, Direction::TowardsReceiver, - ).unwrap() + ) + .unwrap() } pub fn source_id(&self) -> UnsignedByteField { From 20584b45cad424fe3823fbcc7d3e10dc6a88bf97 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Aug 2023 18:17:32 +0200 Subject: [PATCH 5/9] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29ab0c0..f227e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). call `user_data` but are also in line with the PUS packet standard names for those fields. - Added new marker trait `IsPusTelemetry` implemented by `PusTmCreator` and `PusTmReader`. - Added new marker trait `IsPusTelecommand` implemented by `PusTcCreator` and `PusTcReader`. +- `metadata_param` getter method for the `MetadataPdu` object. + +## Fixed + +- All `MetadataGenericParam` fields are now public. # [v0.6.0] 2023-07-06 From 85476162cf40a49c4bb0be30dc5558f9e2621ac9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Aug 2023 20:03:50 +0200 Subject: [PATCH 6/9] missing changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f227e87..de45bc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added new marker trait `IsPusTelemetry` implemented by `PusTmCreator` and `PusTmReader`. - Added new marker trait `IsPusTelecommand` implemented by `PusTcCreator` and `PusTcReader`. - `metadata_param` getter method for the `MetadataPdu` object. +- `Default` impl for CFDP `ChecksumType` ## Fixed From fd893fbf8932fde79774dd3bdd41396ff8587880 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Aug 2023 20:08:25 +0200 Subject: [PATCH 7/9] changelog fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de45bc9..1929b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Implement `Display` and `Error` for `StdTimestampError` properly. - Remove some redundant `Error` suffixes for enum error variants. - `CommonPduConfig`: `new_with_defaults` replaced by `new_with_byte_fields` - and `new_with_defaults` has not empty argument list. + and `new_with_defaults` has now empty argument list. ## Added From a3da71668f7c340e461d9d869b6113d52c3ea306 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Aug 2023 20:22:07 +0200 Subject: [PATCH 8/9] also added a unittest --- CHANGELOG.md | 4 ++-- src/cfdp/pdu/mod.rs | 34 ++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1929b42..b9cd641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). classes. The old `PusTm` class is deprecated now. - Implement `Display` and `Error` for `StdTimestampError` properly. - Remove some redundant `Error` suffixes for enum error variants. -- `CommonPduConfig`: `new_with_defaults` replaced by `new_with_byte_fields` - and `new_with_defaults` has now empty argument list. +- `CommonPduConfig`: `new_with_defaults` replaced by `new_with_byte_fields`. ## Added @@ -33,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added new marker trait `IsPusTelecommand` implemented by `PusTcCreator` and `PusTcReader`. - `metadata_param` getter method for the `MetadataPdu` object. - `Default` impl for CFDP `ChecksumType` +- `Default` impl for CFDP `CommonPduConfig` ## Fixed diff --git a/src/cfdp/pdu/mod.rs b/src/cfdp/pdu/mod.rs index 4723431..8681242 100644 --- a/src/cfdp/pdu/mod.rs +++ b/src/cfdp/pdu/mod.rs @@ -220,10 +220,20 @@ impl CommonPduConfig { ) } + pub fn source_id(&self) -> UnsignedByteField { + self.source_entity_id + } + + pub fn dest_id(&self) -> UnsignedByteField { + self.dest_entity_id + } +} + +impl Default for CommonPduConfig { /// The defaults for the source ID, destination ID and the transaction sequence number is the /// [UnsignedByteFieldU8] with an intitial value of 0 - pub fn new_with_defaults() -> Self { - // new can not fail for these input parameters + fn default() -> Self { + // The new function can not fail for these input parameters. Self::new( UnsignedByteFieldU8::new(0), UnsignedByteFieldU8::new(0), @@ -235,14 +245,6 @@ impl CommonPduConfig { ) .unwrap() } - - pub fn source_id(&self) -> UnsignedByteField { - self.source_entity_id - } - - pub fn dest_id(&self) -> UnsignedByteField { - self.dest_entity_id - } } pub const FIXED_HEADER_LEN: usize = 4; @@ -683,6 +685,18 @@ mod tests { assert_eq!(pdu_header.header_len(), 7); } + #[test] + fn test_basic_state_default() { + let default_conf = CommonPduConfig::default(); + assert_eq!(default_conf.source_id(), UnsignedByteFieldU8::new(0).into()); + assert_eq!(default_conf.dest_id(), UnsignedByteFieldU8::new(0).into()); + assert_eq!(default_conf.transaction_seq_num, UnsignedByteFieldU8::new(0).into()); + assert_eq!(default_conf.trans_mode, TransmissionMode::Acknowledged); + assert_eq!(default_conf.direction, Direction::TowardsReceiver); + assert_eq!(default_conf.crc_flag, CrcFlag::NoCrc); + assert_eq!(default_conf.file_flag, LargeFileFlag::Normal); + } + #[test] fn test_serialization_1() { let src_id = UnsignedByteFieldU8::new(1); From a3bab2619ca300511831037df8e6e8f28db5c17d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 10 Aug 2023 21:28:27 +0200 Subject: [PATCH 9/9] compile fix --- src/cfdp/pdu/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfdp/pdu/mod.rs b/src/cfdp/pdu/mod.rs index 832e925..c0e1e20 100644 --- a/src/cfdp/pdu/mod.rs +++ b/src/cfdp/pdu/mod.rs @@ -723,7 +723,7 @@ mod tests { let dest_id = UnsignedByteFieldU8::new(2); let transaction_id = UnsignedByteFieldU8::new(3); let mut common_pdu_cfg = - CommonPduConfig::new_with_defaults(src_id, dest_id, transaction_id) + CommonPduConfig::new_with_byte_fields(src_id, dest_id, transaction_id) .expect("common config creation failed"); let other_src_id = UnsignedByteFieldU16::new(5); let other_dest_id = UnsignedByteFieldU16::new(6);