Class BaseStation
java.lang.Object
com.rodrigoandrade.jstds.hardware.BaseStation
Manages the serial connection to the LoRa receiver.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTries to establish a connection with the specified port.voidDisconnects from the serial port.voidonPacketReceived(Consumer<TelemetryPacket> callback) Registers a callback for decoded packets.
-
Constructor Details
-
BaseStation
public BaseStation()Creates a base station with its packet decoder.
-
-
Method Details
-
onPacketReceived
Registers a callback for decoded packets.- Parameters:
callback- callback that receives decoded packets
-
connect
Tries to establish a connection with the specified port.- Parameters:
portName- serial port namebaudRate- serial baud rate- Returns:
- true when the connection is open
-
disconnect
public void disconnect()Disconnects from the serial port.
-