00001 #ifndef PHIDGET_H
00002 #define PHIDGET_H
00003 #ifdef __cplusplus
00004 extern "C" {
00005 #endif
00006 typedef struct _CPhidget *CPhidgetHandle;
00007 typedef long long __int64;
00008 typedef enum {
00009 PHIDCLASS_NOTHING = 1,
00010 PHIDCLASS_ACCELEROMETER,
00011 PHIDCLASS_ADVANCEDSERVO,
00012 PHIDCLASS_ENCODER,
00013 PHIDCLASS_GPS,
00014 PHIDCLASS_GYROSCOPE,
00015 PHIDCLASS_INTERFACEKIT,
00016 PHIDCLASS_LED,
00017 PHIDCLASS_MOTORCONTROL,
00018 PHIDCLASS_PHSENSOR,
00019 PHIDCLASS_RFID,
00020 PHIDCLASS_SERVO,
00021 PHIDCLASS_STEPPER,
00022 PHIDCLASS_TEMPERATURESENSOR,
00023 PHIDCLASS_TEXTLCD,
00024 PHIDCLASS_TEXTLED,
00025 PHIDCLASS_WEIGHTSENSOR,
00026 } CPhidget_DeviceClass;
00027 typedef enum {
00028 PHIDID_ACCELEROMETER_2AXIS = 0x071,
00029 PHIDID_ACCELEROMETER_3AXIS = 0x07E,
00030 PHIDID_ADVANCEDSERVO_8MOTOR = 0x03A,
00031 PHIDID_BIPOLAR_STEPPER_1MOTOR = 0x07B,
00032 PHIDID_ENCODER_1ENCODER_1INPUT = 0x04B,
00033 PHIDID_ENCODER_HS_1ENCODER = 0x080,
00034 PHIDID_INTERFACEKIT_0_0_4 = 0x040,
00035 PHIDID_INTERFACEKIT_0_0_8 = 0x081,
00036 PHIDID_INTERFACEKIT_0_16_16 = 0x044,
00037 PHIDID_INTERFACEKIT_8_8_8 = 0x045,
00038 PHIDID_INTERFACEKIT_8_8_8_w_LCD = 0x07D,
00039 PHIDID_LED_64 = 0x04A,
00040 PHIDID_LINEAR_TOUCH = 0x076,
00041 PHIDID_MOTORCONTROL_HC_2MOTOR = 0x059,
00042 PHIDID_MOTORCONTROL_LV_2MOTOR_4INPUT = 0x058,
00043 PHIDID_PHSENSOR = 0x074,
00044 PHIDID_RFID_2OUTPUT = 0x031,
00045 PHIDID_ROTARY_TOUCH = 0x077,
00046 PHIDID_SERVO_1MOTOR = 0x039,
00047 PHIDID_TEMPERATURESENSOR = 0x070,
00048 PHIDID_TEXTLCD_2x20_w_8_8_8 = 0x17D,
00049 PHIDID_UNIPOLAR_STEPPER_4MOTOR = 0x07A,
00050 PHIDID_INTERFACEKIT_0_8_8_w_LCD = 0x053,
00051 PHIDID_INTERFACEKIT_4_8_8 = 4,
00052 PHIDID_RFID = 0x030,
00053 PHIDID_SERVO_1MOTOR_OLD = 2,
00054 PHIDID_SERVO_4MOTOR = 0x038,
00055 PHIDID_SERVO_4MOTOR_OLD = 3,
00056 PHIDID_TEXTLCD_2x20 = 0x052,
00057 PHIDID_TEXTLCD_2x20_w_0_8_8 = 0x153,
00058 PHIDID_TEXTLED_1x8 = 0x049,
00059 PHIDID_TEXTLED_4x8 = 0x048,
00060 PHIDID_WEIGHTSENSOR = 0x072,
00061 } CPhidget_DeviceID;
00062 int CPhidget_open(CPhidgetHandle phid, int serialNumber);
00063 int CPhidget_close(CPhidgetHandle phid);
00064 int CPhidget_delete(CPhidgetHandle phid);
00065 int CPhidget_set_OnDetach_Handler(CPhidgetHandle phid, int( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00066 int CPhidget_set_OnAttach_Handler(CPhidgetHandle phid, int( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00067 int CPhidget_set_OnServerConnect_Handler(CPhidgetHandle phid, int ( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00068 int CPhidget_set_OnServerDisconnect_Handler(CPhidgetHandle phid, int ( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00069 int CPhidget_set_OnError_Handler(CPhidgetHandle phid, int( *fptr)(CPhidgetHandle phid, void *userPtr, int errorCode, const char *errorString), void *userPtr);
00070 int CPhidget_getDeviceName(CPhidgetHandle phid, const char **deviceName);
00071 int CPhidget_getSerialNumber(CPhidgetHandle phid, int *serialNumber);
00072 int CPhidget_getDeviceVersion(CPhidgetHandle phid, int *deviceVersion);
00073 int CPhidget_getDeviceStatus(CPhidgetHandle phid, int *deviceStatus);
00074 int CPhidget_getLibraryVersion(const char **libraryVersion);
00075 int CPhidget_getDeviceType(CPhidgetHandle phid, const char **deviceType);
00076 int CPhidget_getDeviceLabel(CPhidgetHandle phid, const char **deviceLabel);
00077 int CPhidget_setDeviceLabel(CPhidgetHandle phid, const char *deviceLabel);
00078 int CPhidget_getErrorDescription(int errorCode, const char **errorString);
00079 int CPhidget_waitForAttachment(CPhidgetHandle phid, int milliseconds);
00080 int CPhidget_getServerID(CPhidgetHandle phid, const char **serverID);
00081 int CPhidget_getServerAddress(CPhidgetHandle phid, const char **address, int *port);
00082 int CPhidget_getServerStatus(CPhidgetHandle phid, int *serverStatus);
00083 int CPhidget_getDeviceID(CPhidgetHandle phid, CPhidget_DeviceID *deviceID);
00084 int CPhidget_getDeviceClass(CPhidgetHandle phid, CPhidget_DeviceClass *deviceClass);
00085 typedef enum {
00086 PHIDGET_DICTIONARY_VALUE_CHANGED = 1,
00087 PHIDGET_DICTIONARY_ENTRY_ADDED,
00088 PHIDGET_DICTIONARY_ENTRY_REMOVING,
00089 PHIDGET_DICTIONARY_CURRENT_VALUE
00090 } CPhidgetDictionary_keyChangeReason;
00091 typedef struct _CPhidgetDictionary *CPhidgetDictionaryHandle;
00092 typedef struct _CPhidgetDictionaryListener *CPhidgetDictionaryListenerHandle;
00093 int CPhidgetDictionary_create(CPhidgetDictionaryHandle *dict);
00094 int CPhidgetDictionary_close(CPhidgetDictionaryHandle dict);
00095 int CPhidgetDictionary_delete(CPhidgetDictionaryHandle dict);
00096
00097
00098
00099
00100
00101 int CPhidgetDictionary_set_OnError_Handler(CPhidgetDictionaryHandle dict,
00102 int( *fptr)(CPhidgetDictionaryHandle, void *userPtr, int errorCode, const char *errorString), void *userPtr);
00103
00104
00105
00106
00107
00108
00109
00110 int CPhidgetDictionary_addKey(CPhidgetDictionaryHandle dict, const char *key, const char *value, int persistent);
00111
00112
00113
00114
00115
00116 int CPhidgetDictionary_removeKey(CPhidgetDictionaryHandle dict, const char *pattern);
00117 typedef int( *CPhidgetDictionary_OnKeyChange_Function)(CPhidgetDictionaryHandle dict, void *userPtr,
00118 const char *key, const char *value, CPhidgetDictionary_keyChangeReason reason);
00119 int CPhidgetDictionary_set_OnKeyChange_Handler(CPhidgetDictionaryHandle dict, CPhidgetDictionaryListenerHandle *dictlistener, const char *pattern,
00120 CPhidgetDictionary_OnKeyChange_Function fptr, void *userPtr);
00121 int CPhidgetDictionary_remove_OnKeyChange_Handler(CPhidgetDictionaryListenerHandle dictlistener);
00122 int CPhidgetDictionary_getKey(CPhidgetDictionaryHandle dict, const char *key, const char *value, int valueSize);
00123 int CPhidgetDictionary_set_OnServerConnect_Handler(CPhidgetDictionaryHandle dict, int ( *fptr)(CPhidgetDictionaryHandle dict, void *userPtr), void *userPtr);
00124 int CPhidgetDictionary_set_OnServerDisconnect_Handler(CPhidgetDictionaryHandle dict, int ( *fptr)(CPhidgetDictionaryHandle dict, void *userPtr), void *userPtr);
00125 int CPhidgetDictionary_getServerID(CPhidgetDictionaryHandle dict, const char **serverID);
00126 int CPhidgetDictionary_getServerAddress(CPhidgetDictionaryHandle dict, const char **address, int *port);
00127 int CPhidgetDictionary_getServerStatus(CPhidgetDictionaryHandle dict, int *serverStatus);
00128 typedef struct _CPhidgetManager *CPhidgetManagerHandle;
00129 int CPhidgetManager_create(CPhidgetManagerHandle *phidm);
00130 int CPhidgetManager_open(CPhidgetManagerHandle phidm);
00131 int CPhidgetManager_close(CPhidgetManagerHandle phidm);
00132 int CPhidgetManager_delete(CPhidgetManagerHandle phidm);
00133 int CPhidgetManager_set_OnAttach_Handler(CPhidgetManagerHandle phidm, int ( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00134 int CPhidgetManager_set_OnDetach_Handler(CPhidgetManagerHandle phidm, int ( *fptr)(CPhidgetHandle phid, void *userPtr), void *userPtr);
00135 int CPhidgetManager_getAttachedDevices(CPhidgetManagerHandle phidm, CPhidgetHandle *phidArray[], int *count);
00136 int CPhidgetManager_freeAttachedDevicesArray(CPhidgetHandle phidArray[]);
00137 int CPhidgetManager_set_OnError_Handler(CPhidgetManagerHandle phidm, int( *fptr)(CPhidgetManagerHandle phidm, void *userPtr, int errorCode, const char *errorString), void *userPtr);
00138 int CPhidgetManager_set_OnServerConnect_Handler(CPhidgetManagerHandle phidm, int ( *fptr)(CPhidgetManagerHandle phidm, void *userPtr), void *userPtr);
00139 int CPhidgetManager_set_OnServerDisconnect_Handler(CPhidgetManagerHandle phidm, int ( *fptr)(CPhidgetManagerHandle phidm, void *userPtr), void *userPtr);
00140
00141
00142 int CPhidgetManager_getServerID(CPhidgetManagerHandle phidm, const char **serverID);
00143
00144
00145
00146
00147
00148
00149 int CPhidgetManager_getServerAddress(CPhidgetManagerHandle phidm, const char **address, int *port);
00150
00151
00152
00153
00154
00155 int CPhidgetManager_getServerStatus(CPhidgetManagerHandle phidm, int *serverStatus);
00156 int CPhidget_openRemote(CPhidgetHandle phid, int serial, const char *serverID, const char *password);
00157 int CPhidget_openRemoteIP(CPhidgetHandle phid, int serial, const char *address, int port, const char *password);
00158 int CPhidgetManager_openRemote(CPhidgetManagerHandle phidm, const char *serverID, const char *password);
00159 int CPhidgetManager_openRemoteIP(CPhidgetManagerHandle phidm, const char *address, int port, const char *password);
00160 int CPhidgetDictionary_openRemote(CPhidgetDictionaryHandle dict, const char *serverID, const char *password);
00161 int CPhidgetDictionary_openRemoteIP(CPhidgetDictionaryHandle dict, const char *address, int port, const char *password);
00162 typedef enum {
00163 PHIDGET_LOG_CRITICAL = 1,
00164 PHIDGET_LOG_ERROR,
00165 PHIDGET_LOG_WARNING,
00166 PHIDGET_LOG_DEBUG,
00167 PHIDGET_LOG_INFO,
00168 PHIDGET_LOG_VERBOSE
00169 } CPhidgetLog_level;
00170 int CPhidget_enableLogging(CPhidgetLog_level level, const char *outputFile);
00171 int CPhidget_disableLogging();
00172 int CPhidget_log(CPhidgetLog_level level, const char *id, const char *message, ...);
00173 typedef struct _CPhidgetAccelerometer *CPhidgetAccelerometerHandle;
00174 int CPhidgetAccelerometer_create(CPhidgetAccelerometerHandle *phid);
00175 int CPhidgetAccelerometer_getAxisCount(CPhidgetAccelerometerHandle phid, int *count);
00176 int CPhidgetAccelerometer_getAcceleration(CPhidgetAccelerometerHandle phid, int index, double *acceleration);
00177 int CPhidgetAccelerometer_getAccelerationMax(CPhidgetAccelerometerHandle phid, int index, double *max);
00178 int CPhidgetAccelerometer_getAccelerationMin(CPhidgetAccelerometerHandle phid, int index, double *min);
00179 int CPhidgetAccelerometer_set_OnAccelerationChange_Handler(CPhidgetAccelerometerHandle phid, int ( *fptr)(CPhidgetAccelerometerHandle phid, void *userPtr, int index, double acceleration), void *userPtr);
00180 int CPhidgetAccelerometer_getAccelerationChangeTrigger(CPhidgetAccelerometerHandle phid, int index, double *trigger);
00181 int CPhidgetAccelerometer_setAccelerationChangeTrigger(CPhidgetAccelerometerHandle phid, int index, double trigger);
00182 int CPhidgetAccelerometer_getNumAxis(CPhidgetAccelerometerHandle,int *) __attribute__ ((deprecated)) ;
00183 typedef struct _CPhidgetAdvancedServo *CPhidgetAdvancedServoHandle;
00184 int CPhidgetAdvancedServo_create(CPhidgetAdvancedServoHandle *phid);
00185 int CPhidgetAdvancedServo_getMotorCount(CPhidgetAdvancedServoHandle phid, int *count);
00186 int CPhidgetAdvancedServo_getAcceleration(CPhidgetAdvancedServoHandle phid, int index, double *acceleration);
00187 int CPhidgetAdvancedServo_setAcceleration(CPhidgetAdvancedServoHandle phid, int index, double acceleration);
00188 int CPhidgetAdvancedServo_getAccelerationMax(CPhidgetAdvancedServoHandle phid, int index, double *max);
00189 int CPhidgetAdvancedServo_getAccelerationMin(CPhidgetAdvancedServoHandle phid, int index, double *min);
00190 int CPhidgetAdvancedServo_getVelocityLimit(CPhidgetAdvancedServoHandle phid, int index, double *limit);
00191 int CPhidgetAdvancedServo_setVelocityLimit(CPhidgetAdvancedServoHandle phid, int index, double limit);
00192 int CPhidgetAdvancedServo_getVelocity(CPhidgetAdvancedServoHandle phid, int index, double *velocity);
00193 int CPhidgetAdvancedServo_getVelocityMax(CPhidgetAdvancedServoHandle phid, int index, double *max);
00194 int CPhidgetAdvancedServo_getVelocityMin(CPhidgetAdvancedServoHandle phid, int index, double *min);
00195 int CPhidgetAdvancedServo_set_OnVelocityChange_Handler(CPhidgetAdvancedServoHandle phid, int ( *fptr)(CPhidgetAdvancedServoHandle phid, void *userPtr, int index, double velocity), void *userPtr);
00196 int CPhidgetAdvancedServo_getPosition(CPhidgetAdvancedServoHandle phid, int index, double *position);
00197 int CPhidgetAdvancedServo_setPosition(CPhidgetAdvancedServoHandle phid, int index, double position);
00198 int CPhidgetAdvancedServo_getPositionMax(CPhidgetAdvancedServoHandle phid, int index, double *max);
00199 int CPhidgetAdvancedServo_setPositionMax(CPhidgetAdvancedServoHandle phid, int index, double max);
00200 int CPhidgetAdvancedServo_getPositionMin(CPhidgetAdvancedServoHandle phid, int index, double *min);
00201 int CPhidgetAdvancedServo_setPositionMin(CPhidgetAdvancedServoHandle phid, int index, double min);
00202 int CPhidgetAdvancedServo_set_OnPositionChange_Handler(CPhidgetAdvancedServoHandle phid, int ( *fptr)(CPhidgetAdvancedServoHandle phid, void *userPtr, int index, double position), void *userPtr);
00203 int CPhidgetAdvancedServo_getCurrent(CPhidgetAdvancedServoHandle phid, int index, double *current);
00204 int CPhidgetAdvancedServo_set_OnCurrentChange_Handler(CPhidgetAdvancedServoHandle phid, int ( *fptr)(CPhidgetAdvancedServoHandle phid, void *userPtr, int index, double current), void *userPtr);
00205 int CPhidgetAdvancedServo_getSpeedRampingOn(CPhidgetAdvancedServoHandle phid, int index, int *rampingState);
00206 int CPhidgetAdvancedServo_setSpeedRampingOn(CPhidgetAdvancedServoHandle phid, int index, int rampingState);
00207 int CPhidgetAdvancedServo_getEngaged(CPhidgetAdvancedServoHandle phid, int index, int *engagedState);
00208 int CPhidgetAdvancedServo_setEngaged(CPhidgetAdvancedServoHandle phid, int index, int engagedState);
00209 int CPhidgetAdvancedServo_getStopped(CPhidgetAdvancedServoHandle phid, int index, int *stoppedState);
00210 typedef struct _CPhidgetEncoder *CPhidgetEncoderHandle;
00211 int CPhidgetEncoder_create(CPhidgetEncoderHandle *phid);
00212 int CPhidgetEncoder_getInputCount(CPhidgetEncoderHandle phid, int *count);
00213 int CPhidgetEncoder_getInputState(CPhidgetEncoderHandle phid, int index, int *inputState);
00214 int CPhidgetEncoder_set_OnInputChange_Handler(CPhidgetEncoderHandle phid, int ( *fptr)(CPhidgetEncoderHandle phid, void *userPtr, int index, int inputState), void *userPtr);
00215 int CPhidgetEncoder_getEncoderCount(CPhidgetEncoderHandle phid, int *count);
00216 int CPhidgetEncoder_getPosition(CPhidgetEncoderHandle phid, int index, int *position);
00217 int CPhidgetEncoder_setPosition(CPhidgetEncoderHandle phid, int index, int position);
00218 int CPhidgetEncoder_set_OnPositionChange_Handler(CPhidgetEncoderHandle phid, int ( *fptr)(CPhidgetEncoderHandle phid, void *userPtr, int index, int time,int positionChange), void *userPtr);
00219 int CPhidgetEncoder_getEncoderPosition(CPhidgetEncoderHandle, int index, int *) __attribute__ ((deprecated)) ;
00220 int CPhidgetEncoder_setEncoderPosition(CPhidgetEncoderHandle, int index, int) __attribute__ ((deprecated)) ;
00221 int CPhidgetEncoder_getNumInputs(CPhidgetEncoderHandle,int *) __attribute__ ((deprecated)) ;
00222 int CPhidgetEncoder_getNumEncoders(CPhidgetEncoderHandle,int *) __attribute__ ((deprecated)) ;
00223 typedef struct _CPhidgetInterfaceKit *CPhidgetInterfaceKitHandle;
00224 int CPhidgetInterfaceKit_create(CPhidgetInterfaceKitHandle *phid);
00225 int CPhidgetInterfaceKit_getInputCount(CPhidgetInterfaceKitHandle phid, int *count);
00226 int CPhidgetInterfaceKit_getInputState(CPhidgetInterfaceKitHandle phid, int index, int *inputState);
00227 int CPhidgetInterfaceKit_set_OnInputChange_Handler(CPhidgetInterfaceKitHandle phid, int ( *fptr)(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int inputState), void *userPtr);
00228 int CPhidgetInterfaceKit_getOutputCount(CPhidgetInterfaceKitHandle phid, int *count);
00229 int CPhidgetInterfaceKit_getOutputState(CPhidgetInterfaceKitHandle phid, int index, int *outputState);
00230 int CPhidgetInterfaceKit_setOutputState(CPhidgetInterfaceKitHandle phid, int index, int outputState);
00231 int CPhidgetInterfaceKit_set_OnOutputChange_Handler(CPhidgetInterfaceKitHandle phid, int ( *fptr)(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int outputState), void *userPtr);
00232 int CPhidgetInterfaceKit_getSensorCount(CPhidgetInterfaceKitHandle phid, int *count);
00233 int CPhidgetInterfaceKit_getSensorValue(CPhidgetInterfaceKitHandle phid, int index, int *sensorValue);
00234 int CPhidgetInterfaceKit_getSensorRawValue(CPhidgetInterfaceKitHandle phid, int index, int *sensorRawValue);
00235 int CPhidgetInterfaceKit_set_OnSensorChange_Handler(CPhidgetInterfaceKitHandle phid, int ( *fptr)(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int sensorValue), void *userPtr);
00236 int CPhidgetInterfaceKit_getSensorChangeTrigger(CPhidgetInterfaceKitHandle phid, int index, int *trigger);
00237 int CPhidgetInterfaceKit_setSensorChangeTrigger(CPhidgetInterfaceKitHandle phid, int index, int trigger);
00238 int CPhidgetInterfaceKit_getRatiometric(CPhidgetInterfaceKitHandle phid, int *ratiometric);
00239 int CPhidgetInterfaceKit_setRatiometric(CPhidgetInterfaceKitHandle phid, int ratiometric);
00240 int CPhidgetInterfaceKit_getNumInputs(CPhidgetInterfaceKitHandle,int *) __attribute__ ((deprecated)) ;
00241 int CPhidgetInterfaceKit_getNumOutputs(CPhidgetInterfaceKitHandle,int *) __attribute__ ((deprecated)) ;
00242 int CPhidgetInterfaceKit_getNumSensors(CPhidgetInterfaceKitHandle,int *) __attribute__ ((deprecated)) ;
00243 typedef struct _CPhidgetLED *CPhidgetLEDHandle;
00244 int CPhidgetLED_create(CPhidgetLEDHandle *phid);
00245 int CPhidgetLED_getLEDCount(CPhidgetLEDHandle phid, int *count);
00246 int CPhidgetLED_getDiscreteLED(CPhidgetLEDHandle phid, int index, int *brightness);
00247 int CPhidgetLED_setDiscreteLED(CPhidgetLEDHandle phid, int index, int brightness);
00248 int CPhidgetLED_getNumLEDs(CPhidgetLEDHandle,int *) __attribute__ ((deprecated)) ;
00249 typedef struct _CPhidgetMotorControl *CPhidgetMotorControlHandle;
00250 int CPhidgetMotorControl_create(CPhidgetMotorControlHandle *phid);
00251 int CPhidgetMotorControl_getMotorCount(CPhidgetMotorControlHandle phid, int *count);
00252 int CPhidgetMotorControl_getVelocity(CPhidgetMotorControlHandle phid, int index, double *velocity);
00253 int CPhidgetMotorControl_setVelocity(CPhidgetMotorControlHandle phid, int index, double velocity);
00254 int CPhidgetMotorControl_set_OnVelocityChange_Handler(CPhidgetMotorControlHandle phid, int ( *fptr)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double velocity), void *userPtr);
00255 int CPhidgetMotorControl_getAcceleration(CPhidgetMotorControlHandle phid, int index, double *acceleration);
00256 int CPhidgetMotorControl_setAcceleration(CPhidgetMotorControlHandle phid, int index, double acceleration);
00257 int CPhidgetMotorControl_getAccelerationMax(CPhidgetMotorControlHandle phid, int index, double *max);
00258 int CPhidgetMotorControl_getAccelerationMin(CPhidgetMotorControlHandle phid, int index, double *min);
00259 int CPhidgetMotorControl_getCurrent(CPhidgetMotorControlHandle phid, int index, double *current);
00260 int CPhidgetMotorControl_set_OnCurrentChange_Handler(CPhidgetMotorControlHandle phid, int ( *fptr)(CPhidgetMotorControlHandle phid, void *userPtr, int index, double current), void *userPtr);
00261 int CPhidgetMotorControl_getInputCount(CPhidgetMotorControlHandle phid, int *count);
00262 int CPhidgetMotorControl_getInputState(CPhidgetMotorControlHandle phid, int index, int *inputState);
00263 int CPhidgetMotorControl_set_OnInputChange_Handler(CPhidgetMotorControlHandle phid, int ( *fptr)(CPhidgetMotorControlHandle phid, void *userPtr, int index, int inputState), void *userPtr);
00264 int CPhidgetMotorControl_getNumMotors(CPhidgetMotorControlHandle,int *) __attribute__ ((deprecated)) ;
00265 int CPhidgetMotorControl_getNumInputs(CPhidgetMotorControlHandle,int *) __attribute__ ((deprecated)) ;
00266 int CPhidgetMotorControl_getMotorSpeed(CPhidgetMotorControlHandle, int index, double *) __attribute__ ((deprecated)) ;
00267 int CPhidgetMotorControl_setMotorSpeed(CPhidgetMotorControlHandle, int index, double) __attribute__ ((deprecated)) ;
00268 int CPhidgetMotorControl_set_OnMotorChange_Handler(CPhidgetMotorControlHandle, int ( *fptr)(CPhidgetMotorControlHandle, void *userPtr, int index, double motorSpeed), void *userPtr) __attribute__ ((deprecated)) ;
00269 typedef struct _CPhidgetPHSensor *CPhidgetPHSensorHandle;
00270 int CPhidgetPHSensor_create(CPhidgetPHSensorHandle *phid);
00271 int CPhidgetPHSensor_getPH(CPhidgetPHSensorHandle phid, double *ph);
00272 int CPhidgetPHSensor_getPHMax(CPhidgetPHSensorHandle phid, double *max);
00273 int CPhidgetPHSensor_getPHMin(CPhidgetPHSensorHandle phid, double *min);
00274 int CPhidgetPHSensor_set_OnPHChange_Handler(CPhidgetPHSensorHandle phid, int ( *fptr)(CPhidgetPHSensorHandle phid, void *userPtr, double ph), void *userPtr);
00275 int CPhidgetPHSensor_getPHChangeTrigger(CPhidgetPHSensorHandle phid, double *trigger);
00276 int CPhidgetPHSensor_setPHChangeTrigger(CPhidgetPHSensorHandle phid, double trigger);
00277 int CPhidgetPHSensor_getPotential(CPhidgetPHSensorHandle phid, double *potential);
00278 int CPhidgetPHSensor_getPotentialMax(CPhidgetPHSensorHandle phid, double *max);
00279 int CPhidgetPHSensor_getPotentialMin(CPhidgetPHSensorHandle phid, double *min);
00280 int CPhidgetPHSensor_setTemperature(CPhidgetPHSensorHandle phid, double temperature);
00281 typedef struct _CPhidgetRFID *CPhidgetRFIDHandle;
00282 int CPhidgetRFID_create(CPhidgetRFIDHandle *phid);
00283 int CPhidgetRFID_getOutputCount(CPhidgetRFIDHandle phid, int *count);
00284 int CPhidgetRFID_getOutputState(CPhidgetRFIDHandle phid, int index, int *outputState);
00285 int CPhidgetRFID_setOutputState(CPhidgetRFIDHandle phid, int index, int outputState);
00286 int CPhidgetRFID_set_OnOutputChange_Handler(CPhidgetRFIDHandle phid, int ( *fptr)(CPhidgetRFIDHandle phid, void *userPtr, int index, int outputState), void *userPtr);
00287 int CPhidgetRFID_getAntennaOn(CPhidgetRFIDHandle phid, int *antennaState);
00288 int CPhidgetRFID_setAntennaOn(CPhidgetRFIDHandle phid, int antennaState);
00289 int CPhidgetRFID_getLEDOn(CPhidgetRFIDHandle phid, int *LEDState);
00290 int CPhidgetRFID_setLEDOn(CPhidgetRFIDHandle phid, int LEDState);
00291 int CPhidgetRFID_getLastTag(CPhidgetRFIDHandle phid, unsigned char *tag);
00292 int CPhidgetRFID_getTagStatus(CPhidgetRFIDHandle phid, int *status);
00293 int CPhidgetRFID_set_OnTag_Handler(CPhidgetRFIDHandle phid, int ( *fptr)(CPhidgetRFIDHandle phid, void *userPtr, unsigned char *tag), void *userPtr);
00294 int CPhidgetRFID_set_OnTagLost_Handler(CPhidgetRFIDHandle phid, int ( *fptr)(CPhidgetRFIDHandle phid, void *userPtr, unsigned char *tag), void *userPtr);
00295 int CPhidgetRFID_getNumOutputs(CPhidgetRFIDHandle,int *) __attribute__ ((deprecated)) ;
00296 typedef struct _CPhidgetServo *CPhidgetServoHandle;
00297 int CPhidgetServo_create(CPhidgetServoHandle *phid);
00298 int CPhidgetServo_getMotorCount(CPhidgetServoHandle phid, int *count);
00299 int CPhidgetServo_getPosition(CPhidgetServoHandle phid, int index, double *position);
00300 int CPhidgetServo_setPosition(CPhidgetServoHandle phid, int index, double position);
00301 int CPhidgetServo_getPositionMax(CPhidgetServoHandle phid, int index, double *max);
00302 int CPhidgetServo_getPositionMin(CPhidgetServoHandle phid, int index, double *min);
00303 int CPhidgetServo_set_OnPositionChange_Handler(CPhidgetServoHandle phid, int ( *fptr)(CPhidgetServoHandle phid, void *userPtr, int index, double position), void *userPtr);
00304 int CPhidgetServo_getEngaged(CPhidgetServoHandle phid, int index, int *engagedState);
00305 int CPhidgetServo_setEngaged(CPhidgetServoHandle phid, int index, int engagedState);
00306 int CPhidgetServo_getNumMotors(CPhidgetServoHandle,int *) __attribute__ ((deprecated)) ;
00307 int CPhidgetServo_setMotorPosition(CPhidgetServoHandle, int index, double) __attribute__ ((deprecated)) ;
00308 int CPhidgetServo_getMotorPosition(CPhidgetServoHandle, int index, double *) __attribute__ ((deprecated)) ;
00309 int CPhidgetServo_getMotorPositionMax(CPhidgetServoHandle, int index, double *) __attribute__ ((deprecated)) ;
00310 int CPhidgetServo_getMotorPositionMin(CPhidgetServoHandle, int index, double *) __attribute__ ((deprecated)) ;
00311 int CPhidgetServo_set_OnMotorPositionChange_Handler(CPhidgetServoHandle, int ( *fptr)(CPhidgetServoHandle, void *userPtr, int index, double motorPosition), void *userPtr) __attribute__ ((deprecated)) ;
00312 int CPhidgetServo_setMotorOn(CPhidgetServoHandle, int index, int) __attribute__ ((deprecated)) ;
00313 int CPhidgetServo_getMotorOn(CPhidgetServoHandle, int index, int *) __attribute__ ((deprecated)) ;
00314 typedef struct _CPhidgetStepper *CPhidgetStepperHandle;
00315 int CPhidgetStepper_create(CPhidgetStepperHandle *phid);
00316 int CPhidgetStepper_getInputCount(CPhidgetStepperHandle phid, int *count);
00317 int CPhidgetStepper_getInputState(CPhidgetStepperHandle phid, int index, int *inputState);
00318 int CPhidgetStepper_set_OnInputChange_Handler(CPhidgetStepperHandle phid, int ( *fptr)(CPhidgetStepperHandle phid, void *userPtr, int index, int inputState), void *userPtr);
00319 int CPhidgetStepper_getMotorCount(CPhidgetStepperHandle phid, int *count);
00320 int CPhidgetStepper_getAcceleration(CPhidgetStepperHandle phid, int index, double *acceleration);
00321 int CPhidgetStepper_setAcceleration(CPhidgetStepperHandle phid, int index, double acceleration);
00322 int CPhidgetStepper_getAccelerationMax(CPhidgetStepperHandle phid, int index, double *max);
00323 int CPhidgetStepper_getAccelerationMin(CPhidgetStepperHandle phid, int index, double *min);
00324 int CPhidgetStepper_getVelocityLimit(CPhidgetStepperHandle phid, int index, double *limit);
00325 int CPhidgetStepper_setVelocityLimit(CPhidgetStepperHandle phid, int index, double limit);
00326 int CPhidgetStepper_getVelocity(CPhidgetStepperHandle phid, int index, double *velocity);
00327 int CPhidgetStepper_getVelocityMax(CPhidgetStepperHandle phid, int index, double *max);
00328 int CPhidgetStepper_getVelocityMin(CPhidgetStepperHandle phid, int index, double *min);
00329 int CPhidgetStepper_set_OnVelocityChange_Handler(CPhidgetStepperHandle phid, int ( *fptr)(CPhidgetStepperHandle phid, void *userPtr, int index, double velocity), void *userPtr);
00330 int CPhidgetStepper_getTargetPosition(CPhidgetStepperHandle phid, int index, __int64 *position);
00331 int CPhidgetStepper_setTargetPosition(CPhidgetStepperHandle phid, int index, __int64 position);
00332 int CPhidgetStepper_getCurrentPosition(CPhidgetStepperHandle phid, int index, __int64 *position);
00333 int CPhidgetStepper_setCurrentPosition(CPhidgetStepperHandle phid, int index, __int64 position);
00334 int CPhidgetStepper_getPositionMax(CPhidgetStepperHandle phid, int index, __int64 *max);
00335 int CPhidgetStepper_getPositionMin(CPhidgetStepperHandle phid, int index, __int64 *min);
00336 int CPhidgetStepper_set_OnPositionChange_Handler(CPhidgetStepperHandle phid, int ( *fptr)(CPhidgetStepperHandle phid, void *userPtr, int index, __int64 position), void *userPtr);
00337 int CPhidgetStepper_getCurrentLimit(CPhidgetStepperHandle phid, int index, double *limit);
00338 int CPhidgetStepper_setCurrentLimit(CPhidgetStepperHandle phid, int index, double limit);
00339 int CPhidgetStepper_getCurrent(CPhidgetStepperHandle phid, int index, double *current);
00340 int CPhidgetStepper_getCurrentMax(CPhidgetStepperHandle phid, int index, double *max);
00341 int CPhidgetStepper_getCurrentMin(CPhidgetStepperHandle phid, int index, double *min);
00342 int CPhidgetStepper_set_OnCurrentChange_Handler(CPhidgetStepperHandle phid, int ( *fptr)(CPhidgetStepperHandle phid, void *userPtr, int index, double current), void *userPtr);
00343 int CPhidgetStepper_getEngaged(CPhidgetStepperHandle phid, int index, int *engagedState);
00344 int CPhidgetStepper_setEngaged(CPhidgetStepperHandle phid, int index, int engagedState);
00345 int CPhidgetStepper_getStopped(CPhidgetStepperHandle phid, int index, int *stoppedState);
00346 typedef struct _CPhidgetTemperatureSensor *CPhidgetTemperatureSensorHandle;
00347 int CPhidgetTemperatureSensor_create(CPhidgetTemperatureSensorHandle *phid);
00348 typedef enum {
00349 PHIDGET_TEMPERATURE_SENSOR_K_TYPE = 1,
00350 PHIDGET_TEMPERATURE_SENSOR_J_TYPE,
00351 PHIDGET_TEMPERATURE_SENSOR_E_TYPE,
00352 PHIDGET_TEMPERATURE_SENSOR_T_TYPE
00353 } CPhidgetTemperatureSensor_ThermocoupleType;
00354 int CPhidgetTemperatureSensor_getTemperatureInputCount(CPhidgetTemperatureSensorHandle phid, int *count);
00355 int CPhidgetTemperatureSensor_getTemperature(CPhidgetTemperatureSensorHandle phid, int index, double *temperature);
00356 int CPhidgetTemperatureSensor_getTemperatureMax(CPhidgetTemperatureSensorHandle phid, int index, double *max);
00357 int CPhidgetTemperatureSensor_getTemperatureMin(CPhidgetTemperatureSensorHandle phid, int index, double *min);
00358 int CPhidgetTemperatureSensor_set_OnTemperatureChange_Handler(CPhidgetTemperatureSensorHandle phid, int ( *fptr)(CPhidgetTemperatureSensorHandle phid, void *userPtr, int index, double temperature), void *userPtr);
00359 int CPhidgetTemperatureSensor_getTemperatureChangeTrigger(CPhidgetTemperatureSensorHandle phid, int index, double *trigger);
00360 int CPhidgetTemperatureSensor_setTemperatureChangeTrigger(CPhidgetTemperatureSensorHandle phid, int index, double trigger);
00361 int CPhidgetTemperatureSensor_getPotential(CPhidgetTemperatureSensorHandle phid, int index, double *potential);
00362 int CPhidgetTemperatureSensor_getPotentialMax(CPhidgetTemperatureSensorHandle phid, int index, double *max);
00363 int CPhidgetTemperatureSensor_getPotentialMin(CPhidgetTemperatureSensorHandle phid, int index, double *min);
00364 int CPhidgetTemperatureSensor_getAmbientTemperature(CPhidgetTemperatureSensorHandle phid, double *ambient);
00365 int CPhidgetTemperatureSensor_getAmbientTemperatureMax(CPhidgetTemperatureSensorHandle phid, double *max);
00366 int CPhidgetTemperatureSensor_getAmbientTemperatureMin(CPhidgetTemperatureSensorHandle phid, double *min);
00367 int CPhidgetTemperatureSensor_getThermocoupleType(CPhidgetTemperatureSensorHandle phid, int index, CPhidgetTemperatureSensor_ThermocoupleType *type);
00368 int CPhidgetTemperatureSensor_setThermocoupleType(CPhidgetTemperatureSensorHandle phid, int index, CPhidgetTemperatureSensor_ThermocoupleType type);
00369 int CPhidgetTemperatureSensor_getNumTemperatureInputs(CPhidgetTemperatureSensorHandle,int *) __attribute__ ((deprecated)) ;
00370 typedef struct _CPhidgetTextLCD *CPhidgetTextLCDHandle;
00371 int CPhidgetTextLCD_create(CPhidgetTextLCDHandle *phid);
00372 int CPhidgetTextLCD_getRowCount(CPhidgetTextLCDHandle phid, int *count);
00373 int CPhidgetTextLCD_getColumnCount(CPhidgetTextLCDHandle phid, int *count);
00374 int CPhidgetTextLCD_getBacklight(CPhidgetTextLCDHandle phid, int *backlightState);
00375 int CPhidgetTextLCD_setBacklight(CPhidgetTextLCDHandle phid, int backlightState);
00376 int CPhidgetTextLCD_getContrast(CPhidgetTextLCDHandle phid, int *contrast);
00377 int CPhidgetTextLCD_setContrast(CPhidgetTextLCDHandle phid, int contrast);
00378 int CPhidgetTextLCD_getCursorOn(CPhidgetTextLCDHandle phid, int *cursorState);
00379 int CPhidgetTextLCD_setCursorOn(CPhidgetTextLCDHandle phid, int cursorState);
00380 int CPhidgetTextLCD_getCursorBlink(CPhidgetTextLCDHandle phid, int *cursorBlinkState);
00381 int CPhidgetTextLCD_setCursorBlink(CPhidgetTextLCDHandle phid, int cursorBlinkState);
00382 int CPhidgetTextLCD_setCustomCharacter(CPhidgetTextLCDHandle phid, int index, int var1,int var2);
00383 int CPhidgetTextLCD_setDisplayCharacter(CPhidgetTextLCDHandle phid, int index, int column,unsigned char character);
00384 int CPhidgetTextLCD_setDisplayString(CPhidgetTextLCDHandle phid, int index, char *displayString);
00385 int CPhidgetTextLCD_getNumRows(CPhidgetTextLCDHandle,int *) __attribute__ ((deprecated)) ;
00386 int CPhidgetTextLCD_getNumColumns(CPhidgetTextLCDHandle,int *) __attribute__ ((deprecated)) ;
00387 typedef struct _CPhidgetTextLED *CPhidgetTextLEDHandle;
00388 int CPhidgetTextLED_create(CPhidgetTextLEDHandle *phid);
00389 int CPhidgetTextLED_getRowCount(CPhidgetTextLEDHandle phid, int *count);
00390 int CPhidgetTextLED_getColumnCount(CPhidgetTextLEDHandle phid, int *count);
00391 int CPhidgetTextLED_getBrightness(CPhidgetTextLEDHandle phid, int *brightness);
00392 int CPhidgetTextLED_setBrightness(CPhidgetTextLEDHandle phid, int brightness);
00393 int CPhidgetTextLED_setDisplayString(CPhidgetTextLEDHandle phid, int index, char *displayString);
00394 int CPhidgetTextLED_getNumRows(CPhidgetTextLEDHandle,int *) __attribute__ ((deprecated)) ;
00395 int CPhidgetTextLED_getNumColumns(CPhidgetTextLEDHandle,int *) __attribute__ ((deprecated)) ;
00396 typedef struct _CPhidgetWeightSensor *CPhidgetWeightSensorHandle;
00397 int CPhidgetWeightSensor_create(CPhidgetWeightSensorHandle *phid);
00398 int CPhidgetWeightSensor_getWeight(CPhidgetWeightSensorHandle phid, double *weight);
00399 int CPhidgetWeightSensor_set_OnWeightChange_Handler(CPhidgetWeightSensorHandle phid, int ( *fptr)(CPhidgetWeightSensorHandle phid, void *userPtr, double weight), void *userPtr);
00400 int CPhidgetWeightSensor_getWeightChangeTrigger(CPhidgetWeightSensorHandle phid, double *trigger);
00401 int CPhidgetWeightSensor_setWeightChangeTrigger(CPhidgetWeightSensorHandle phid, double trigger);
00402 #ifndef CPHIDGET_CONSTANTS
00403 #define CPHIDGET_CONSTANTS
00404
00414 #define PHIDGET_ATTACHED 0x1
00415 #define PHIDGET_NOTATTACHED 0x0
00422 #define PHIDGET_ERROR_CODE_COUNT 20
00423 #define EPHIDGET_OK 0
00424 #define EPHIDGET_NOTFOUND 1
00425 #define EPHIDGET_NOMEMORY 2
00426 #define EPHIDGET_UNEXPECTED 3
00427 #define EPHIDGET_INVALIDARG 4
00428 #define EPHIDGET_NOTATTACHED 5
00429 #define EPHIDGET_INTERRUPTED 6
00430 #define EPHIDGET_INVALID 7
00431 #define EPHIDGET_NETWORK 8
00432 #define EPHIDGET_UNKNOWNVAL 9
00433 #define EPHIDGET_BADPASSWORD 10
00434 #define EPHIDGET_UNSUPPORTED 11
00435 #define EPHIDGET_DUPLICATE 12
00436 #define EPHIDGET_TIMEOUT 13
00437 #define EPHIDGET_OUTOFBOUNDS 14
00438 #define EPHIDGET_EVENT 15
00439 #define EPHIDGET_NETWORK_NOTCONNECTED 16
00440 #define EPHIDGET_WRONGDEVICE 17
00441 #define EPHIDGET_CLOSED 18
00442 #define EPHIDGET_BADVERSION 19
00449 #define PUNK_BOOL 0x02
00450 #define PUNK_SHRT 0x7FFF
00451 #define PUNK_INT 0x7FFFFFFF
00452 #define PUNK_INT64 0x7FFFFFFFFFFFFFFFLL
00453 #define PUNK_DBL 1e300
00454 #define PUNK_FLT 1e30
00457 #define PFALSE 0x00
00458 #define PTRUE 0x01
00462 #endif
00463
00464 #ifdef __cplusplus
00465 }
00466 #endif
00467 #endif