Jam Detection Thread

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 

"simple coap server". I want to use the jamDetection in this code. I tried  to put the code you see down in the main file but it doesn't compile. I enabled the jamDetection in the config file and in the openthread file. 
How am I starting the Jamdetection? How can I put a Callback object in the otStartJamDetection function?

my function otJamDetectionIsEnabled(thread_ot_instance_get()) is alwys returning 0. Is this because there is no jamming at the moment or is it not really enanbled in the setting?

Or is there an example?

Best regards 

Verena

#include <openthread/thread.h>
#include <openthread/jam_detection.h>
#include <openthread/cli.h>     
     
     otCliOutputFormat("is enabled %d",otJamDetectionIsEnabled(thread_ot_instance_get()));

     otError otError = otJamDetectionSetRssiThreshold(thread_ot_instance_get(), aRssiThreshold);
     APP_ERROR_CHECK(otError);

     otCliOutputFormat("rssi treshold %d", otJamDetectionGetRssiThreshold(thread_ot_instance_get()));
     otCliOutputFormat("history bitmap %d", otJamDetectionGetHistoryBitmap(thread_ot_instance_get()));

     otStartJamDetection(thread_ot_instance_get(), otJamDetectionCallback aCallback,p_context);
     otCliOutputFormat("get state %d",otJamDetectionGetState(thread_ot_instance_get()));

Parents
  • Hello,

    Did you enable the jam detection through the CONFIGs? 

    When you call otStartJamDetection(..., otJamDetectioncallback, ...);, what is otJamDetectionCallback in your case? Is it a function that you have defined? I couldn't see this from your snippet.

    I don'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.

    According to jam_detection.h, the otJamDetectionIsEnabled() should return true (1) if it is enabled. From where do you call this function? And what does thread_ot_instance_get() return?

    You should also check the return values of the ot... function calls that you do, that return something, like otStartJamDetection()

    What SDK version do you use? Do you use NCS or nRF5 SDK? The reason I ask is that I can't find any references to otStartJamDetection(), but I can find otJamDetectionStart() in our SDK.

    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.

    Best regards,
    Edvin

Reply
  • Hello,

    Did you enable the jam detection through the CONFIGs? 

    When you call otStartJamDetection(..., otJamDetectioncallback, ...);, what is otJamDetectionCallback in your case? Is it a function that you have defined? I couldn't see this from your snippet.

    I don'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.

    According to jam_detection.h, the otJamDetectionIsEnabled() should return true (1) if it is enabled. From where do you call this function? And what does thread_ot_instance_get() return?

    You should also check the return values of the ot... function calls that you do, that return something, like otStartJamDetection()

    What SDK version do you use? Do you use NCS or nRF5 SDK? The reason I ask is that I can't find any references to otStartJamDetection(), but I can find otJamDetectionStart() in our SDK.

    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.

    Best regards,
    Edvin

Children
No Data
Related