From 837b08660a2ffaef0d2e47ef9555bd3af3f4874f Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Thu, 19 Mar 2015 21:41:51 +0000 Subject: [PATCH] Add sdi pointer to struct sr_channel. --- include/libsigrok/libsigrok.h | 2 ++ src/device.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 662e986e..0ea67af6 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -531,6 +531,8 @@ enum sr_channeltype { /** Information on single channel. */ struct sr_channel { + /** The device this channel is attached to. */ + struct sr_dev_inst *sdi; /** The index of this channel, starting at 0. Logic channels will * be encoded according to this index in SR_DF_LOGIC packets. */ int index; diff --git a/src/device.c b/src/device.c index 1c84a7df..78835d4c 100644 --- a/src/device.c +++ b/src/device.c @@ -57,6 +57,7 @@ SR_PRIV struct sr_channel *sr_channel_new(struct sr_dev_inst *sdi, struct sr_channel *ch; ch = g_malloc0(sizeof(struct sr_channel)); + ch->sdi = sdi; ch->index = index; ch->type = type; ch->enabled = enabled;