From: Martin Ling Date: Thu, 19 Mar 2015 21:41:51 +0000 (+0000) Subject: Add sdi pointer to struct sr_channel. X-Git-Tag: libsigrok-0.4.0~599 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=837b08660a2ffaef0d2e47ef9555bd3af3f4874f Add sdi pointer to struct sr_channel. --- 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;