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

Function create_device_profile

chirpstack/src/storage/device_profile.rs:691–718  ·  view source on GitHub ↗
(tenant_id: Option<Uuid>)

Source from the content-addressed store, hash-verified

689 }
690
691 pub async fn create_device_profile(tenant_id: Option<Uuid>) -> DeviceProfile {
692 let tenant_id = match tenant_id {
693 Some(v) => v.into(),
694 None => {
695 let t = storage::tenant::test::create_tenant().await;
696 t.id
697 }
698 };
699
700 let mut kv = HashMap::new();
701 kv.insert("foo".into(), "bar".into());
702
703 let dp = DeviceProfile {
704 tenant_id: Some(tenant_id),
705 name: "test device-profile".into(),
706 region: CommonName::EU868,
707 mac_version: MacVersion::LORAWAN_1_0_2,
708 reg_params_revision: Revision::B,
709 adr_algorithm_id: "default".into(),
710 payload_codec_runtime: Codec::JS,
711 uplink_interval: 60,
712 supports_otaa: true,
713 tags: fields::KeyValue::new(kv),
714 ..Default::default()
715 };
716
717 create(dp).await.unwrap()
718 }
719
720 #[tokio::test]
721 async fn test_device_profile() {

Callers 12

test_queue_itemFunction · 0.85
test_flush_queueFunction · 0.85
test_get_max_f_cnt_downFunction · 0.85
create_device_keysFunction · 0.85
test_deviceFunction · 0.85
test_device_listFunction · 0.85
test_device_profileFunction · 0.85
test_relayFunction · 0.85
deviceFunction · 0.85
device_queueFunction · 0.85

Calls 5

create_tenantFunction · 0.85
insertMethod · 0.80
unwrapMethod · 0.80
createFunction · 0.70
intoMethod · 0.45

Tested by 9

test_queue_itemFunction · 0.68
test_flush_queueFunction · 0.68
test_get_max_f_cnt_downFunction · 0.68
test_deviceFunction · 0.68
test_device_listFunction · 0.68
test_device_profileFunction · 0.68
test_relayFunction · 0.68