]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/chronovu-la/api.c
Add sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.
[libsigrok.git] / src / hardware / chronovu-la / api.c
index ea247d42be898213f75e114195490c04c06a00ee..3ccac06b8e9ef30cc7f91c007ee9756e539a6a0f 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -44,8 +43,6 @@ static const int32_t trigger_matches[] = {
        SR_TRIGGER_FALLING,
 };
 
-static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-
 static void clear_helper(void *priv)
 {
        struct dev_context *devc;
@@ -453,7 +450,7 @@ static int receive_data(int fd, int revents, void *cb_data)
        /* Get one block of data. */
        if ((ret = cv_read_block(devc)) < 0) {
                sr_err("Failed to read data block: %d.", ret);
-               dev_acquisition_stop(sdi);
+               sr_dev_acquisition_stop(sdi);
                return FALSE;
        }
 
@@ -476,7 +473,7 @@ static int receive_data(int fd, int revents, void *cb_data)
        for (i = 0; i < NUM_BLOCKS; i++)
                cv_send_block_to_session_bus(sdi, i);
 
-       dev_acquisition_stop(sdi);
+       sr_dev_acquisition_stop(sdi);
 
        return TRUE;
 }
@@ -537,7 +534,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        sr_dbg("Hardware acquisition started successfully.");
 
-       std_session_send_df_header(sdi, LOG_PREFIX);
+       std_session_send_df_header(sdi);
 
        /* Time when we should be done (for detecting trigger timeouts). */
        devc->done = (devc->divcount + 1) * devc->prof->trigger_constant +
@@ -553,9 +550,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
 static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
-       sr_dbg("Stopping acquisition.");
        sr_session_source_remove(sdi->session, -1);
-       std_session_send_df_end(sdi, LOG_PREFIX);
+       std_session_send_df_end(sdi);
 
        return SR_OK;
 }