Add sr_dev_inst_channels_get() and sr_dev_inst_channel_groups_get().

This commit is contained in:
Uwe Hermann 2014-11-11 11:51:53 +01:00
parent 3f2cd87f36
commit e437da2b86
2 changed files with 32 additions and 0 deletions

View File

@ -61,6 +61,8 @@ SR_API const char *sr_dev_inst_model_get(struct sr_dev_inst *sdi);
SR_API const char *sr_dev_inst_version_get(struct sr_dev_inst *sdi);
SR_API const char *sr_dev_inst_sernum_get(struct sr_dev_inst *sdi);
SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi);
SR_API GSList *sr_dev_inst_channels_get(struct sr_dev_inst *sdi);
SR_API GSList *sr_dev_inst_channel_groups_get(struct sr_dev_inst *sdi);
/*--- hwdriver.c ------------------------------------------------------------*/

View File

@ -630,4 +630,34 @@ SR_API const char *sr_dev_inst_connid_get(struct sr_dev_inst *sdi)
return sdi->connection_id;
}
/**
* Queries a device instances' channel list.
*
* @param sdi Device instance to use. Must not be NULL.
*
* @return The GSList of channels or NULL.
*/
SR_API GSList *sr_dev_inst_channels_get(struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
return sdi->channels;
}
/**
* Queries a device instances' channel groups list.
*
* @param sdi Device instance to use. Must not be NULL.
*
* @return The GSList of channel groups or NULL.
*/
SR_API GSList *sr_dev_inst_channel_groups_get(struct sr_dev_inst *sdi)
{
if (!sdi)
return NULL;
return sdi->channel_groups;
}
/** @} */