+ struct dev_context *devc;
+ int64_t now, elapsed;
+ struct sr_serial_dev_inst *serial;
+ int len;
+
+ /*
+ * Don't send the request while receive data is being accumulated.
+ */
+ devc = sdi->priv;
+ if (!force && devc->buflen)
+ return SR_OK;
+
+ /*
+ * Send the request when the transmit interval was reached. Or
+ * when the caller forced the transmission.
+ */
+ now = g_get_monotonic_time() / 1000;
+ elapsed = now - devc->cmd_sent_at;
+ if (!force && elapsed < POLL_PERIOD_MS)
+ return SR_OK;