Package it.hakvoort.nia.example

Source Code of it.hakvoort.nia.example.ExampleNiaReader

package it.hakvoort.nia.example;

import it.hakvoort.nia.NiaDevice2;
import it.hakvoort.nia.NiaListener;
import it.hakvoort.nia.NiaSample;

/**
*
* @author Gido Hakvoort (gido@hakvoort.it)
*
*/
public class ExampleNiaReader implements NiaListener {
 
  static int counter = 0;
 
  public static void main(String[] args) {
    // create a NiaDevice or NiaDevice2
    NiaDevice2 nia = new NiaDevice2();
   
    // register this class as listener
    nia.addListener(new ExampleNiaReader());
   
    // set signed to false
    nia.setSigned(false);

    // start the NiaDevice
    nia.start();
   
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // stop the NiaDevice
    nia.stop();
  }

  @Override
  public void receivedSample(NiaSample sample) {
    System.out.println(sample.toString());
  }
}
TOP

Related Classes of it.hakvoort.nia.example.ExampleNiaReader

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.