To install the Brainboxes.IO.jar you need:

Prerequisites

  • Windows, Linux, Mac OS X
  • A Brainboxes Remote IO Device
  • Java Integrated Development Environment (IDE)

For Use With

The Brainboxes.IO.jar is for use with Brainboxes Remote IO (or Ethernet IO) Modules. These are product codes which begin with "ED-", for example ED-538, ED-204.

The Brainboxes.IO.jar is for use with any Java IDE. It can be compiled and used freely in your own software. This is a free and unencumbered software released into the public domain.

Installation Steps

  1. Download and unzip the file at the top of this page into a permanent location.
  2. Open your IDE and start a new project.
  3. Add the Brainboxes.IO.jar to your Libraries.
  4. The steps to do this will vary depending on your IDE.

Once the jar is added to your Libraries you will be able to use it in your project. You can find a guide on how to use this JAR with Android here.

Example Code

package BrainboxesIO;

import brainboxes.io.connection.IConnection;
import brainboxes.io.connection.TCPConnection;
import brainboxes.io.device.EDDevice;
import brainboxes.io.protocol.ASCIIProtocol;

public class BrainboxesIOExample {

    public static void main(String[] args) {
        // Setup a new TCPConnection to connect to a device with the
        // default static IP address and default TCP Port number 9500
        IConnection tcpConnection = new TCPConnection("192.168.127.254", 9500);
        
        // Create a new EDDevice object called ED using
        // the TCP connection and the ASCII Protocol
        EDDevice ed = new EDDevice(tcpConnection, new ASCIIProtocol());
                
        // Set up a new String called response
        String response = "";
        
        // Initiate the connection to the ED Device
        ed.Connect();
        
        //Check if Connection was iniated successfully
        if(ed.IsConnected()){

            // Send the ACSII command to read the name of the device
            // and save the response to the string called response
            response = ed.SendCommand("$01M");
        
        }

        // Print out the response to the console
        System.out.println("Reponse: " + response);
        
        // Close the connection to the ED Device
        ed.Disconnect();
    }

}

This FAQ Applies to the following Brainboxes Product Ranges: