]> sigrok.org Git - libsigrok.git/commitdiff
C++: Preserve original channel ordering.
authorMartin Ling <redacted>
Sat, 6 Sep 2014 13:56:20 +0000 (14:56 +0100)
committerUwe Hermann <redacted>
Mon, 8 Sep 2014 17:27:38 +0000 (19:27 +0200)
bindings/cxx/classes.cpp

index dc8eded7b4aac6e010702cf5e49a41d92947e2cb..76d3e8ecfed5c9a32d22967016e0adde7901ac63 100644 (file)
@@ -465,8 +465,10 @@ string Device::get_version()
 vector<shared_ptr<Channel>> Device::get_channels()
 {
        vector<shared_ptr<Channel>> result;
-       for (auto entry : channels)
-               result.push_back(entry.second->get_shared_pointer(get_shared_from_this()));
+       for (auto channel = structure->channels; channel; channel = channel->next)
+               result.push_back(
+                       channels[(struct sr_channel *) channel->data]->get_shared_pointer(
+                               get_shared_from_this()));
        return result;
 }