Пример #1
0
    def test_report_6d(self):
        """0x6d - All-In-View Satellite Selection report"""

        while True:
            packet = self.gps.read()

            if packet.code == 0x6d:
                assert len(packet) == 6

                assert isinstance(packet[0], IntType)
                assert isinstance(packet[1], FloatType)
                assert isinstance(packet[2], FloatType)
                assert isinstance(packet[3], FloatType)
                assert isinstance(packet[4], FloatType)
                assert isinstance(packet[5], ListType)

                assert b012(packet[0]) in [3, 4]
                assert b3(packet[0]) in [0, 1]
                assert 0 <= b4567(packet[0]) <= 12
               
                assert len(packet[5]) == b4567(packet[0])

                for prn in packet[5]:
                    assert isinstance(prn, IntType)
                    assert 0 <= prn <= 40
                    
                assert packet.dimension in [3, 4]
                assert packet.auto_manual in [0, 1]
                assert (packet.auto_manual == 0 and packet.is_auto is True) or (packet.auto_manual == 1 and packet.is_manual is True)
                assert (packet.auto_manual == 0 and packet.is_manual is False) or (packet.auto_manual == 1 and packet.is_auto is False)
                assert packet.nsv == len(packet[5])

                return
Пример #2
0
 def test_b3(self):
     assert b3(0b00001000) == 1
     assert b3(0b00000000) == 0
Пример #3
0
 def auto_manual(self):
     return b3(self.values[0])