public static synchronized void addListener(int fileDescriptor, SerialInterruptListener listener) {
        if (!listeners.containsKey(fileDescriptor)) {
            listeners.put(fileDescriptor, listener);
            enableSerialDataReceiveCallback(fileDescriptor);
        }
    }
public static synchronized void addListener ( int fileDescriptor , SerialInterruptListener listener ) { if ( ! listeners . containsKey ( fileDescriptor ) ) { listeners . put ( fileDescriptor , listener ) ; enableSerialDataReceiveCallback ( fileDescriptor ) ; } }
<p>
Java consumer code can all this method to register itself as a listener for pin state
changes.
</p>

@see com.pi4j.jni.SerialInterruptListener
@see com.pi4j.jni.SerialInterruptEvent

@param fileDescriptor the serial file descriptor/handle
@param listener A class instance that implements the GpioInterruptListener interface.