private final String sensorNumber = "2\n";
private Timer timer;
private boolean sensorOn;
+ static int tmp_proxi = -1;
public ProximityPage(AbstractInjectorItem item, String name) {
super(item, name);
}
public void sendMessage(int on) {
- TestSensorMessage msg = new TestSensorMessage(on);
- try {
- sensorSocket.send(sensorNumber + msg.getMessage());
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ if(tmp_proxi != on)
+ {
+ TestSensorMessage msg = new TestSensorMessage(on);
+ try {
+ sensorSocket.send(sensorNumber + msg.getMessage());
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ tmp_proxi = on;
}
}