()
| 410 | |
| 411 | #[tokio::test] |
| 412 | async fn test_lorawan_11_errors() { |
| 413 | let _guard = test::prepare().await; |
| 414 | |
| 415 | let t = tenant::create(tenant::Tenant { |
| 416 | name: "tenant".into(), |
| 417 | can_have_gateways: true, |
| 418 | ..Default::default() |
| 419 | }) |
| 420 | .await |
| 421 | .unwrap(); |
| 422 | |
| 423 | let gw = gateway::create(gateway::Gateway { |
| 424 | name: "gateway".into(), |
| 425 | tenant_id: t.id, |
| 426 | gateway_id: EUI64::from_be_bytes([1, 2, 3, 4, 5, 6, 7, 8]), |
| 427 | ..Default::default() |
| 428 | }) |
| 429 | .await |
| 430 | .unwrap(); |
| 431 | |
| 432 | let app = application::create(application::Application { |
| 433 | name: "app".into(), |
| 434 | tenant_id: t.id, |
| 435 | ..Default::default() |
| 436 | }) |
| 437 | .await |
| 438 | .unwrap(); |
| 439 | |
| 440 | let dp = device_profile::create(device_profile::DeviceProfile { |
| 441 | name: "dp".into(), |
| 442 | tenant_id: Some(t.id), |
| 443 | region: lrwn::region::CommonName::EU868, |
| 444 | mac_version: lrwn::region::MacVersion::LORAWAN_1_1_0, |
| 445 | reg_params_revision: lrwn::region::Revision::RP002_1_0_3, |
| 446 | supports_otaa: true, |
| 447 | ..Default::default() |
| 448 | }) |
| 449 | .await |
| 450 | .unwrap(); |
| 451 | |
| 452 | let dev = device::create(device::Device { |
| 453 | name: "device".into(), |
| 454 | application_id: app.id, |
| 455 | device_profile_id: dp.id, |
| 456 | dev_eui: EUI64::from_be_bytes([2, 2, 3, 4, 5, 6, 7, 8]), |
| 457 | enabled_class: DeviceClass::A, |
| 458 | dev_addr: Some(DevAddr::from_be_bytes([1, 2, 3, 4])), |
| 459 | f_cnt_up: 8, |
| 460 | ..Default::default() |
| 461 | }) |
| 462 | .await |
| 463 | .unwrap(); |
| 464 | |
| 465 | let rx_info = gw::UplinkRxInfo { |
| 466 | gateway_id: gw.gateway_id.to_string(), |
| 467 | location: Some(Default::default()), |
| 468 | ..Default::default() |
| 469 | }; |
nothing calls this directly
no test coverage detected