diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2009-02-01 16:22:03 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-02-01 16:22:03 +1100 |
commit | f5192075ca25e91ae72f12c89cab0c9c66eb6606 (patch) | |
tree | b58644d00033fea3a1f2a6cea5c462839a9f82de /ui/common/discover-client.c | |
parent | 03cc4474b6c6c189cc556ef857538a8150b53077 (diff) | |
download | talos-petitboot-f5192075ca25e91ae72f12c89cab0c9c66eb6606.tar.gz talos-petitboot-f5192075ca25e91ae72f12c89cab0c9c66eb6606.zip |
[discover client] Add device accessors
Allow the UIs to query the current device set.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/common/discover-client.c')
-rw-r--r-- | ui/common/discover-client.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c index 47c57cb..7c2e27d 100644 --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -156,3 +156,18 @@ int discover_client_process(struct discover_client *client) return 0; } + +/* accessors for discovered devices */ +int discover_client_device_count(struct discover_client *client) +{ + return client->n_devices; +} + +struct device *discover_client_get_device(struct discover_client *client, + int index) +{ + if (index < 0 || index >= client->n_devices) + return NULL; + + return client->devices[index]; +} |