diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-04-14 12:56:48 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-04-14 12:56:48 +0100 |
commit | 0b624384cd52be20e61284551d832b499d7b7707 (patch) | |
tree | 6f95a4bbef47abc9720b96c0722e8f632aef228a /cphidgetweightsensor.h | |
download | libphidget21-0b624384cd52be20e61284551d832b499d7b7707.tar.gz |
Imported Upstream version 2.1.8.20120216upstream/2.1.8.20120216
Diffstat (limited to '')
-rw-r--r-- | cphidgetweightsensor.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cphidgetweightsensor.h b/cphidgetweightsensor.h new file mode 100644 index 0000000..863f76c --- /dev/null +++ b/cphidgetweightsensor.h @@ -0,0 +1,56 @@ +#ifndef __CPHIDGETWEIGHTSENSOR +#define __CPHIDGETWEIGHTSENSOR +#include "cphidget.h" + +/** \defgroup phidweight Phidget Weight Sensor + * \ingroup phidgets + * Calls specific to the Phidget Weight Sensor. See the product manual for more specific API details, supported functionality, units, etc. + * @{ + */ + +DPHANDLE(WeightSensor) +CHDRSTANDARD(WeightSensor) + +/** + * Gets the sensed weight. + * @param phid An attached phidget weight sensor handle. + * @param weight The weight. + */ +CHDRGET(WeightSensor,Weight,double *weight) +/** + * Set a weight change handler. This is called when the weight changes by more then the change trigger. + * @param phid An attached phidget weight sensor handle. + * @param fptr Callback function pointer. + * @param userPtr A pointer for use by the user - this value is passed back into the callback function. + */ +CHDREVENT(WeightSensor,WeightChange,double weight) +/** + * Gets the weight change trigger. + * @param phid An attached phidget weight sensor handle. + * @param trigger The change trigger. + */ +CHDRGET(WeightSensor,WeightChangeTrigger,double *trigger) +/** + * Sets the weight change trigger. + * @param phid An attached phidget weight sensor handle. + * @param trigger The change trigger. + */ +CHDRSET(WeightSensor,WeightChangeTrigger,double trigger) + +#ifndef EXTERNALPROTO +struct _CPhidgetWeightSensor { + CPhidget phid; + + int (CCONV *fptrWeightChange)(CPhidgetWeightSensorHandle, void *, double); + + void *fptrWeightChangeptr; + + double Weight; + double lastweight; + double WeightChangeTrigger; +} typedef CPhidgetWeightSensorInfo; +#endif + +/** @} */ + +#endif |