Package com.grt192.networking

Examples of com.grt192.networking.GRTClientSocket


  static String host = "127.0.0.1";
  static int port = 80;

  public static void main(String[] args) {
    System.out.println("Starting Network Test");
    GRTClientSocket connection = new GRTClientSocket(host, port);
    connection.addSocketListener(new SocketListener() {

      public void dataRecieved(SocketEvent e) {
        System.out.println("< " + e.getData());
      }

      public void onConnect(SocketEvent e) {
        System.out.println("Connected!");
      }

      public void onDisconnect(SocketEvent e) {
        System.out.println("Disconnected!");
      }
    });
    connection.connect();
    connection.start();
    try {
      connection.sendData("GET /index.html HTTP/1.0\n");
      Thread.sleep(4000);
      connection.disconnect();
      System.exit(0);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


        initServer();
        initPrinters();
    }

    public void initServer(){
        gs = new GRTServer(PORT);
        gs.addSocketListener(this);
        gs.start();
    }
View Full Code Here

        initServer();
        initPrinters();
    }

    public void initServer() {
        gs = new GRTServer(PORT);
        gs.addSocketListener(this);
//        gs.start();
    }
View Full Code Here

//        hlc = new HHLEDController(controls);
        //if we do this, implement notification for all elements of controls
    }

    private void initSocket(){
        srvr = new GRTSingleClientServer(PORT);
        srvr.start();
        System.out.println("connected");
        srvr.addSocketListener(this);
    }
View Full Code Here

        System.out.println("Motors Initialized");

        // analog inputs
        InternetRPC rpc = new InternetRPC(180);
        rpc.start();
        BatterySensor s = new BatterySensor(10);
        s.start();
        VoltageMessenger messenger = new VoltageMessenger(rpc, 23, s);
//        GRTPotentiometer batterySensor = new GRTPotentiometer(1, 50,
//                "batteryVoltage");
//        batterySensor.start();
//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
View Full Code Here

        leftJaguar.start();

        this.rightJaguar = rfjaguar;
        rightJaguar.start();

        this.leftEncoder = new GRTEncoder(LeftChanela, LeftChanelb, 5, "ljagencoder");

        this.rightEncoder = new GRTEncoder(RightChanela, RightChanelb, 5, "rjagencoder");

        this.canGyro = canGyro;
        leftEncoder.addEncoderListener(this);
        rightEncoder.addEncoderListener(this);
        cangyro.addGyroListener(this);
View Full Code Here

    private AsynchronousPIDController turnControl;
    private AsynchronousPIDController leftDriveControl;
    private AsynchronousPIDController rightDriveControl;

    public CBPWMTankDriveTrain(int lfpin, int rfpin, int gyropin, int LeftChanela, int LeftChanelb, int RightChanela, int RightChanelb) {
        this(new GRTJaguar(lfpin), new GRTJaguar(rfpin), new GRTGyro(
                gyropin, 5, "cangyro"), LeftChanela, LeftChanelb, RightChanela, RightChanelb);
    }
View Full Code Here

  private AsynchronousPIDController leftDriveControl;
  private AsynchronousPIDController rightDriveControl;

  public CBTankDriveTrain(int lfpin, int rfpin, int gyropin) {
    this(new GRTCANJaguar(lfpin), new GRTCANJaguar(rfpin), new GRTGyro(
        gyropin, 5, "cangyro"));
  }
View Full Code Here

    tankBSolenoid.start();

    this.tankSelectorSolenoid = tankselecsol;
    tankSelectorSolenoid.start();

    this.fireSwitch = new GRTSwitch(3, 9, "fireswitch");
    fireSwitch.start();

    this.cannonCompressor = compressor;
    if(!compressor.isStarted())
      cannonCompressor.startCompressor();
View Full Code Here

        switchID = "Switch" + switchPin;
        solenoidID = "Solenoid" + solPin;

        solenoid = new GRTSolenoid(solPin);
        sswitch = new GRTSwitch(switchPin, 50, switchID);

//        this.extended = true;
        init();
    }
View Full Code Here

TOP

Related Classes of com.grt192.networking.GRTClientSocket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.