Watch
0
0
Fork
You've already forked esp32-c_its-companion
0

Implement UART I/O protocol

This commit is contained in:
Jannik Beyerstedt 2026-07-20 11:58:44 +02:00
commit 4d7bef58a1
11 changed files with 610 additions and 36 deletions

View file

@ -300,20 +300,23 @@ impl crate::v2x_tx::GnItsPayload for CamState {
own_position: &crate::applogic::PositionState,
time: chrono::DateTime<chrono::Utc>,
_seq_no: &mut u16,
) -> (
geonetworking::en302636_4_1::ExtendedHeader,
Option<geonetworking::en302636_4_1::AreaType>,
u8,
) {
) -> Result<
(
geonetworking::en302636_4_1::ExtendedHeader,
Option<geonetworking::en302636_4_1::AreaType>,
u8,
),
alloc::string::String,
> {
let station_type = geonetworking::en302636_4_1::StationType::try_from(self.station_type.0)
.unwrap_or_default();
// CAM always uses SHB, hop-limit 1
(
Ok((
crate::v2x_tx::gn::make_shb_eh(address, station_type, own_position, time),
None,
1,
)
))
}
fn make_payload(

View file

@ -639,6 +639,11 @@ impl State {
pub fn time(&self) -> chrono::prelude::NaiveDateTime {
self.time
}
#[allow(unused)]
pub fn pos(&self) -> &PositionState {
&self.pos
}
}
#[cfg(test)]