* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
#include "protocol.h"
#define NUM_CHANNELS 4
{
int ret;
- if ((ret = serial_write_blocking(serial, cmd, strlen(cmd), 0)) < 0) {
+ if ((ret = serial_write_blocking(serial, cmd, strlen(cmd),
+ serial_timeout(serial, strlen(cmd)))) < 0) {
sr_err("Error sending '%s' command: %d.", cmd, ret);
return SR_ERR;
}
static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
{
struct sr_datafeed_packet packet;
- struct sr_datafeed_analog analog;
+ struct sr_datafeed_analog_old analog;
struct dev_context *devc;
struct center_info info;
GSList *l;
devc = sdi->priv;
- memset(&analog, 0, sizeof(struct sr_datafeed_analog));
+ memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
memset(&info, 0, sizeof(struct center_info));
ret = packet_parse(buf, idx, &info);
}
/* Common values for all 4 channels. */
- packet.type = SR_DF_ANALOG;
+ packet.type = SR_DF_ANALOG_OLD;
packet.payload = &analog;
analog.mq = SR_MQ_TEMPERATURE;
analog.unit = (info.celsius) ? SR_UNIT_CELSIUS : SR_UNIT_FAHRENHEIT;