()
| 2576 | |
| 2577 | #[tokio::test] |
| 2578 | async fn test_lorawan_10_mac_commands() { |
| 2579 | let _guard = test::prepare().await; |
| 2580 | |
| 2581 | let t = tenant::create(tenant::Tenant { |
| 2582 | name: "tenant".into(), |
| 2583 | can_have_gateways: true, |
| 2584 | ..Default::default() |
| 2585 | }) |
| 2586 | .await |
| 2587 | .unwrap(); |
| 2588 | |
| 2589 | let gw = gateway::create(gateway::Gateway { |
| 2590 | name: "gateway".into(), |
| 2591 | tenant_id: t.id, |
| 2592 | gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]), |
| 2593 | ..Default::default() |
| 2594 | }) |
| 2595 | .await |
| 2596 | .unwrap(); |
| 2597 | |
| 2598 | let app = application::create(application::Application { |
| 2599 | name: "app".into(), |
| 2600 | tenant_id: t.id, |
| 2601 | ..Default::default() |
| 2602 | }) |
| 2603 | .await |
| 2604 | .unwrap(); |
| 2605 | |
| 2606 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 2607 | name: "dp".into(), |
| 2608 | tenant_id: Some(t.id), |
| 2609 | region: lrwn::region::CommonName::EU868, |
| 2610 | mac_version: lrwn::region::MacVersion::LORAWAN_1_0_4, |
| 2611 | reg_params_revision: lrwn::region::Revision::RP002_1_0_3, |
| 2612 | supports_otaa: true, |
| 2613 | ..Default::default() |
| 2614 | }) |
| 2615 | .await |
| 2616 | .unwrap(); |
| 2617 | |
| 2618 | let dev = device::create(device::Device { |
| 2619 | name: "device".into(), |
| 2620 | application_id: app.id, |
| 2621 | device_profile_id: dp.id, |
| 2622 | dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]), |
| 2623 | enabled_class: DeviceClass::A, |
| 2624 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 2625 | f_cnt_up: 8, |
| 2626 | ..Default::default() |
| 2627 | }) |
| 2628 | .await |
| 2629 | .unwrap(); |
| 2630 | |
| 2631 | let rx_info = gw::UplinkRxInfo { |
| 2632 | gateway_id: gw.gateway_id.to_string(), |
| 2633 | location: Some(Default::default()), |
| 2634 | ..Default::default() |
| 2635 | }; |
nothing calls this directly
no test coverage detected