use of net.sf.marineapi.nmea.io.SentenceReader in project marine-api by ktuukkan.
the class HeadingProviderTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
factory = SentenceFactory.getInstance();
File file = new File("target/test-classes/data/sample1.txt");
FileInputStream str = new FileInputStream(file);
SentenceReader r = new SentenceReader(str);
instance = new HeadingProvider(r);
instance.addListener(this);
event = null;
}
use of net.sf.marineapi.nmea.io.SentenceReader in project marine-api by ktuukkan.
the class PositionProviderTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
File f = new File("target/test-classes/data/Navibe-GM720.txt");
FileInputStream str = new FileInputStream(f);
SentenceReader r = new SentenceReader(str);
instance = new PositionProvider(r);
instance.addListener(this);
}
use of net.sf.marineapi.nmea.io.SentenceReader in project marine-api by ktuukkan.
the class SerialPortExample method init.
/**
* Init serial port and reader.
*/
private void init() {
try {
SerialPort sp = getSerialPort();
if (sp != null) {
InputStream is = sp.getInputStream();
SentenceReader sr = new SentenceReader(is);
sr.addSentenceListener(this);
sr.start();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations