]> sigrok.org Git - libsigrok.git/commitdiff
Remove obsolete API call sr_dev_trigger_set().
authorBert Vermeulen <redacted>
Tue, 27 May 2014 22:01:54 +0000 (00:01 +0200)
committerBert Vermeulen <redacted>
Tue, 27 May 2014 22:01:54 +0000 (00:01 +0200)
Triggers are now set on the session, not on a channel.

device.c
libsigrok.h
proto.h

index 889f02df6e37ac01f4a0e9cea00564be2b8ebdda..9b6412d2e621d1a52df203d7002673275f47ad57 100644 (file)
--- a/device.c
+++ b/device.c
@@ -157,62 +157,6 @@ SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum,
        return ret;
 }
 
-/**
- * Add a trigger to the specified device (and the specified channel).
- *
- * If the specified channel of this device already has a trigger, it will
- * be silently replaced.
- *
- * @param[in,out] sdi Pointer to the device instance; must not be NULL.
- * @param[in] channelnum Number of channel, starting at 0.
- * @param[in] trigger Trigger string, in the format used by sigrok-cli
- *
- * @return SR_OK on success or SR_ERR on failure.  In case of invalid
- *         arguments, SR_ERR_ARG is returned and the trigger settings
- *         remain unchanged.
- *
- * @since 0.2.0
- */
-SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum,
-               const char *trigger)
-{
-       GSList *l;
-       struct sr_channel *ch;
-       char *old_trigger;
-       int ret;
-
-       if (!sdi)
-               return SR_ERR_ARG;
-
-       ret = SR_ERR_ARG;
-       for (l = sdi->channels; l; l = l->next) {
-               ch = l->data;
-               if (ch->index == channelnum) {
-                       old_trigger = ch->trigger;
-                       ret = SR_OK;
-                       if (g_strcmp0(trigger, old_trigger) == 0)
-                               break;
-                       /* Set new trigger if it has changed. */
-                       ch->trigger = g_strdup(trigger);
-
-                       if (sdi->driver && sdi->driver->config_channel_set) {
-                               ret = sdi->driver->config_channel_set(
-                                       sdi, ch, SR_CHANNEL_SET_TRIGGER);
-                               /* Roll back change if it wasn't applicable. */
-                               if (ret == SR_ERR_ARG) {
-                                       g_free(ch->trigger);
-                                       ch->trigger = old_trigger;
-                                       break;
-                               }
-                       }
-                       g_free(old_trigger);
-                       break;
-               }
-       }
-
-       return ret;
-}
-
 /**
  * Determine whether the specified device instance has the specified
  * capability.
index 3408f4338392e8b9b3061866426fac1f3980368a..dd776c35146ee4e62dc45b71673d7d778ff04b2d 100644 (file)
@@ -979,7 +979,7 @@ struct sr_dev_driver {
                        const struct sr_dev_inst *sdi,
                        const struct sr_channel_group *cg);
        /** Channel status change.
-        *  @see sr_dev_channel_enable(), sr_dev_trigger_set(). */
+        *  @see sr_dev_channel_enable(). */
        int (*config_channel_set) (const struct sr_dev_inst *sdi,
                        struct sr_channel *ch, unsigned int changes);
        /** Apply configuration settings to the device hardware.
diff --git a/proto.h b/proto.h
index 2a2b9a6a397f24e7718991a53db7fb5acfe7c2ec..0e9af5a5ec263ab42d81f774d1a741fcb1631fd5 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -49,8 +49,6 @@ SR_API int sr_dev_channel_name_set(const struct sr_dev_inst *sdi,
                int channelnum, const char *name);
 SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum,
                gboolean state);
-SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum,
-               const char *trigger);
 SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key);
 SR_API GSList *sr_dev_list(const struct sr_dev_driver *driver);
 SR_API int sr_dev_clear(const struct sr_dev_driver *driver);