mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-30 23:53:54 +00:00
Implement get_downlink_data_delay config.
This config option was present in v3 to set a delay before starting the downlink flow (Class-A) so that an end-application can enqueue a downlink to be used within the same uplink / downlink transaction. However, this option was still missing in v4.
This commit is contained in:
parent
7c35fff849
commit
81ce56a9a0
@ -166,6 +166,17 @@ pub fn run() {
|
||||
# must be less than the (first) receive-window.
|
||||
deduplication_delay="{{ network.deduplication_delay }}"
|
||||
|
||||
# Get downlink data delay.
|
||||
#
|
||||
# This is the time that ChirpStack waits between forwarding data to the
|
||||
# integration(s) and reading data from the queue. A higher value means that
|
||||
# an end-application has more time to schedule a downlink queue item which
|
||||
# can be processed within the same uplink / downlink transaction.
|
||||
# Please note that this value has influence on the uplink / downlink
|
||||
# roundtrip time. Setting this value too high means ChirpStack will be
|
||||
# unable to respond to the device within its receive-window.
|
||||
get_downlink_data_delay="{{ network.get_downlink_data_delay }}"
|
||||
|
||||
# Mac-commands disabled.
|
||||
mac_commands_disabled={{ network.mac_commands_disabled }}
|
||||
|
||||
|
@ -156,6 +156,8 @@ pub struct Network {
|
||||
pub device_session_ttl: Duration,
|
||||
#[serde(with = "humantime_serde")]
|
||||
pub deduplication_delay: Duration,
|
||||
#[serde(with = "humantime_serde")]
|
||||
pub get_downlink_data_delay: Duration,
|
||||
pub mac_commands_disabled: bool,
|
||||
pub adr_plugins: Vec<String>,
|
||||
pub scheduler: Scheduler,
|
||||
@ -169,6 +171,7 @@ impl Default for Network {
|
||||
enabled_regions: vec!["eu868".into()],
|
||||
device_session_ttl: Duration::from_secs(60 * 60 * 24 * 31),
|
||||
deduplication_delay: Duration::from_millis(200),
|
||||
get_downlink_data_delay: Duration::from_millis(100),
|
||||
mac_commands_disabled: false,
|
||||
adr_plugins: vec![],
|
||||
scheduler: Default::default(),
|
||||
|
@ -983,6 +983,10 @@ impl Data {
|
||||
|
||||
async fn start_downlink_data_flow(&mut self) -> Result<()> {
|
||||
trace!("Starting downlink data flow");
|
||||
|
||||
let conf = config::get();
|
||||
tokio::time::sleep(conf.network.get_downlink_data_delay).await;
|
||||
|
||||
if let lrwn::Payload::MACPayload(pl) = &self.uplink_frame_set.phy_payload.payload {
|
||||
downlink::data::Data::handle_response(
|
||||
self.uplink_frame_set.clone(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user