]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lascar-el-usb/protocol.c
Factor out std_session_send_df_end() helper.
[libsigrok.git] / src / hardware / lascar-el-usb / protocol.c
index ac8b6ff9c4fe5f8e86806d71988366f2780b40b3..9fd9b696466a09eac8921d0d26c263bde7b46d10 100644 (file)
@@ -52,7 +52,7 @@ static const struct elusb_profile profiles[] = {
        { 19, "EL-USB-1-LCD", LOG_UNSUPPORTED },
        { 20, "EL-OEM-3", LOG_UNSUPPORTED },
        { 21, "EL-USB-1-LCD", LOG_UNSUPPORTED },
-       { 0, NULL, 0 }
+       ALL_ZERO
 };
 
 static libusb_device_handle *lascar_open(struct libusb_device *dev)
@@ -477,7 +477,6 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
 SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data)
 {
        struct drv_context *drvc = di->context;
-       struct sr_datafeed_packet packet;
        struct sr_dev_inst *sdi;
        struct timeval tv;
 
@@ -488,9 +487,7 @@ SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data)
 
        if (sdi->status == SR_ST_STOPPING) {
                usb_source_remove(sdi->session, drvc->sr_ctx);
-
-               packet.type = SR_DF_END;
-               sr_session_send(cb_data, &packet);
+               std_session_send_df_end(cb_data, LOG_PREFIX);
        }
 
        memset(&tv, 0, sizeof(struct timeval));