C++: Preserve original channel ordering.

This commit is contained in:
Martin Ling 2014-09-06 14:56:20 +01:00 committed by Uwe Hermann
parent d9eed47d5b
commit be43d5d584
1 changed files with 4 additions and 2 deletions

View File

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