chirpstack/api/rust/src/internal.rs
Orne Brocaar e63296573b
Implement support for SQLite database backend. (#418) (#500)
This feature makes it possible to select between PostgreSQL and SQLite as database backend using a compile feature-flag. It is not possible to enable both at the same time.

---------

Co-authored-by: Momo Bel <plopyomomo@gmail.com>
2024-08-26 13:22:35 +01:00

26 lines
713 B
Rust
Vendored

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;
}
}
}