]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/protocol.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / hardware / atten-pps3xxx / protocol.c
index 0db7e232ad5fe8b880af69dfa44ce64e6079b707..582a10d2bcf56f698b3f25db6efa167caa87828e 100644 (file)
@@ -17,8 +17,8 @@
  * 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)
@@ -83,10 +83,12 @@ static void handle_packet(const struct sr_dev_inst *sdi)
 
 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);
 }
@@ -162,4 +164,3 @@ SR_PRIV int atten_pps3xxx_receive_data(int fd, int revents, void *cb_data)
 
        return TRUE;
 }
-