commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/03: example code: pmt::dict_add doesn't


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/03: example code: pmt::dict_add doesn't modify; returns new pmt_t
Date: Wed, 14 Dec 2016 00:35:45 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 0a1f29216d5cb248919a610dbe389633ee21e329
Author: Marcus Müller <address@hidden>
Date:   Mon Dec 12 20:00:03 2016 +0100

    example code: pmt::dict_add doesn't modify; returns new pmt_t
    
    Following up on
    https://lists.gnu.org/archive/html/discuss-gnuradio/2016-12/msg00140.html
---
 gr-uhd/doc/uhd.dox | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox
index 27a1475..a3de8e3 100644
--- a/gr-uhd/doc/uhd.dox
+++ b/gr-uhd/doc/uhd.dox
@@ -57,8 +57,8 @@ which automatically sets the PMT types. Assume we only want 
to set the frequency
 (i.e. the second channel). In this case, we must construct a dictionary:
 \code{.cpp}
 pmt::pmt_t command = pmt::make_dict();
-pmt::dict_add(command, pmt::mp("freq"), pmt::mp(1.1e9)); // Specify frequency
-pmt::dict_add(command, pmt::mp("chan"), pmt::mp(1)); // Specify channel
+command = pmt::dict_add(command, pmt::mp("freq"), pmt::mp(1.1e9)); // Specify 
frequency
+command = pmt::dict_add(command, pmt::mp("chan"), pmt::mp(1)); // Specify 
channel
 // Now pass 'command' into the USRP block's command port
 \endcode
 
@@ -72,8 +72,8 @@ The main difference is that we can add more properties to the 
same
 command PMT, e.g. as such:
 \code{.cpp}
 // 'command' is the same PMT as in the previous example
-pmt::dict_add(command, pmt::mp("gain"), pmt::mp(23.0)); // Specify gain
-pmt::dict_add(command, pmt::mp("antenna"), pmt::mp("TX/RX")); // Switch antenna
+command = pmt::dict_add(command, pmt::mp("gain"), pmt::mp(23.0)); // Specify 
gain
+command = pmt::dict_add(command, pmt::mp("antenna"), pmt::mp("TX/RX")); // 
Switch antenna
 // Now pass 'command' into the USRP block's command port
 \endcode
 When the USRP block interprets this command PMT, all properties will be



reply via email to

[Prev in Thread] Current Thread [Next in Thread]