我正在为nmea-0183数据编写解析器,该数据是通过RS-232接收的。我能够解析几乎所有数据,但无法解析“ $ PFEC,Alarm,0,0 * 6F”之类的数据。我将如何解析python中的此类nmea句子。
>>> line = '$PFEC,Alarm,0,0*6F'
>>> parsed = pynmea2.parse(line)
>>> parsed
>>> Shows output like:<ProprietarySentence() data=['', 'Alarm', '0', '0']>
>>> I expect the output like:
<GRME(subtype='E', hpe=Decimal('2.3'), hpe_unit='M', vpe=Decimal('3.3'), vpe_unit='M', osepe=Decimal('4.0'), osepe_unit='M')>
>>> which is output of another sentence '$PGRME,2.3,M,3.3,M,4.0,M*2B'