Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Buffon <nicolas.buffon@orange.com>
  • Loading branch information
nbuffon committed Nov 4, 2024
1 parent dd9e1b5 commit 935b6e1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions rust/src/client/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use crate::exchange::etsi::decentralized_environmental_notification_message::{
};
use crate::exchange::etsi::reference_position::ReferencePosition;
use crate::exchange::etsi::{etsi_now, heading_to_etsi, speed_to_etsi, timestamp_to_etsi};
use crate::exchange::etsi::collective_perception_message::{CollectivePerceptionMessage, ManagementContainer};
use crate::exchange::etsi::perceived_object::PerceivedObject;
use crate::exchange::sequence_number::SequenceNumber;
use crate::exchange::PathElement;
use crate::mobility::mobile::Mobile;
Expand Down Expand Up @@ -58,6 +60,26 @@ pub fn create_cam(
}
}

pub fn create_cpm(
station_id: u32,
station_type: u8,
position: Position,
object_list: &[&dyn Mobile]
) -> CollectivePerceptionMessage {
let perceived_object_list: Vec<PerceivedObject> = Vec::new();

CollectivePerceptionMessage {
station_id,
management_container: ManagementContainer {
station_type,
reference_position: ReferencePosition::from(position),
..Default::default()
},
perceived_object_container: perceived_object_list,
..Default::default()
}
}

// FIXME use custom errors
pub fn create_denm(
detection_time: u64,
Expand Down

0 comments on commit 935b6e1

Please sign in to comment.