EasternEdgeRobotics / Software_2017

The control software for 2017
MIT License
3 stars 0 forks source link

Implement Bluetooth Sensor #317

Closed ConnorWhalen closed 7 years ago

ConnorWhalen commented 7 years ago

242

On the ROV side, the BluetoothReader listens for messages on the bluetooth serial port and broadcasts BluetoothValues

On Topsides, the BluetoothView is a console view that displays each emitted BluetoothValue

ConnorWhalen commented 7 years ago

The test implementation i had called scanner.close and it worked fine. We'll confirm it when it's tested on hardware

On Jun 11, 2017, at 8:59 PM, Cal Pratt notifications@github.com wrote:

@cal-pratt commented on this pull request.

In src/main/java/com/easternedgerobotics/rov/io/BluetoothReader.java:

  • throw new RuntimeException(e);
  • }
  • }
  • /**
    • Read the next line of input from the serial port if it exists.
  • *
    • @param serialPort the bluetooth serialPort.
    • @param observer the listener to this receiver.
    • @return the serial port
  • */
  • @Override
  • protected SerialPort next(final SerialPort serialPort, final Observer<? super BluetoothValue> observer) {
  • try {
  • final InputStream inputStream = serialPort.getInputStream();
  • try (final Scanner scanner = new Scanner(inputStream)) { Not sure if this will also kill the input. Calling close on a wrapped stream usually closes the parent stream.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.