<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Radio Test software modification: need to create a new command option for CLI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57338/radio-test-software-modification-need-to-create-a-new-command-option-for-cli</link><description>Hello, I&amp;#39;m using the Radio Test software (SDK 15.2) to control the N52840 radio IC. Our circuit design requires the use of an external RF amplifier IC. Our software puts the external amplifier IC into different modes using 5 different GPIOs on the N52840</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Feb 2020 15:46:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57338/radio-test-software-modification-need-to-create-a-new-command-option-for-cli" /><item><title>RE: Radio Test software modification: need to create a new command option for CLI</title><link>https://devzone.nordicsemi.com/thread/233347?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 15:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce79e926-1e03-4aba-92f5-ff9c12bea98d</guid><dc:creator>jloud</dc:creator><description>&lt;p&gt;Got this working yesterday ... nice software. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio Test software modification: need to create a new command option for CLI</title><link>https://devzone.nordicsemi.com/thread/232670?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 18:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebce781b-57be-4269-a362-4286cb771590</guid><dc:creator>jloud</dc:creator><description>&lt;p&gt;Great reply&amp;nbsp;... working on this now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio Test software modification: need to create a new command option for CLI</title><link>https://devzone.nordicsemi.com/thread/232489?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 09:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:798336bc-2874-4083-885b-37d4b99306ab</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I see that you are currently looking at the radio_test application.&lt;/p&gt;
&lt;p&gt;IF you look in the file radio_cmd.c, you can see a bunch of calls to&amp;nbsp;NRF_CLI_CMD_REGISTER(), such as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_CLI_CMD_REGISTER(data_rate, &amp;amp;m_sub_data_rate, &amp;quot;Set data rate &amp;lt;sub_cmd&amp;gt;&amp;quot;, cmd_data_rate_set);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In this call:&lt;/p&gt;
&lt;p&gt;data_rate is the name of the command (the one you see in blue). &lt;br /&gt;m_sub_data_rate is where the second parameter is stored. &lt;br /&gt;&amp;quot;Set data rate&amp;quot; is what appears if you write &amp;quot;data_rate --help&amp;quot;. &lt;br /&gt;cmd_data_rate_set is the callback function.&lt;/p&gt;
&lt;p&gt;Since this command takes two variables, there is a sub command. This is linked to the data_rate_command by the function:&lt;/p&gt;
&lt;p&gt;NRF_CLI_CREATE_STATIC_SUBCMD_SET(m_sub_data_rate)&lt;/p&gt;
&lt;p&gt;which basically registers the different options. Let us look at one of them:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_CLI_CMD(nrf_1Mbit, NULL, &amp;quot;1 Mbit/s Nordic proprietary radio mode&amp;quot;, cmd_nrf_1mbit),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;nRF_1Mbit is the command that is entered (which will be shown in blue when you tab).&lt;br /&gt;NULL is a pointer to the next subcommand (which doesn&amp;#39;t exist in this case).&lt;br /&gt;&amp;quot;1 Mbit/s Nordic proprietary radio mode&amp;quot; is the help text.&lt;br /&gt;cmd_nrf_1mbit is the callback function that is called when the main and this sub command is called together.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So if you set up your radio_config similar to this, you will have a new set of commands with callbacks that you can use.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>