예제 #1
0
 def __init__(self, name: str, conn_conf: ConnectionConfiguration,
              callback: Callable):
     TNCThread.__init__(self, name)
     self.kiss = kiss.SerialKISS("COM3", "115200", strip_df_start=True)
     self.conn_conf = conn_conf
     self.callback = callback
     self.stop_signal = False
예제 #2
0
def main():
    frame = aprs.Frame()
    frame.source = aprs.Callsign('W2GMD-14')
    frame.destination = aprs.Callsign('PYKISS')
    frame.path = [aprs.Callsign('WIDE1-1')]
    frame.text = '>Hello World!'

    ki = kiss.SerialKISS(port='/dev/cu.AP510-DevB', speed='9600')
    ki.start()
    ki.write(frame.encode_kiss())
예제 #3
0
    def start(self):
        """
        Start.
        """
        print("aprs-bot RX starting...")

        # Do the MQTT things.
        self.__m = mqtt.Client()

        # Ugly AF. Do this better.
        try:
            self.__mqtt_connect()

        except (KeyboardInterrupt, SystemExit):
            raise

        except:
            print(traceback.format_exc())
            time.sleep(1)
            self.__mqtt_connect()

        # Determine what sort of connection method to use.
        if self.__connection_spec['type'] == "tcp":
            self.__k = kiss.TCPKISS(self.__connection_spec['host'],
                                    self.__connection_spec['port'])

        elif self.__connection_spec['type'] == "serial":
            self.__k = kiss.SerialKISS(self.__connection_spec['serial_port'],
                                       self.__connection_spec['baud'])

        else:
            raise ValueError(
                "Couldn't determine type of KISS connection to use.")

        # Connect up.
        self.__k.start()
        self.__k.read(callback=self.process_frame)
예제 #4
0
def main():
    ki = kiss.SerialKISS(port='/dev/cu.Repleo-PL2303-00303114', speed='9600')
    ki.start()
    ki.read(callback=print_frame, readmode=True)