Phidgets
Class Phidget

java.lang.Object
  extended byjava.lang.Thread
      extended byPhidgets.Phidget
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
PhidgetAccelerometer, PhidgetEncoder, PhidgetInterfaceKit, PhidgetLED, PhidgetManager, PhidgetMotorControl, PhidgetPHSensor, PhidgetRFID, PhidgetServo, PhidgetTemperatureSensor, PhidgetTextLCD, PhidgetTextLED, PhidgetWeightSensor

public class Phidget
extends java.lang.Thread


Field Summary
protected  boolean attached
           
protected  java.lang.String deviceType
           
protected  int deviceVersion
           
protected  _IPhidgetEvents events
           
protected  int handler
           
protected  java.lang.String IPAddr
           
protected  java.lang.String password
           
protected  int Port
           
protected  int serialNumber
           
protected  int ServerID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Phidget()
           
 
Method Summary
 void Close()
          Closes the device.
 boolean equals(java.lang.Object comp)
           
protected  boolean getBoolean(java.lang.String data)
           
 java.lang.String GetDeviceType()
          Gets the device type.
 int GetDeviceVersion()
          Gets the Device Version.
 boolean GetIsAttached()
          Gets the connection status.
 int GetSerialNumber()
          Gets the Serial Number.
 java.lang.String GetServerAddress()
          Gets the IP address of the Phidget WebService
 int GetServerID()
          Gets the Server ID of the Phidget WebService
 int GetServerPort()
          Gets the Port of the Phidget WebService
protected  void gotData(java.lang.String[] dataArray)
           
protected  void init(java.lang.String[] dataArray)
           
protected  int OpenRemote(int serial, int port)
           
protected  int OpenRemoteIP(java.lang.String ip, int port)
           
 void run()
          Polls for phidget data on an open socket.
 void setDeviceType(java.lang.String string)
          Sets the device name.
 void setDeviceVersion(int i)
          Sets teh device version.
 void setSerialNumber(int i)
          Sets the serial number.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

handler

protected int handler

serialNumber

protected int serialNumber

deviceVersion

protected int deviceVersion

attached

protected boolean attached

deviceType

protected java.lang.String deviceType

password

protected java.lang.String password

events

protected _IPhidgetEvents events

IPAddr

protected java.lang.String IPAddr

Port

protected int Port

ServerID

protected int ServerID
Constructor Detail

Phidget

public Phidget()
Method Detail

GetSerialNumber

public int GetSerialNumber()
Gets the Serial Number.

Returns:
Serial Number

GetDeviceVersion

public int GetDeviceVersion()
Gets the Device Version.

Returns:
version

GetIsAttached

public boolean GetIsAttached()
Gets the connection status.

Returns:
connection status

GetDeviceType

public java.lang.String GetDeviceType()
Gets the device type.

Returns:
device type

OpenRemote

protected int OpenRemote(int serial,
                         int port)

OpenRemoteIP

protected int OpenRemoteIP(java.lang.String ip,
                           int port)

Close

public void Close()
Closes the device. This will shut down all socket connections and call the detach handler for this device.


getBoolean

protected boolean getBoolean(java.lang.String data)

init

protected void init(java.lang.String[] dataArray)

gotData

protected void gotData(java.lang.String[] dataArray)

run

public void run()
Polls for phidget data on an open socket. This function is called as part of the OpenRemote and OpenRemoteIP commands and should not be called directly.


setDeviceType

public void setDeviceType(java.lang.String string)
Sets the device name.

Parameters:
string - Device Name

setDeviceVersion

public void setDeviceVersion(int i)
Sets teh device version.

Parameters:
i - Version

setSerialNumber

public void setSerialNumber(int i)
Sets the serial number.

Parameters:
i - Serial Number

equals

public boolean equals(java.lang.Object comp)

GetServerAddress

public java.lang.String GetServerAddress()
Gets the IP address of the Phidget WebService

Returns:
IP Address

GetServerPort

public int GetServerPort()
Gets the Port of the Phidget WebService

Returns:
Port

GetServerID

public int GetServerID()
Gets the Server ID of the Phidget WebService

Returns:
Server ID


www.Phidgets.com

Phidgets is a trademark or registered trademark of Phidgets Inc. in the Canada and other countries.
Copyright 2005