* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "protocol.h"
#include "gpio.h"
+enum channel_type {
+ ENRG_PWR = 1,
+ ENRG_CURR,
+ ENRG_VOL,
+ TEMP_IN,
+ TEMP_OUT,
+};
+
struct channel_group_priv {
int hwmon_num;
int probe_type;
int index;
+ int has_pws;
};
struct channel_priv {
cgp->hwmon_num = hwmon;
cgp->probe_type = type;
cgp->index = prb_num - 1;
+ cgp->has_pws = sr_gpio_getval_export(pws_info_gpios[cgp->index]);
cg->name = g_strdup_printf("Probe_%d", prb_num);
cg->priv = cgp;
{
struct channel_group_priv *cgp = cg->priv;
- return sr_gpio_getval_export(pws_info_gpios[cgp->index]);
+ return cgp->has_pws;
}
/*
len = read(fd, buf, sizeof(buf));
if (len < 0) {
- sr_err("Error reading from channel %s (hwmon: %s): %s",
+ sr_err("Error reading from channel %s (hwmon: %d): %s",
ch->name, chp->probe->hwmon_num, g_strerror(errno));
ch->enabled = FALSE;
return -1.0;