Jam Detection

This module includes functions for signal jamming detection feature.

Summary

The functions in this module are available when jam-detection feature (OPENTHREAD_ENABLE_JAM_DETECTION) is enabled.

Typedefs

otJamDetectionCallback)(bool aJamState, void *aContext) typedef
void(*
This function pointer is called if signal jam detection is enabled and a jam is detected.

Functions

otJamDetectionGetBusyPeriod(otInstance *aInstance)
uint8_t
Get the Jam Detection Busy Period (in seconds)
otJamDetectionGetHistoryBitmap(otInstance *aInstance)
uint64_t
Get the current history bitmap.
otJamDetectionGetRssiThreshold(otInstance *aInstance)
int8_t
Get the Jam Detection RSSI Threshold (in dBm).
otJamDetectionGetState(otInstance *aInstance)
bool
Get the Jam Detection State.
otJamDetectionGetWindow(otInstance *aInstance)
uint8_t
Get the Jam Detection Detection Window (in seconds).
otJamDetectionIsEnabled(otInstance *aInstance)
bool
Get the Jam Detection Status (enabled/disabled)
otJamDetectionSetBusyPeriod(otInstance *aInstance, uint8_t aBusyPeriod)
Set the Jam Detection Busy Period (in seconds).
otJamDetectionSetRssiThreshold(otInstance *aInstance, int8_t aRssiThreshold)
Set the Jam Detection RSSI Threshold (in dBm).
otJamDetectionSetWindow(otInstance *aInstance, uint8_t aWindow)
Set the Jam Detection Detection Window (in seconds).
otJamDetectionStart(otInstance *aInstance, otJamDetectionCallback aCallback, void *aContext)
Start the jamming detection.
otJamDetectionStop(otInstance *aInstance)
Stop the jamming detection.

Typedefs

otJamDetectionCallback

void(* otJamDetectionCallback)(bool aJamState, void *aContext)

This function pointer is called if signal jam detection is enabled and a jam is detected.

Details
Parameters
[in] aJamState
Current jam state (true if jam is detected, false otherwise).
[in] aContext
A pointer to application-specific context.

Functions

otJamDetectionGetBusyPeriod

uint8_t otJamDetectionGetBusyPeriod(
  otInstance *aInstance
)

Get the Jam Detection Busy Period (in seconds)

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The Jam Detection Busy Period.

otJamDetectionGetHistoryBitmap

uint64_t otJamDetectionGetHistoryBitmap(
  otInstance *aInstance
)

Get the current history bitmap.

This value provides information about current state of jamming detection module for monitoring/debugging purpose. It returns a 64-bit value where each bit corresponds to one second interval starting with bit 0 for the most recent interval and bit 63 for the oldest intervals (63 sec earlier). The bit is set to 1 if the jamming detection module observed/detected high signal level during the corresponding one second interval.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The current history bitmap.

otJamDetectionGetRssiThreshold

int8_t otJamDetectionGetRssiThreshold(
  otInstance *aInstance
)

Get the Jam Detection RSSI Threshold (in dBm).

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The Jam Detection RSSI Threshold.

otJamDetectionGetState

bool otJamDetectionGetState(
  otInstance *aInstance
)

Get the Jam Detection State.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The Jam Detection state (true jam is detected, `false' otherwise).

otJamDetectionGetWindow

uint8_t otJamDetectionGetWindow(
  otInstance *aInstance
)

Get the Jam Detection Detection Window (in seconds).

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The Jam Detection Window.

otJamDetectionIsEnabled

bool otJamDetectionIsEnabled(
  otInstance *aInstance
)

Get the Jam Detection Status (enabled/disabled)

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Returns
The Jam Detection status (true if enabled, false otherwise).

otJamDetectionSetBusyPeriod

otError otJamDetectionSetBusyPeriod(
  otInstance *aInstance,
  uint8_t aBusyPeriod
)

Set the Jam Detection Busy Period (in seconds).

The number of aggregate seconds within the detection window where the RSSI must be above threshold to trigger detection.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aBusyPeriod
The Jam Detection busy period (should be non-zero and less than or equal to Jam Detection Window)
Return Values
OT_ERROR_NONE
Successfully set the window.
OT_ERROR_INVALID_ARGS
The given input is not within the valid range.

otJamDetectionSetRssiThreshold

otError otJamDetectionSetRssiThreshold(
  otInstance *aInstance,
  int8_t aRssiThreshold
)

Set the Jam Detection RSSI Threshold (in dBm).

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aRssiThreshold
The RSSI threshold.
Return Values
OT_ERROR_NONE
Successfully set the threshold.

otJamDetectionSetWindow

otError otJamDetectionSetWindow(
  otInstance *aInstance,
  uint8_t aWindow
)

Set the Jam Detection Detection Window (in seconds).

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aWindow
The Jam Detection window (valid range is 1 to 63)
Return Values
OT_ERROR_NONE
Successfully set the window.
OT_ERROR_INVALID_ARGS
The given input parameter not within valid range (1-63)

otJamDetectionStart

otError otJamDetectionStart(
  otInstance *aInstance,
  otJamDetectionCallback aCallback,
  void *aContext
)

Start the jamming detection.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aCallback
A pointer to a function called to notify of jamming state change.
[in] aContext
A pointer to application-specific context.
Return Values
OT_ERROR_NONE
Successfully started the jamming detection.
OT_ERROR_ALREADY
Jam detection has been started before.

otJamDetectionStop

otError otJamDetectionStop(
  otInstance *aInstance
)

Stop the jamming detection.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Return Values
OT_ERROR_NONE
Successfully stopped the jamming detection.
OT_ERROR_ALREADY
Jam detection is already stopped.