Skip to content

Commit 6a882c2

Browse files
committed
Add unittest for registers with payload spec
1 parent 02059bf commit 6a882c2

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

tests/data/device.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ registers:
2424
length: 3
2525
access: Event
2626
description: Reports the current values of the analog input lines.
27+
AnalogDataPayloadSpec:
28+
address: 44
29+
type: S16
30+
length: 3
31+
access: Event
32+
description: Reports the current values of the analog input lines.
33+
payloadSpec:
34+
AnalogInput0:
35+
offset: 0
36+
description: The voltage at the output of the ADC channel 0.
37+
Encoder:
38+
offset: 1
39+
description: The quadrature counter value on Port 2
40+
AnalogInput1:
41+
offset: 2
42+
description: The voltage at the output of the ADC channel 1.
2743
bitMasks:
2844
DigitalInputs:
2945
description: Specifies the state of the digital input lines.

tests/test_reader.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
expected_whoAmI=0,
1717
expected_registers=["AnalogData"],
1818
),
19+
DeviceSchemaParam(
20+
path="data/device.yml",
21+
expected_whoAmI=0,
22+
expected_registers=["AnalogDataPayloadSpec"],
23+
),
1924
]
2025

2126

0 commit comments

Comments
 (0)