Crea sito


org.zu.ardulink
Class ConnectionContact

java.lang.Object
  extended by org.zu.ardulink.ConnectionContact

public class ConnectionContact
extends Object

Ardulink - return to homepage

v0.6.1 Magnum PI

Implements the Raphael Blatter's Network interface (a little modified) to integrate RXTX library with Ardulink http://www.ardulink.org/. This class implements other methods to manage events about messages from arduino board.

Author:
Luciano Zu project Ardulink http://www.ardulink.org/


Constructor Summary
ConnectionContact(Link link)
           
 
Method Summary
 boolean addAnalogReadChangeListener(AnalogReadChangeListener listener)
          Register an AnalogReadChangeListener to receive events about analog pin change state.
 boolean addConnectionListener(ConnectionListener connectionListener)
          Register a ConnectionListener to receive events about connection status.
 boolean addDigitalReadChangeListener(DigitalReadChangeListener listener)
          Register an DigitalReadChangeListener to receive events about digital pin change state.
 boolean addRawDataListener(RawDataListener rawDataListener)
          Register a RawDataListener to receive data from Arduino.
 void connected(String id, String portName)
           
 void disconnected(String id)
           
 void parseInput(String id, int numBytes, int[] message)
          Method invoked by Raphael Blatter's SerialConnection class.
 boolean removeAnalogReadChangeListener(AnalogReadChangeListener listener)
          Remove a AnalogReadChangeListener from the event notification set.
 boolean removeConnectionListener(ConnectionListener connectionListener)
          Remove a ConnectionListener from the event notification set.
 boolean removeDigitalReadChangeListener(DigitalReadChangeListener listener)
          Remove a DigitalReadChangeListener from the event notification set.
 boolean removeRawDataListener(RawDataListener rawDataListener)
          Remove a RawDataListener from the data notification set.
 void writeLog(String id, String text)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionContact

public ConnectionContact(Link link)
Method Detail

addConnectionListener

public boolean addConnectionListener(ConnectionListener connectionListener)
Register a ConnectionListener to receive events about connection status.

Parameters:
connectionListener -
Returns:
true if this set did not already contain the specified connectionListener
See Also:
Link

removeConnectionListener

public boolean removeConnectionListener(ConnectionListener connectionListener)
Remove a ConnectionListener from the event notification set.

Parameters:
connectionListener -
Returns:
See Also:
Link

addRawDataListener

public boolean addRawDataListener(RawDataListener rawDataListener)
Register a RawDataListener to receive data from Arduino.

Parameters:
rawDataListener -
Returns:
true if this set did not already contain the specified rawDataListener
See Also:
Link

removeRawDataListener

public boolean removeRawDataListener(RawDataListener rawDataListener)
Remove a RawDataListener from the data notification set.

Parameters:
rawDataListener -
Returns:
See Also:
Link

addAnalogReadChangeListener

public boolean addAnalogReadChangeListener(AnalogReadChangeListener listener)
Register an AnalogReadChangeListener to receive events about analog pin change state. With this method ardulink is able to receive information from arduino board Call a startListenAnalogPin.

Parameters:
listener -
Returns:
true if this set did not already contain the specified AnalogReadChangeListener
See Also:
Link

removeAnalogReadChangeListener

public boolean removeAnalogReadChangeListener(AnalogReadChangeListener listener)
Remove a AnalogReadChangeListener from the event notification set. Call a stopListenAnalogPin if this is the last remove element.

Parameters:
listener -
Returns:
true if this set contained the specified AnalogReadChangeListener
See Also:
Link

addDigitalReadChangeListener

public boolean addDigitalReadChangeListener(DigitalReadChangeListener listener)
Register an DigitalReadChangeListener to receive events about digital pin change state. With this method ardulink is able to receive information from arduino board Call a startListenAnalogPin.

Parameters:
listener -
Returns:
true if this set did not already contain the specified DigitalReadChangeListener
See Also:
ConnectionContact

removeDigitalReadChangeListener

public boolean removeDigitalReadChangeListener(DigitalReadChangeListener listener)
Remove a DigitalReadChangeListener from the event notification set. Call a stopListenDigitalPin if this is the last remove element.

Parameters:
listener -
Returns:
true if this set contained the specified DigitalReadChangeListener
See Also:
ConnectionContact

writeLog

public void writeLog(String id,
                     String text)

parseInput

public void parseInput(String id,
                       int numBytes,
                       int[] message)
Method invoked by Raphael Blatter's SerialConnection class. This method call the Link.parseMessage method and if the IncomingMessageEvent is not null fire the event to the listeners.


disconnected

public void disconnected(String id)

connected

public void connected(String id,
                      String portName)


Copyright © 2015. All rights reserved.