From 0b624384cd52be20e61284551d832b499d7b7707 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sat, 14 Apr 2012 12:56:48 +0100 Subject: Imported Upstream version 2.1.8.20120216 --- cphidgetweightsensor.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 cphidgetweightsensor.h (limited to 'cphidgetweightsensor.h') 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 -- cgit v1.2.3