From: Martin Ling Date: Thu, 10 Jan 2019 00:24:32 +0000 (+0000) Subject: Create 8 logic channels on dummy device used for output. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9710a16a95584e51590c23bff9426f532ed7b98b;p=libsigrokflow.git Create 8 logic channels on dummy device used for output. --- diff --git a/include/libsigrokflow/libsigrokflow.hpp b/include/libsigrokflow/libsigrokflow.hpp index 8f18824..56e248d 100644 --- a/include/libsigrokflow/libsigrokflow.hpp +++ b/include/libsigrokflow/libsigrokflow.hpp @@ -175,7 +175,7 @@ public: private: shared_ptr libsigrok_output_format_; - shared_ptr libsigrok_device_; + shared_ptr libsigrok_device_; shared_ptr libsigrok_output_; map options_; }; diff --git a/src/legacy_output.cpp b/src/legacy_output.cpp index 6e32c8b..21d8c2f 100644 --- a/src/legacy_output.cpp +++ b/src/legacy_output.cpp @@ -67,6 +67,11 @@ Glib::RefPtrLegacyOutput::create( output->libsigrok_output_format_ = libsigrok_output_format; auto context = libsigrok_output_format->parent(); output->libsigrok_device_ = context->create_user_device("Vendor", "Model", "Version"); + for (int i = 0; i < 8; ++i) { + gchar *name = g_strdup_printf("D%d", i); + output->libsigrok_device_->add_channel(i, sigrok::ChannelType::LOGIC, name); + g_free(name); + } output->options_ = options; return output;