]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/beaglelogic/protocol.c
Factor out std_session_send_df_end() helper.
[libsigrok.git] / src / hardware / beaglelogic / protocol.c
index a0a784e874502d6ca5ef93498674ac241c331468..f440592f30a3c571ade26cf4f43a9a25f721e1eb 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "protocol.h"
-#include <errno.h>
+#include <config.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include "protocol.h"
 
 /* Define data packet size independent of packet (bufunitsize bytes) size
  * from the BeagleLogic kernel module */
@@ -101,10 +101,7 @@ SR_PRIV int beaglelogic_receive_data(int fd, int revents, void *cb_data)
        if (devc->bytes_read >= devc->limit_samples * logic.unitsize ||
                        packetsize == 0) {
                /* Send EOA Packet, stop polling */
-               packet.type = SR_DF_END;
-               packet.payload = NULL;
-               sr_session_send(devc->cb_data, &packet);
-
+               std_session_send_df_end(devc->cb_data, LOG_PREFIX);
                sr_session_source_remove_pollfd(sdi->session, &devc->pollfd);
        }