<?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>Jam Detection Thread</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86851/jam-detection-thread</link><description>Hey, 
 
 I am trying to use the Jam Detection Feature of Openthread on my nrf52840 DK. The device is running as coap server with the example code 
 &amp;quot;simple coap server&amp;quot;. I want to use the jamDetection in this code. I tried to put the code you see down</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Apr 2022 07:08:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86851/jam-detection-thread" /><item><title>RE: Jam Detection Thread</title><link>https://devzone.nordicsemi.com/thread/364599?ContentTypeID=1</link><pubDate>Mon, 25 Apr 2022 07:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fce30106-bda2-4b39-9a53-9c31cbda2d3f</guid><dc:creator>Verena</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;your answer solved my problem. Thank you very much for your help!&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Verena&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jam Detection Thread</title><link>https://devzone.nordicsemi.com/thread/364355?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 06:26:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1411f3b-61cc-4525-b2f7-6498c5109f60</guid><dc:creator>Edvin</dc:creator><description>[quote user="Edvin Holmseth"]&lt;p&gt;What SDK version do you use? Do you use NCS or nRF5 SDK? The reason I ask is that I can&amp;#39;t find any references to&amp;nbsp;otStartJamDetection(), but I can find&amp;nbsp;otJamDetectionStart() in our SDK.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Can you please specify this?&lt;/p&gt;
[quote user="Verena"]In the instruction it is written to enable the jam detection in the&amp;nbsp;&lt;a href="https://github.com/openthread/openthread/tree/main/src/core/config/openthread-core-default-config.h"&gt;&lt;code dir="ltr"&gt;openthread/src/core/config/openthread-core-default-config.h&lt;/code&gt;&lt;/a&gt;[/quote]
&lt;p&gt;This link, nor the first link in your previous reply is leading anywhere. Can you please check both your links?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Verena"]This is out of the instruction, but I don&amp;#39;t know how to give aCallback in this function[/quote]
&lt;p&gt;You need to look up the definition of this parameter. otJamDetectionCallback is defined in openthread\include\openthread\jam_detection (at least in the openthread instance that is used in the nRF5 SDk for Thread and Zigbee.&amp;nbsp;&lt;strong&gt;If this is not what you are using, please specify what SDK you are using&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;typedef void (*otJamDetectionCallback)(bool aJamState, void *aContext);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This means that&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;you need to define a callback looking something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void my_jam_detection_callback(bool aJamState, void *aContext)
{
    NRF_LOG_INFO(&amp;quot;Jam state %d&amp;quot;, aJamState);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and then pass my_jam_detection_callback instead of aCallback when you call otJamDetectionStart():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;otError err_code;

otInstance my_instance = ...;

err_code = otJamDetectionStart(&amp;amp;my_instance, my_jam_detection_callback, NULL);
NRF_LOG_INFO(&amp;quot;otJamDetectionStart returned %d&amp;quot;, err_code);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jam Detection Thread</title><link>https://devzone.nordicsemi.com/thread/363988?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 14:19:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6990a266-b763-4e9c-b77f-771153c80ae0</guid><dc:creator>Verena</dc:creator><description>&lt;p&gt;I enabled the Jam detection in&amp;nbsp;&lt;a href="https://github.com/openthread/openthread/tree/main/src/core/config/openthread-core-default-config.h"&gt;&lt;code dir="ltr"&gt;openthread/src/core/config/openthread-core-config-check.h&lt;/code&gt;&lt;/a&gt;&amp;nbsp;and also in the sdk_config.h .&lt;br /&gt;But if I am calling the method&amp;nbsp;otJamDetectionIsEnabled(thread_ot_instance_get())) i am always getting 0 back. The thread_ot_instance_get is a method which is getting the actuall instance. The instance is required as an argument&amp;nbsp; for&amp;nbsp; the function&amp;nbsp; &amp;nbsp; &amp;nbsp;***&amp;nbsp;&lt;span class="kwd"&gt;bool&lt;/span&gt;&lt;span class="pln"&gt; otJamDetectionIsEnabled&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href="https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960"&gt;&lt;span class="pln"&gt;otInstance&lt;/span&gt;&lt;/a&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;aInstance&amp;nbsp;&lt;/span&gt;&lt;span class="pun"&gt;) ***.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pun"&gt;In the instruction it is written to enable the jam detection in the&amp;nbsp;&lt;a href="https://github.com/openthread/openthread/tree/main/src/core/config/openthread-core-default-config.h"&gt;&lt;code dir="ltr"&gt;openthread/src/core/config/openthread-core-default-config.h&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;, but there is no such file in my openthread repository.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pun"&gt;&lt;span&gt;Where should I enable this to solve this problem?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pun"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pun"&gt;&lt;span&gt;My second problem is that I don&amp;#39;t know how to call the starting function.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;otError otJamDetectionStart(
  otInstance *aInstance,
  otJamDetectionCallback aCallback,
  void *aContext
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is out of the instruction, but I don&amp;#39;t know how to give aCallback in this function. ainstance and aContext are already defined in some example code snippets, so I know these. Should I define my own function ? Or what should I place there.&lt;/p&gt;
&lt;p&gt;I would be glad about some help.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Verena&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Jam Detection Thread</title><link>https://devzone.nordicsemi.com/thread/363049?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 13:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57935d0a-e153-488e-b2e0-6ba8c0a6f525</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Did you enable the jam detection through the CONFIGs?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you call otStartJamDetection(..., otJamDetectioncallback, ...);, what is otJamDetectionCallback in your case? Is it a function that you have defined? I couldn&amp;#39;t see this from your snippet.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think this callback should fire unless there is actually something jamming your network, so I guess it is a bit difficult to test unless you have a jammer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;According to jam_detection.h, the&amp;nbsp;&lt;span&gt;otJamDetectionIsEnabled()&amp;nbsp;should return true (1) if it is enabled. From where do you call this function? And what does thread_ot_instance_get() return?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You should also check the return values of the ot... function calls that you do, that return something, like otStartJamDetection()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What SDK version do you use? Do you use NCS or nRF5 SDK? The reason I ask is that I can&amp;#39;t find any references to&amp;nbsp;otStartJamDetection(), but I can find&amp;nbsp;otJamDetectionStart() in our SDK.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please note that we are very short staffed here in Norway due to Easter Holidays this week (and Monday next week). This will lead to a longer than usual response time. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>