* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <string.h>
-#include <errno.h>
#include "protocol.h"
-static void dump_packet(char *msg, uint8_t *packet)
+static void dump_packet(const char *msg, uint8_t *packet)
{
int i;
char str[128];
{
struct dev_context *devc;
struct sr_datafeed_packet packet;
- struct sr_datafeed_analog analog;
+ struct sr_datafeed_analog_old analog;
float value, data[MAX_CHANNELS];
int offset, i;
devc = sdi->priv;
dump_packet("received", devc->packet);
- packet.type = SR_DF_ANALOG;
+ packet.type = SR_DF_ANALOG_OLD;
packet.payload = &analog;
analog.channels = sdi->channels;
analog.num_samples = 1;
SR_PRIV void send_packet(const struct sr_dev_inst *sdi, uint8_t *packet)
{
+ struct dev_context *devc;
struct sr_serial_dev_inst *serial;
+ devc = sdi->priv;
serial = sdi->conn;
- if (serial_write_blocking(serial, packet, PACKET_SIZE, 0) < PACKET_SIZE)
+ if (serial_write_blocking(serial, packet, PACKET_SIZE, devc->delay_ms) < PACKET_SIZE)
sr_dbg("Failed to send packet.");
dump_packet("sent", packet);
}
return TRUE;
}
-