- return dev;
-}
-
-/**
- * Add a probe with the specified name to the specified device.
- *
- * The added probe is automatically enabled (the 'enabled' field is TRUE).
- *
- * The 'trigger' field of the added probe is set to NULL. A trigger can be
- * added via sr_dev_trigger_set().
- *
- * TODO: Are duplicate names allowed?
- * TODO: Do we enforce a maximum probe number for a device?
- * TODO: Error if the max. probe number for the specific LA is reached, e.g.
- * if the caller tries to add more probes than the device actually has.
- *
- * @param dev The device to which to add a probe with the specified name.
- * Must not be NULL.
- * @param name The name of the probe to add to this device. Must not be NULL.
- * TODO: Maximum length, allowed characters, etc.
- *
- * @return SR_OK upon success, SR_ERR_MALLOC upon memory allocation errors,
- * or SR_ERR_ARG upon invalid arguments.
- * If something other than SR_OK is returned, 'dev' is unchanged.
- */
-SR_API int sr_dev_probe_add(struct sr_dev *dev, const char *name)
-{
- struct sr_probe *p;
- int probenum;
-
- if (!dev) {
- sr_err("dev: %s: dev was NULL", __func__);
- return SR_ERR_ARG;
- }
-
- if (!name) {
- sr_err("dev: %s: name was NULL", __func__);
- return SR_ERR_ARG;
- }
-
- /* TODO: Further checks to ensure name is valid. */
-
- probenum = g_slist_length(dev->probes) + 1;
-
- if (!(p = g_try_malloc0(sizeof(struct sr_probe)))) {
- sr_err("dev: %s: p malloc failed", __func__);
- return SR_ERR_MALLOC;
- }
-
- p->index = probenum;
- p->enabled = TRUE;
- p->name = g_strdup(name);
- p->trigger = NULL;
- dev->probes = g_slist_append(dev->probes, p);
-
- return SR_OK;
-}
-
-/**
- * Find the probe with the specified number in the specified device.
- *
- * TODO
- *
- * @param dev TODO. Must not be NULL.
- * @param probenum The number of the probe whose 'struct sr_probe' we want.
- * Note that the probe numbers start at 1 (not 0!).
- *
- * TODO: Should return int.
- * TODO: probenum should be unsigned.
- *
- * @return A pointer to the requested probe's 'struct sr_probe', or NULL
- * if the probe could not be found.
- */
-SR_API struct sr_probe *sr_dev_probe_find(const struct sr_dev *dev,
- int probenum)
-{
- GSList *l;
- struct sr_probe *p, *found_probe;
-
- if (!dev) {
- sr_err("dev: %s: dev was NULL", __func__);
- return NULL; /* TODO: SR_ERR_ARG */
- }
-
- /* TODO: Sanity check on probenum. */
-
- found_probe = NULL;
- for (l = dev->probes; l; l = l->next) {
- p = l->data;
- /* TODO: Check for p != NULL. */
- if (p->index == probenum) {
- found_probe = p;
- break;
- }
- }
-
- return found_probe;