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

Function test_command

lrwn/src/maccommand.rs:2470–3108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2468
2469 #[test]
2470 fn test_command() {
2471 let tests = vec![
2472 MacTest {
2473 uplink: true,
2474 command: MACCommand::ResetInd(ResetIndPayload {
2475 dev_lorawan_version: Version::LoRaWAN1_1,
2476 }),
2477 bytes: vec![0x01, 0x01],
2478 },
2479 MacTest {
2480 uplink: false,
2481 command: MACCommand::ResetConf(ResetConfPayload {
2482 serv_lorawan_version: Version::LoRaWAN1_1,
2483 }),
2484 bytes: vec![0x01, 0x01],
2485 },
2486 MacTest {
2487 uplink: true,
2488 command: MACCommand::LinkCheckReq,
2489 bytes: vec![0x02],
2490 },
2491 MacTest {
2492 uplink: false,
2493 command: MACCommand::LinkCheckAns(LinkCheckAnsPayload {
2494 margin: 10,
2495 gw_cnt: 15,
2496 }),
2497 bytes: vec![0x02, 0x0a, 0x0f],
2498 },
2499 MacTest {
2500 uplink: false,
2501 command: MACCommand::LinkADRReq(LinkADRReqPayload {
2502 dr: 1,
2503 tx_power: 2,
2504 ch_mask: ChMask::new({
2505 let mut mask: [bool; 16] = [false; 16];
2506 mask[2] = true;
2507 mask
2508 }),
2509 redundancy: Redundancy {
2510 ch_mask_cntl: 4,
2511 nb_rep: 5,
2512 },
2513 }),
2514 bytes: vec![0x03, 0x12, 0x04, 0x00, 0x45],
2515 },
2516 MacTest {
2517 uplink: true,
2518 command: MACCommand::LinkADRAns(LinkADRAnsPayload {
2519 ch_mask_ack: true,
2520 dr_ack: false,
2521 tx_power_ack: false,
2522 }),
2523 bytes: vec![0x03, 0x01],
2524 },
2525 MacTest {
2526 uplink: true,
2527 command: MACCommand::LinkADRAns(LinkADRAnsPayload {

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.80
decode_from_rawMethod · 0.80

Tested by

no test coverage detected