|
@@ -0,0 +1,40 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+import pytest
|
|
|
+
|
|
|
+import cc1101
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+@pytest.mark.parametrize(
|
|
|
+ "marcstate",
|
|
|
+ (
|
|
|
+ cc1101.MainRadioControlStateMachineState.IDLE,
|
|
|
+ cc1101.MainRadioControlStateMachineState.RX,
|
|
|
+ ),
|
|
|
+)
|
|
|
+def test_get_main_radio_control_state_machine_state(transceiver, marcstate):
|
|
|
+ transceiver._spi.xfer.return_value = [
|
|
|
+ 0b0000111,
|
|
|
+ marcstate.value,
|
|
|
+ ]
|
|
|
+ assert transceiver.get_main_radio_control_state_machine_state() == marcstate
|
|
|
+ transceiver._spi.xfer.assert_called_once_with([0x35 | 0xC0, 0])
|
|
|
+ assert transceiver.get_marc_state() == marcstate
|