From: Martin Ling Date: Sat, 6 Sep 2014 13:56:20 +0000 (+0100) Subject: C++: Preserve original channel ordering. X-Git-Tag: libsigrok-0.4.0~1024 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=be43d5d58472a54fbf49df93781be4775a831a41;p=libsigrok.git C++: Preserve original channel ordering. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index dc8eded7..76d3e8ec 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -465,8 +465,10 @@ string Device::get_version() vector> Device::get_channels() { vector> 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; }