]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/brymen-bm86x/api.c
Factor out std_session_send_df_end() helper.
[libsigrok.git] / src / hardware / brymen-bm86x / api.c
index 92baed540c4a292a678b40647afe8798c40aaf3a..d252208dc7272d14f377802eb0d53f88a405f601 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include "protocol.h"
 
 #define BRYMEN_BC86X "0820.0001"
@@ -264,7 +265,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        /* Send header packet to the session bus. */
        std_session_send_df_header(sdi, LOG_PREFIX);
 
-       sr_session_source_add(sdi->session, 0, 0, 10,
+       sr_session_source_add(sdi->session, -1, 0, 10,
                        brymen_bm86x_receive_data, (void *)sdi);
 
        return SR_OK;
@@ -272,18 +273,14 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 
 static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
 {
-       struct sr_datafeed_packet packet;
-
        (void)cb_data;
 
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
-       /* Send end packet to the session bus. */
-       packet.type = SR_DF_END;
-       sr_session_send(sdi, &packet);
+       std_session_send_df_end(sdi, LOG_PREFIX);
 
-       sr_session_source_remove(sdi->session, 0);
+       sr_session_source_remove(sdi->session, -1);
 
        return SR_OK;
 }