()
| 2950 | |
| 2951 | #[tokio::test] |
| 2952 | async fn test_lorawan_11_mac_commands() { |
| 2953 | let _guard = test::prepare().await; |
| 2954 | |
| 2955 | let t = tenant::create(tenant::Tenant { |
| 2956 | name: "tenant".into(), |
| 2957 | can_have_gateways: true, |
| 2958 | ..Default::default() |
| 2959 | }) |
| 2960 | .await |
| 2961 | .unwrap(); |
| 2962 | |
| 2963 | let gw = gateway::create(gateway::Gateway { |
| 2964 | name: "gateway".into(), |
| 2965 | tenant_id: t.id, |
| 2966 | gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]), |
| 2967 | ..Default::default() |
| 2968 | }) |
| 2969 | .await |
| 2970 | .unwrap(); |
| 2971 | |
| 2972 | let app = application::create(application::Application { |
| 2973 | name: "app".into(), |
| 2974 | tenant_id: t.id, |
| 2975 | ..Default::default() |
| 2976 | }) |
| 2977 | .await |
| 2978 | .unwrap(); |
| 2979 | |
| 2980 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 2981 | name: "dp".into(), |
| 2982 | tenant_id: Some(t.id), |
| 2983 | region: lrwn::region::CommonName::EU868, |
| 2984 | mac_version: lrwn::region::MacVersion::LORAWAN_1_1_0, |
| 2985 | reg_params_revision: lrwn::region::Revision::RP002_1_0_3, |
| 2986 | supports_otaa: true, |
| 2987 | ..Default::default() |
| 2988 | }) |
| 2989 | .await |
| 2990 | .unwrap(); |
| 2991 | |
| 2992 | let dev = device::create(device::Device { |
| 2993 | name: "device".into(), |
| 2994 | application_id: app.id, |
| 2995 | device_profile_id: dp.id, |
| 2996 | dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]), |
| 2997 | enabled_class: DeviceClass::A, |
| 2998 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 2999 | f_cnt_up: 8, |
| 3000 | ..Default::default() |
| 3001 | }) |
| 3002 | .await |
| 3003 | .unwrap(); |
| 3004 | |
| 3005 | let rx_info = gw::UplinkRxInfo { |
| 3006 | gateway_id: gw.gateway_id.to_string(), |
| 3007 | location: Some(Default::default()), |
| 3008 | ..Default::default() |
| 3009 | }; |
nothing calls this directly
no test coverage detected