Beispiel #1
0
    return result


dstcall_parser_mapping = {
    'APRS': OgnParser(),
    'OGNFNT': FanetParser(),
    'OGFLR': FlarmParser(),
    'OGNTRK': TrackerParser(),
    'OGNSDR': ReceiverParser(),
    'OGCAPT': GenericParser(beacon_type='capturs'),
    'OGFLYM': GenericParser(beacon_type='flymaster'),
    'OGINRE': InreachParser(),
    'OGLT24': LT24Parser(),
    'OGNAVI': NaviterParser(),
    'OGPAW': GenericParser(beacon_type='pilot_aware'),
    'OGSKYL': SkylinesParser(),
    'OGSPID': SpiderParser(),
    'OGSPOT': SpotParser(),
    'GENERIC': GenericParser(beacon_type='unknown'),
}


def parse_comment(aprs_comment, dstcall='APRS', aprs_type="position"):
    parser = dstcall_parser_mapping.get(dstcall)
    if parser:
        return parser.parse(aprs_comment, aprs_type)
    else:
        return dstcall_parser_mapping.get('GENERIC').parse(
            aprs_comment, aprs_type)
Beispiel #2
0
    def test_position_comment(self):
        message = SpotParser.parse_position("id0-2860357 SPOT3 GOOD")

        self.assertEqual(message['address'], "0-2860357")
        self.assertEqual(message['model'], 'SPOT3')
        self.assertEqual(message['status'], "GOOD")