* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/** @file
- * <em>Motech LPS-30x series</em> power supply driver
- * @internal
+/**
+ * @file
+ *
+ * <em>Motech LPS-30x series</em> power supply driver
+ *
+ * @internal
*/
#include <config.h>
va_list args;
char buf[LINELEN_MAX];
char *bufptr;
- int buflen;
+ int buflen;
/* Send command */
va_start(args, fmt);
return SR_ERR;
}
-/** Send command and read reply string.
- * @param reply Pointer to buffer of size LINELEN_MAX. Will be NUL-terminated.
+/**
+ * Send command and read reply string.
+ * @param reply Pointer to buffer of size LINELEN_MAX. Will be NUL-terminated.
*/
SR_PRIV int lps_cmd_reply(char *reply, struct sr_serial_dev_inst *serial, const char *fmt, ...)
{
va_list args;
char buf[LINELEN_MAX];
char *bufptr;
- int buflen;
+ int buflen;
reply[0] = '\0';
return result;
}
-/** Read message into buf until "OK" received.
- * @retval SR_OK Msg received; buf and buflen contain result, if any except OK.
- * @retval SR_ERR Error, including timeout.
+/**
+ * Read message into buf until "OK" received.
+ *
+ * @retval SR_OK Msg received; buf and buflen contain result, if any except OK.
+ * @retval SR_ERR Error, including timeout.
*/
SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *buflen)
{
g_strstrip(buf);
verstr = buf + 4;
}
- else /* Bug in device FW 1.17: Querying version string fails while output is active.
+ else /* Bug in device FW 1.17: Querying version string fails while output is active.
Therefore just print an error message, but do not exit with error. */
sr_err("Failed to query for hardware version: %s.",
sr_strerror(ret));
case SR_CONF_DEVICE_OPTIONS:
if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t));
+ devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t));
else /* Must be CH3 */
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
- devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
+ devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t));
break;
case SR_CONF_VOLTAGE_TARGET:
g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 50,
motech_lps_30x_receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_sw_limits_acquisition_start(&devc->limits);
return SR_OK;
}
-static int dev_acquisition_stop(struct sr_dev_inst *sdi)
-{
- return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
-}
-
static struct sr_dev_driver motech_lps_301_driver_info = {
.name = "motech-lps-301",
.longname = "Motech LPS-301",
.dev_open = std_serial_dev_open,
.dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
- .dev_acquisition_stop = dev_acquisition_stop,
+ .dev_acquisition_stop = std_serial_dev_acquisition_stop,
.context = NULL,
};
SR_REGISTER_DEV_DRIVER(motech_lps_301_driver_info);