def _extract_callsign_from_AX25_frame(self, frame): """ Extracts a Callsign and SSID from a KISS-Encoded APRS Frame. Args: * frame (bytes): KISS-Encoded APRS Frame as str of octs """ frame = Byt(frame[:7]).ints() callsign = Byt(x >> 1 for x in frame[:6]) self.callsign = callsign.strip() self.ssid = Byt(str((frame[6] >> 1) & 0x0f))
def parse_callsign(self, callsign): """ Parses and extracts a Callsign and SSID from an ASCII-Encoded APRS Callsign or Callsign-SSID. Args: * callsign (str): ASCII-Encoded APRS Callsign """ res = Byt(callsign).split(Byt('-'), 1) + [Byt()] callsign, ssid = res[:2] if len(ssid) == 0: ssid = Byt('0') if callsign[-1] == Byt('*'): callsign = callsign[:-1] self.digi = True self.callsign = callsign.strip() self.ssid = ssid.strip()