Initial Relay support implementation (TS011).

Closes #59.
This commit is contained in:
Orne Brocaar
2023-05-22 11:04:13 +01:00
parent 513aa7804d
commit cefe61072d
138 changed files with 28259 additions and 5157 deletions

View File

@ -30,6 +30,7 @@ impl Into<String> for LogCode {
LogCode::UplinkMic => "UPLINK_MIC",
LogCode::UplinkFCntRetransmission => "UPLINK_F_CNT_RETRANSMISSION",
LogCode::DownlinkGateway => "DOWNLINK_GATEWAY",
LogCode::RelayNewEndDevice => "RELAY_NEW_END_DEVICE",
}
.to_string()
}

View File

@ -1,3 +1,25 @@
include!(concat!(env!("OUT_DIR"), "/internal/internal.rs"));
#[cfg(feature = "json")]
include!(concat!(env!("OUT_DIR"), "/internal/internal.serde.rs"));
impl DeviceSession {
pub fn get_a_f_cnt_down(&self) -> u32 {
if self.mac_version().to_string().starts_with("1.0") {
// LoRaWAN 1.0
self.n_f_cnt_down
} else {
// LoRaWAN 1.1
self.a_f_cnt_down
}
}
pub fn set_a_f_cnt_down(&mut self, f_cnt: u32) {
if self.mac_version().to_string().starts_with("1.0") {
// LoRaWAN 1.0
self.n_f_cnt_down = f_cnt;
} else {
// LoRaWAN 1.1
self.a_f_cnt_down = f_cnt;
}
}
}