some test code
This commit is contained in:
parent
1ef3e13b3d
commit
ed30bef4aa
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -254,6 +254,7 @@ dependencies = [
|
||||
"delegate 0.8.0",
|
||||
"fsrc-core",
|
||||
"spacepackets",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -7,6 +7,7 @@ authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
[dependencies]
|
||||
crossbeam-channel = "0.5"
|
||||
delegate = "0.8"
|
||||
zerocopy = "0.6.1"
|
||||
|
||||
[dependencies.spacepackets]
|
||||
path = "../spacepackets"
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crossbeam_channel::{bounded, Receiver, Sender};
|
||||
use std::thread;
|
||||
use zerocopy::{FromBytes, AsBytes, Unaligned, U16, NetworkEndian};
|
||||
|
||||
trait FieldDataProvider: Send {
|
||||
fn get_data(&self) -> &[u8];
|
||||
@ -26,6 +27,18 @@ impl FieldDataProvider for FixedFieldDataWrapper {
|
||||
|
||||
type FieldDataTraitObj = Box<dyn FieldDataProvider>;
|
||||
|
||||
struct ExampleMgmSet {
|
||||
mgm_vec: [f32; 3],
|
||||
temperature: u16
|
||||
}
|
||||
|
||||
#[derive(FromBytes, AsBytes, Unaligned)]
|
||||
#[repr(C)]
|
||||
struct ExampleMgmSetZc {
|
||||
mgm_vec: [u8; 12],
|
||||
temperatur: U16<NetworkEndian>
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let (s0, r0): (Sender<FieldDataTraitObj>, Receiver<FieldDataTraitObj>) = bounded(5);
|
||||
let data_wrapper = FixedFieldDataWrapper::from_two_u32(2, 3);
|
||||
|
Loading…
Reference in New Issue
Block a user