MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_lorawan_10_rx_delay

Function test_lorawan_10_rx_delay

chirpstack/src/test/class_a_test.rs:2105–2575  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2103
2104#[tokio::test]
2105async fn test_lorawan_10_rx_delay() {
2106 let _guard = test::prepare().await;
2107
2108 let mut conf = (*config::get()).clone();
2109 conf.regions[0].network.rx1_delay = 3;
2110 config::set(conf);
2111
2112 let t = tenant::create(tenant::Tenant {
2113 name: "tenant".into(),
2114 can_have_gateways: true,
2115 ..Default::default()
2116 })
2117 .await
2118 .unwrap();
2119
2120 let gw = gateway::create(gateway::Gateway {
2121 name: "gateway".into(),
2122 tenant_id: t.id,
2123 gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]),
2124 ..Default::default()
2125 })
2126 .await
2127 .unwrap();
2128
2129 let app = application::create(application::Application {
2130 name: "app".into(),
2131 tenant_id: t.id,
2132 ..Default::default()
2133 })
2134 .await
2135 .unwrap();
2136
2137 let mut dp = device_profile::create(device_profile::DeviceProfile {
2138 name: "dp".into(),
2139 tenant_id: Some(t.id),
2140 region: lrwn::region::CommonName::EU868,
2141 mac_version: lrwn::region::MacVersion::LORAWAN_1_0_4,
2142 reg_params_revision: lrwn::region::Revision::RP002_1_0_3,
2143 supports_otaa: true,
2144 ..Default::default()
2145 })
2146 .await
2147 .unwrap();
2148
2149 let dev = device::create(device::Device {
2150 name: "device".into(),
2151 application_id: app.id,
2152 device_profile_id: dp.id,
2153 dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]),
2154 enabled_class: DeviceClass::A,
2155 dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])),
2156 f_cnt_up: 8,
2157 ..Default::default()
2158 })
2159 .await
2160 .unwrap();
2161
2162 let rx_info = gw::UplinkRxInfo {

Callers

nothing calls this directly

Calls 11

prepareFunction · 0.85
set_uplink_modulationFunction · 0.85
unwrapMethod · 0.80
to_stringMethod · 0.80
run_testFunction · 0.70
getFunction · 0.50
setFunction · 0.50
createFunction · 0.50
partial_updateFunction · 0.50
updateFunction · 0.50
intoMethod · 0.45

Tested by

no test coverage detected