<?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>how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4311/how-to-change-new-device_number-when-ant-device-is-working</link><description>Hello, 
 I use nrf51422 to connect the ANT device(Heart rate monitor) and it can work . 
 My question is ,
I want to assign a new device_number to 51422 and use this new device_number to search second ANT+ device ,but I found the 51422 will be reset</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Nov 2014 05:47:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4311/how-to-change-new-device_number-when-ant-device-is-working" /><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15354?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2014 05:47:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e101076-0a2e-4ed7-885c-05c986e1913f</guid><dc:creator>chao</dc:creator><description>&lt;p&gt;thanks all,
I wait for softdevice return 0x00,then do next command ,and this problem was solved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15352?ContentTypeID=1</link><pubDate>Fri, 14 Nov 2014 13:07:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:531dfc6c-8637-4e58-b13e-bf41e1bf7611</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;I just added a for-loop after the err_code = sd_ant_channel_close(ANT_HRMRX_ANT_CHANNEL); that counted to 6000 and that was it. I don&amp;#39;t want to share it as it&amp;#39;s not the way to go, but it was a way to figure out what went wrong. You should follow testy&amp;#39;s recommendations above here and wait for the EVENT_CHANNEL_CLOSED.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15353?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 04:49:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1a9d863-d125-48d6-bdba-411655a9c6a1</guid><dc:creator>chao</dc:creator><description>&lt;p&gt;Hi Asbjørn :
Could you please give me your example ?It can  help me to pick out the wrong on my process.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15355?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 13:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:830163b0-c4ef-4463-944e-31c728cc3189</guid><dc:creator>testy</dc:creator><description>&lt;p&gt;You should wait, stack will send &lt;strong&gt;EVENT_CHANNEL_CLOSED&lt;/strong&gt; afterwards. Return code 0x00 is just NRF_SUCCESS and indicates, that sd_ant_channel_close command has been succeeded.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15351?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2014 05:52:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64bea828-c987-4aac-a9e9-1e4d4d41058a</guid><dc:creator>chao</dc:creator><description>&lt;p&gt;how to know channel is closed or not?  I get error code from &amp;quot;sd_ant_channel_close&amp;quot; is 0x00.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15350?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2014 08:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:902bd723-60fa-4311-8eff-d8a57ebda245</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;pre&gt;&lt;code&gt;#define NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATE          NRF_ANT_ERROR_OFFSET + CHANNEL_IN_WRONG_STATE  ///&amp;lt; Response on attempt to perform an action from the wrong channel state.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It seems like you haven&amp;#39;t closed the channel you are trying to re-configure. Make sure that the channel is closed before you modify the parameters.&lt;/p&gt;
&lt;p&gt;edit:
You have do add a delay to ensure that the channel is closed before you change any parameters on it. I tested the routine you sent me here and it works, but it needs a delay. I did a nasty little for-loop to add a delay quickly, I would recommend you to wait for the callback and make sure that the channel is closed correctly before you change the device number and you should be fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15349?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2014 08:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a520c444-dd7a-4aa7-9924-e42cb8bacd13</guid><dc:creator>chao</dc:creator><description>&lt;p&gt;I get some date from  app_error_handler() .&lt;/p&gt;
&lt;p&gt;error code: 0x4015&lt;/p&gt;
&lt;p&gt;and error line is at:&lt;/p&gt;
&lt;p&gt;err_code = sd_ant_channel_assign(ANT_HRMRX_ANT_CHANNEL,
ANT_HRMRX_CHANNEL_TYPE,
ANTPLUS_NETWORK_NUMBER,
ANT_HRMRX_EXT_ASSIGN);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);    // &amp;lt;------  error is at this line&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15348?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2014 08:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e235576e-9f36-4a32-853f-020a30715c9a</guid><dc:creator>chao</dc:creator><description>&lt;p&gt;thanks your suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to change new device_number when ANT device is working</title><link>https://devzone.nordicsemi.com/thread/15347?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2014 11:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2a837b3-4074-49ad-ac8e-d8c806912bec</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;What error code do you get? In main there are assert callbacks and app_error_handler that will display the error code and on which line it went wrong. Would also encourage you to try and step through the code with the debugger to see on which line it goes wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>