mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-12 20:48:09 +00:00
1
api/rust/src/integration.rs
vendored
1
api/rust/src/integration.rs
vendored
@ -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()
|
||||
}
|
||||
|
22
api/rust/src/internal.rs
vendored
22
api/rust/src/internal.rs
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user