Class BaseStation

java.lang.Object
com.rodrigoandrade.jstds.hardware.BaseStation

public class BaseStation extends Object
Manages the serial connection to the LoRa receiver.
  • Constructor Details

    • BaseStation

      public BaseStation()
      Creates a base station with its packet decoder.
  • Method Details

    • onPacketReceived

      public void onPacketReceived(Consumer<TelemetryPacket> callback)
      Registers a callback for decoded packets.
      Parameters:
      callback - callback that receives decoded packets
    • connect

      public boolean connect(String portName, int baudRate)
      Tries to establish a connection with the specified port.
      Parameters:
      portName - serial port name
      baudRate - serial baud rate
      Returns:
      true when the connection is open
    • disconnect

      public void disconnect()
      Disconnects from the serial port.