All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.jbidibc.netbidib.client.NetBidibPort Maven / Gradle / Ivy

package org.bidib.jbidibc.netbidib.client;

import java.io.IOException;
import java.net.InetAddress;

import org.bidib.jbidibc.netbidib.client.listener.NetBidibPortConnectionStatusListener;

public interface NetBidibPort extends Runnable {

    static final byte[] BIDIB_NET_PREFIX = new byte[] { 'B', 'i', 'D', 'i', 'B' };

    static final byte[] BIDIB_WIZARD_NET_PREFIX =
        new byte[] { 'B', 'i', 'D', 'i', 'B', '-', 'W', 'i', 'z', 'a', 'r', 'd' };

    /**
     * Add connection status listener.
     * 
     * @param listener
     *            the listener
     */
    void addConnectionStatusListener(final NetBidibPortConnectionStatusListener listener);

    /**
     * remove connection status listener.
     * 
     * @param listener
     *            the listener
     */
    void removeConnectionStatusListener(final NetBidibPortConnectionStatusListener listener);

    /**
     * Send the data to the host.
     * 
     * @param sendData
     *            the data to send
     * @param address
     *            the receiving address of the host
     * @param portNumber
     *            the receiving port number of the host
     * @throws IOException
     */
    void send(byte[] sendData, InetAddress address, int portNumber) throws IOException;

    /**
     * Stop the port.
     */
    void stop();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy