# Link

This module includes functions that control link-layer configuration.

## Summary

| ### Enumerations ||
|---|---|
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac833df157d22280e15142b2d05a79bbc{ https://openthread.io/reference/group/api-link-link#group__api-link-link_1ggac833df157d22280e15142b2d05a79bbcaa73cbd5a3c3635be9c7ea52bb766dfaf, https://openthread.io/reference/group/api-link-link#group__api-link-link_1ggac833df157d22280e15142b2d05a79bbcacfa90ae8a29eff4bd92e21f5d453e2ec, https://openthread.io/reference/group/api-link-link#group__api-link-link_1ggac833df157d22280e15142b2d05a79bbca4646f62fdbed4c9c85f8c7203793a697 }` | enumDefines address mode of the mac filter. |

| ### Typedefs ||
|---|---|
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga790d3662a5cb6281e2043a0373d64d5d` | typedef `struct https://openthread.io/reference/struct/ot-active-scan-result` Represents a received IEEE 802.15.4 Beacon. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga667d7f8c8d46993c1b11d0eb471f9a6e` | typedef `struct https://openthread.io/reference/struct/ot-energy-scan-result` Represents an energy scan result. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga8717d8d12c10477157792b70780e3b74)(otActiveScanResult *aResult, void *aContext)` | typedef `void(*` Pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab96eb83d21ae0da816b553ceeee50f01)(otEnergyScanResult *aResult, void *aContext)` | typedef `void(*` Pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga88b24424c2850c95d5624d25e62f8066)(const otRadioFrame *aFrame, bool aIsTx, void *aContext)` | typedef `void(*` Pointer is called when an IEEE 802.15.4 frame is received. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac8fcc59fc73008ffc45eee559356d1b0` | typedef `struct https://openthread.io/reference/struct/ot-mac-counters` Represents the MAC layer counters. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga8542ff803b66385c90fd46328127f6a6` | typedef `enum https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac833df157d22280e15142b2d05a79bbc` Defines address mode of the mac filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac3162d26f1b02b0754510c6026709295` | typedef `struct https://openthread.io/reference/struct/ot-mac-filter-entry` Represents a Mac Filter entry. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab13c41707872a2ea9bb4cfa67d096512` | typedef `uint8_t` Used to iterate through mac filter entries. |

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaf5c96f2ca6d2f597fb082cb795ffeefa(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga8717d8d12c10477157792b70780e3b74 aCallback, void *aCallbackContext)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Starts an IEEE 802.15.4 Active Scan. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaf54d5c6aebf638347644803e67f365e3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t aLinkQuality)` | `int8_t` Converts link quality to typical received signal strength. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga52cbc41997edb9f132c9e1fc3a3d8b87(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, int8_t aRss)` | `uint8_t` Converts received signal strength to link quality. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga37e25234c6cdb677c3baf2c40d097d8f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab96eb83d21ae0da816b553ceeee50f01 aCallback, void *aCallbackContext)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Starts an IEEE 802.15.4 Energy Scan. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga4a63d28b035a5e8af7185169561c6b49(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ext-address *aExtAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Adds an Extended Address to MAC filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga8a468b55fa1ec67070c98edbf49e5a27(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ext-address *aExtAddress, int8_t aRss)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Adds the specified Extended Address to the `RssIn` list (or modifies an existing address in the `RssIn` list) and sets the received signal strength (in dBm) entry for messages from that address. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga94cc887de643f2f96e487ea0997815e8(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Clears all the Extended Addresses from MAC filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga13e8b2ddba9edeed876c222e6c2984fe(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Clears all the received signal strength (`rss`) and link quality indicator (`lqi`) entries (including defaults) from the `RssIn` list. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga1e5a9c9c4f8fb93ee06c0df49bfd7411(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Clears any previously set default received signal strength (in dBm) on MAC Filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga97c0c5f07e6b9da6c4eceb782d3a616f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac833df157d22280e15142b2d05a79bbc` Gets the address mode of MAC filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga1945f71acd9ee1fba5d6d5dfda28acc6(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab13c41707872a2ea9bb4cfa67d096512 *aIterator, https://openthread.io/reference/struct/ot-mac-filter-entry *aEntry)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Gets an in-use address filter entry. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac93b29aa7295a10c2dfcbe56fafd56d9(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab13c41707872a2ea9bb4cfa67d096512 *aIterator, https://openthread.io/reference/struct/ot-mac-filter-entry *aEntry)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Gets an in-use RssIn filter entry. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga2b551f52cd1219e05d67d50c6a818f65(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ext-address *aExtAddress)` | `void` Removes an Extended Address from MAC filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaa815e16d469fedc544d9067c7263d77f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ext-address *aExtAddress)` | `void` Removes the specified Extended Address from the `RssIn` list. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga3955a3fda6cfc1d14854e8ea27fc5f37(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac833df157d22280e15142b2d05a79bbc aMode)` | `void` Sets the address mode of MAC filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga76a85ce8690221fb1dbce6c98acdd3fe(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, int8_t aRss)` | `void` Sets the default received signal strength (in dBm) on MAC Filter. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga0389a2d2fc2a9be9249ac9e1464ebdce(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/radio-types#group__radio-types_1ga9199b7f0fe13ebcd0da2e3af71f04c40` Get the IEEE 802.15.4 alternate short address. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaca01919614e3597c5ad22738382c4699(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint16_t` Returns the current CCA (Clear Channel Assessment) failure rate. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga9da34500e4a0aae64af6d8f4308a49f9(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint8_t` Get the IEEE 802.15.4 channel. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaf2a954eb3c39f2826e78cc6b0fd2c49c(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-mac-counters *` Get the MAC layer counters. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac22608115bd8f365c2ad5fec7d831ecb(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint8_t` Gets the CSL channel. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga2b602884b0390023cd9b74ba815887c3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint32_t` Gets the CSL period in microseconds. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga21350d322375f1fb614fe73dd621f304(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint32_t` Gets the CSL timeout. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac2ee0f3dfa79f664e0787eaf97a9e1c8(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `const https://openthread.io/reference/struct/ot-ext-address *` Gets the IEEE 802.15.4 Extended Address. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga123c7bccadb1a667aaaa14047832df70(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/struct/ot-ext-address *aEui64)` | `void` Get the factory-assigned IEEE EUI-64. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga604399c9fbb88035520917a5d4ed68c4(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint32_t` Gets the current MAC frame counter value. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gae2ac10b3d62bf28c9f0d60d1ec07fcf0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint8_t` Returns the maximum number of frame retries during direct transmission. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga65073fc8070d4d1067b9489603425d90(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint8_t` Returns the maximum number of frame retries during indirect transmission. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga14f390c08327924b23d00f4ab0a6fbe8(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/radio-types#group__radio-types_1ga2dd7c7e7e4b5a8a15e9af7fb78de1eda` Get the IEEE 802.15.4 PAN ID. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac743cdaf2e36acbebc06b82a6251de80(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint32_t` Get the data poll period of sleepy end device. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gad769c601f30c95f512a5708fd6820518(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t *aRegionCode)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Get the region code. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga22ed8629f846d8d4722a4e13907142d9(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/radio-types#group__radio-types_1ga9199b7f0fe13ebcd0da2e3af71f04c40` Get the IEEE 802.15.4 Short Address. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga06876b4e19778a29547882807630eaef(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint32_t` Get the supported channel mask of MAC layer. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga544b3ff2d1f548f02d2c22e341784fdd(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t *aSize)` | `const uint32_t *` Gets histogram of retries for a single direct packet until success. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga87ef6ba4d2ff3c46b9ee113824918dc2(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t *aSize)` | `const uint32_t *` Gets histogram of retries for a single indirect packet until success. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac85b4a772c69509ac2806312d71d594f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab3026be28abfab1fe20823522108f54f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not CSL is enabled. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga51b599446556461a52a5e7521bf0e3e3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether the device is connected to a parent which supports CSL. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga97e741dcd42872e952ee1683be9b2e53(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not the link layer is enabled. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga388cb4f4761c4f06c941986f5e8a075d(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga21a8b051667935db0cb7af21513d09a2(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not an IEEE 802.15.4 MAC is in the transmit state. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga77906737730c123f2db256cc77605c95(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether or not promiscuous mode is enabled at the link layer. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga66ca60c9ddeb602de32eb6ee69cd8afb(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `bool` Indicates whether the IEEE 802.15.4 radio filter is enabled or not. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga60b8817be7d3c3acb242e77a889a1914(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Resets the MAC layer counters. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaa24137ff4931beab8d1c4d8eba9c8367(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Clears histogram statistics for direct and indirect transmissions. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga1974b75203f3732b28dceb414ac71004(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Enqueues an IEEE 802.15.4 Data Request message for transmission. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga1e49c3896a00fb0eb7c1b8cafbfd062e(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Instructs the device to send an empty IEEE 802.15.4 data frame. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga124c98c3c212a9552a9a53b28bffadd7(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t aChannel)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Set the IEEE 802.15.4 channel. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga1b1df375c93ff5b49f576dd6b2fb33f4(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t aChannel)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the CSL channel. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gab8171d8fa17456e9759740e889942fd4(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aPeriod)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the CSL period in microseconds. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac6fe8a3a2c7ca73bfdab74954a46f27a(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aTimeout)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the CSL timeout in seconds. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga552c01e055761ff716b53d7223356bca(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aEnable)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Enables or disables the link layer. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga22402ed8289917e803783989a7070ae1(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, const https://openthread.io/reference/struct/ot-ext-address *aExtAddress)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the IEEE 802.15.4 Extended Address. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga800b9551537e863644b9187dc4a546bf(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t aMaxFrameRetriesDirect)` | `void` Sets the maximum number of frame retries during direct transmission. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaf815723ff6d2090cab834515c8726dfa(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint8_t aMaxFrameRetriesIndirect)` | `void` Sets the maximum number of frame retries during indirect transmission. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gae15de55961ef148207289352111284e3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/radio-types#group__radio-types_1ga2dd7c7e7e4b5a8a15e9af7fb78de1eda aPanId)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Set the IEEE 802.15.4 PAN ID. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga158763d9eaeea1c464ac20622e4942d3(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga88b24424c2850c95d5624d25e62f8066 aPcapCallback, void *aCallbackContext)` | `void` Registers a callback to provide received raw IEEE 802.15.4 frames. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaa09687ea0a560566ca095b7150364e56(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aPollPeriod)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Set/clear user-specified/external data poll period for sleepy end device. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaba1d3c1dbc955ed7de2621208dd044bc(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aPromiscuous)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Enables or disables the link layer promiscuous mode. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga16c4d586ddf41adafd6fb86fb5493864(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aFilterEnabled)` | `void` Enables/disables IEEE 802.15.4 radio filter mode. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga54dab0964dad4881677154b9482a840b(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aRegionCode)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the region code. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaca53a6439f6f99e3b3abb8d128317c83(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, bool aRxOnWhenIdle)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Sets the rx-on-when-idle state. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga3c0d4e8d833dc6d1df820973ff5a77e5(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint32_t aChannelMask)` | `https://openthread.io/reference/group/api-error#group__api-error_1gabaaa90aaa35da8f9d394a227a23a6a49` Set the supported channel mask of MAC layer. |

| ### Macros ||
|---|---|
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga52e79592f19c2c68c021437cf81f272a (160)` | Represents CSL period ten symbols unit in microseconds. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga0d046e3ed1a1e4aa980e9e6541330361 127` | Used to indicate no fixed received signal strength was set. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga806f2f63c29bc6b060528192274cebea 0` | Initializer for otMacFilterIterator. |
| `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga95bdb7dcd11c8aabd85f810b6053226f OT_RADIO_TEN_SYMBOLS_TIME` | Time for 10 symbols in units of microseconds. |

| ### Structs ||
|---|---|
| [otActiveScanResult](https://openthread.io/reference/struct/ot-active-scan-result) | Represents a received IEEE 802.15.4 Beacon. |
| [otEnergyScanResult](https://openthread.io/reference/struct/ot-energy-scan-result) | Represents an energy scan result. |
| [otMacCounters](https://openthread.io/reference/struct/ot-mac-counters) | Represents the MAC layer counters. |
| [otMacFilterEntry](https://openthread.io/reference/struct/ot-mac-filter-entry) | Represents a Mac Filter entry. |

## Enumerations

### otMacFilterAddressMode

```
 otMacFilterAddressMode
```
Defines address mode of the mac filter.

| Properties ||
|---|---|
| `OT_MAC_FILTER_ADDRESS_MODE_ALLOWLIST` | Allowlist address filter mode is enabled. |
| `OT_MAC_FILTER_ADDRESS_MODE_DENYLIST` | Denylist address filter mode is enabled. |
| `OT_MAC_FILTER_ADDRESS_MODE_DISABLED` | Address filter is disabled. |

## Typedefs

### otActiveScanResult

```
struct otActiveScanResult otActiveScanResult
```
Represents a received IEEE 802.15.4 Beacon.

### otEnergyScanResult

```
struct otEnergyScanResult otEnergyScanResult
```
Represents an energy scan result.

### otHandleActiveScanResult

```
void(* otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext)
```
Pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes.

<br />

Details Parameters `[in] aResult` A valid pointer to the beacon information or NULL when the active scan completes. `[in] aContext` A pointer to application-specific context.

### otHandleEnergyScanResult

```
void(* otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext)
```
Pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes.

<br />

Details Parameters `[in] aResult` A valid pointer to the energy scan result information or NULL when the energy scan completes. `[in] aContext` A pointer to application-specific context.

### otLinkPcapCallback

```
void(* otLinkPcapCallback)(const otRadioFrame *aFrame, bool aIsTx, void *aContext)
```
Pointer is called when an IEEE 802.15.4 frame is received.


> [!NOTE]
> **Note:** This callback is called after FCS processing and `aFrame` may not contain the actual FCS that was received.

> [!NOTE]
> **Note:** This callback is called before IEEE 802.15.4 security processing.

<br />

Details Parameters `[in] aFrame` A pointer to the received IEEE 802.15.4 frame. `[in] aIsTx` Whether this frame is transmitted, not received. `[in] aContext` A pointer to application-specific context.

### otMacCounters

```
struct otMacCounters otMacCounters
```
Represents the MAC layer counters.

### otMacFilterAddressMode

```
enum otMacFilterAddressMode otMacFilterAddressMode
```
Defines address mode of the mac filter.

### otMacFilterEntry

```
struct otMacFilterEntry otMacFilterEntry
```
Represents a Mac Filter entry.

### otMacFilterIterator

```
uint8_t otMacFilterIterator
```
Used to iterate through mac filter entries.

## Functions

### otLinkActiveScan

```
otError otLinkActiveScan(
  otInstance *aInstance,
  uint32_t aScanChannels,
  uint16_t aScanDuration,
  otHandleActiveScanResult aCallback,
  void *aCallbackContext
)
```
Starts an IEEE 802.15.4 Active Scan.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aScanChannels` A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK). `[in] aScanDuration` The time in milliseconds to spend scanning each channel. `[in] aCallback` A pointer to a function called on receiving a beacon or scan completes. `[in] aCallbackContext` A pointer to application-specific context. Return Values `OT_ERROR_NONE` Accepted the Active Scan request. `OT_ERROR_BUSY` Already performing an Active Scan.

### otLinkConvertLinkQualityToRss

```
int8_t otLinkConvertLinkQualityToRss(
  otInstance *aInstance,
  uint8_t aLinkQuality
)
```
Converts link quality to typical received signal strength.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aLinkQuality` LinkQuality value, should be in range \[0,3\]. **Returns** Typical platform received signal strength mapping to `aLinkQuality`.

### otLinkConvertRssToLinkQuality

```
uint8_t otLinkConvertRssToLinkQuality(
  otInstance *aInstance,
  int8_t aRss
)
```
Converts received signal strength to link quality.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aRss` The received signal strength value to be converted. **Returns** Link quality value mapping to `aRss`.

### otLinkEnergyScan

```
otError otLinkEnergyScan(
  otInstance *aInstance,
  uint32_t aScanChannels,
  uint16_t aScanDuration,
  otHandleEnergyScanResult aCallback,
  void *aCallbackContext
)
```
Starts an IEEE 802.15.4 Energy Scan.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aScanChannels` A bit vector indicating on which channels to perform energy scan. `[in] aScanDuration` The time in milliseconds to spend scanning each channel. `[in] aCallback` A pointer to a function called to pass on scan result on indicate scan completion. `[in] aCallbackContext` A pointer to application-specific context. Return Values `OT_ERROR_NONE` Accepted the Energy Scan request. `OT_ERROR_BUSY` Could not start the energy scan.

### otLinkFilterAddAddress

```
otError otLinkFilterAddAddress(
  otInstance *aInstance,
  const otExtAddress *aExtAddress
)
```
Adds an Extended Address to MAC filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aExtAddress` A pointer to the Extended Address (MUST NOT be NULL). Return Values `OT_ERROR_NONE` Successfully added `aExtAddress` to MAC filter. `OT_ERROR_NO_BUFS` No available entry exists.

### otLinkFilterAddRssIn

```
otError otLinkFilterAddRssIn(
  otInstance *aInstance,
  const otExtAddress *aExtAddress,
  int8_t aRss
)
```
Adds the specified Extended Address to the `RssIn` list (or modifies an existing address in the `RssIn` list) and sets the received signal strength (in dBm) entry for messages from that address.

The Extended Address does not necessarily have to be in the `address allowlist/denylist` filter to set the `rss`.

> [!NOTE]
> **Note:** The `RssIn` list contains Extended Addresses whose `rss` or link quality indicator (`lqi`) values have been set to be different from the defaults.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aExtAddress` A pointer to the IEEE 802.15.4 Extended Address. MUST NOT be NULL. `[in] aRss` A received signal strength (in dBm). Return Values `OT_ERROR_NONE` Successfully added an entry for `aExtAddress` and `aRss`. `OT_ERROR_NO_BUFS` No available entry exists.

### otLinkFilterClearAddresses

```
void otLinkFilterClearAddresses(
  otInstance *aInstance
)
```
Clears all the Extended Addresses from MAC filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance.

### otLinkFilterClearAllRssIn

```
void otLinkFilterClearAllRssIn(
  otInstance *aInstance
)
```
Clears all the received signal strength (`rss`) and link quality indicator (`lqi`) entries (including defaults) from the `RssIn` list.

Performing this action means that all Extended Addresses will use the on-air signal.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance.

### otLinkFilterClearDefaultRssIn

```
void otLinkFilterClearDefaultRssIn(
  otInstance *aInstance
)
```
Clears any previously set default received signal strength (in dBm) on MAC Filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance.

### otLinkFilterGetAddressMode

```
otMacFilterAddressMode otLinkFilterGetAddressMode(
  otInstance *aInstance
)
```
Gets the address mode of MAC filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** the address mode.

### otLinkFilterGetNextAddress

```
otError otLinkFilterGetNextAddress(
  otInstance *aInstance,
  otMacFilterIterator *aIterator,
  otMacFilterEntry *aEntry
)
```
Gets an in-use address filter entry.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in,out] aIterator` A pointer to the MAC filter iterator context. To get the first in-use address filter entry, it should be set to OT_MAC_FILTER_ITERATOR_INIT. MUST NOT be NULL. `[out] aEntry` A pointer to where the information is placed. MUST NOT be NULL. Return Values `OT_ERROR_NONE` Successfully retrieved an in-use address filter entry. `OT_ERROR_NOT_FOUND` No subsequent entry exists.

### otLinkFilterGetNextRssIn

```
otError otLinkFilterGetNextRssIn(
  otInstance *aInstance,
  otMacFilterIterator *aIterator,
  otMacFilterEntry *aEntry
)
```
Gets an in-use RssIn filter entry.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in,out] aIterator` A pointer to the MAC filter iterator context. MUST NOT be NULL. To get the first entry, it should be set to OT_MAC_FILTER_ITERATOR_INIT. `[out] aEntry` A pointer to where the information is placed. The last entry would have the extended address as all 0xff to indicate the default received signal strength if it was set. `aEntry` MUST NOT be NULL. Return Values `OT_ERROR_NONE` Successfully retrieved the next entry. `OT_ERROR_NOT_FOUND` No subsequent entry exists.

### otLinkFilterRemoveAddress

```
void otLinkFilterRemoveAddress(
  otInstance *aInstance,
  const otExtAddress *aExtAddress
)
```
Removes an Extended Address from MAC filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

No action is performed if there is no existing entry in Filter matching the given Extended Address.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aExtAddress` A pointer to the Extended Address (MUST NOT be NULL).

### otLinkFilterRemoveRssIn

```
void otLinkFilterRemoveRssIn(
  otInstance *aInstance,
  const otExtAddress *aExtAddress
)
```
Removes the specified Extended Address from the `RssIn` list.

Once removed from the `RssIn` list, this MAC address will instead use the default `rss` and `lqi` settings, assuming defaults have been set. (If no defaults have been set, the over-air signal is used.)

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

No action is performed if there is no existing entry in the `RssIn` list matching the specified Extended Address.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aExtAddress` A pointer to the IEEE 802.15.4 Extended Address. MUST NOT be NULL.

### otLinkFilterSetAddressMode

```
void otLinkFilterSetAddressMode(
  otInstance *aInstance,
  otMacFilterAddressMode aMode
)
```
Sets the address mode of MAC filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aMode` The address mode to set.

### otLinkFilterSetDefaultRssIn

```
void otLinkFilterSetDefaultRssIn(
  otInstance *aInstance,
  int8_t aRss
)
```
Sets the default received signal strength (in dBm) on MAC Filter.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

The default RSS value is used for all received frames from addresses for which there is no explicit RSS-IN entry in the Filter list (added using `https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga8a468b55fa1ec67070c98edbf49e5a27`).

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aRss` The default received signal strength (in dBm) to set.

### otLinkGetAlternateShortAddress

```
otShortAddress otLinkGetAlternateShortAddress(
  otInstance *aInstance
)
```
Get the IEEE 802.15.4 alternate short address.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The alternate short address, or `OT_RADIO_INVALID_SHORT_ADDR` (0xfffe) if there is no alternate address.

### otLinkGetCcaFailureRate

```
uint16_t otLinkGetCcaFailureRate(
  otInstance *aInstance
)
```
Returns the current CCA (Clear Channel Assessment) failure rate.

The rate is maintained over a window of (roughly) last `OPENTHREAD_CONFIG_CCA_FAILURE_RATE_AVERAGING_WINDOW` frame transmissions.

<br />

| Details ||
|---|---|
| **Returns** | The CCA failure rate with maximum value `0xffff` corresponding to 100% failure rate. |

### otLinkGetChannel

```
uint8_t otLinkGetChannel(
  otInstance *aInstance
)
```
Get the IEEE 802.15.4 channel.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The IEEE 802.15.4 channel. **See also:**   
[otLinkSetChannel](https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga124c98c3c212a9552a9a53b28bffadd7)   

### otLinkGetCounters

```
const otMacCounters * otLinkGetCounters(
  otInstance *aInstance
)
```
Get the MAC layer counters.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** A pointer to the MAC layer counters.

### otLinkGetCslChannel

```
uint8_t otLinkGetCslChannel(
  otInstance *aInstance
)
```
Gets the CSL channel.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The CSL channel.

### otLinkGetCslPeriod

```
uint32_t otLinkGetCslPeriod(
  otInstance *aInstance
)
```
Gets the CSL period in microseconds.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The CSL period in microseconds.

### otLinkGetCslTimeout

```
uint32_t otLinkGetCslTimeout(
  otInstance *aInstance
)
```
Gets the CSL timeout.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The CSL timeout in seconds.

### otLinkGetExtendedAddress

```
const otExtAddress * otLinkGetExtendedAddress(
  otInstance *aInstance
)
```
Gets the IEEE 802.15.4 Extended Address.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** A pointer to the IEEE 802.15.4 Extended Address.

### otLinkGetFactoryAssignedIeeeEui64

```
void otLinkGetFactoryAssignedIeeeEui64(
  otInstance *aInstance,
  otExtAddress *aEui64
)
```
Get the factory-assigned IEEE EUI-64.

<br />

Details Parameters `[in] aInstance` A pointer to the OpenThread instance. `[out] aEui64` A pointer to where the factory-assigned IEEE EUI-64 is placed.

### otLinkGetFrameCounter

```
uint32_t otLinkGetFrameCounter(
  otInstance *aInstance
)
```
Gets the current MAC frame counter value.

<br />

Details Parameters `[in] aInstance` A pointer to the OpenThread instance. **Returns** The current MAC frame counter value.

### otLinkGetMaxFrameRetriesDirect

```
uint8_t otLinkGetMaxFrameRetriesDirect(
  otInstance *aInstance
)
```
Returns the maximum number of frame retries during direct transmission.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The maximum number of retries during direct transmission.

### otLinkGetMaxFrameRetriesIndirect

```
uint8_t otLinkGetMaxFrameRetriesIndirect(
  otInstance *aInstance
)
```
Returns the maximum number of frame retries during indirect transmission.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The maximum number of retries during indirect transmission.

### otLinkGetPanId

```
otPanId otLinkGetPanId(
  otInstance *aInstance
)
```
Get the IEEE 802.15.4 PAN ID.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The IEEE 802.15.4 PAN ID. **See also:**   
[otLinkSetPanId](https://openthread.io/reference/group/api-link-link#group__api-link-link_1gae15de55961ef148207289352111284e3)   

### otLinkGetPollPeriod

```
uint32_t otLinkGetPollPeriod(
  otInstance *aInstance
)
```
Get the data poll period of sleepy end device.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The data poll period of sleepy end device in milliseconds. **See also:**   
[otLinkSetPollPeriod](https://openthread.io/reference/group/api-link-link#group__api-link-link_1gaa09687ea0a560566ca095b7150364e56)   

### otLinkGetRegion

```
otError otLinkGetRegion(
  otInstance *aInstance,
  uint16_t *aRegionCode
)
```
Get the region code.

The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.

<br />

Details Parameters `[in] aInstance` The OpenThread instance structure. `[out] aRegionCode` The radio region code. The `aRegionCode >> 8` is first ascii char and the `aRegionCode & 0xff` is the second ascii char. Return Values `OT_ERROR_INVALID_ARGS` `aRegionCode` is NULL. `OT_ERROR_FAILED` Other platform specific errors. `OT_ERROR_NONE` Successfully got region code. `OT_ERROR_NOT_IMPLEMENTED` The feature is not implemented.

### otLinkGetShortAddress

```
otShortAddress otLinkGetShortAddress(
  otInstance *aInstance
)
```
Get the IEEE 802.15.4 Short Address.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The IEEE 802.15.4 Short Address.

### otLinkGetSupportedChannelMask

```
uint32_t otLinkGetSupportedChannelMask(
  otInstance *aInstance
)
```
Get the supported channel mask of MAC layer.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** The supported channel mask as `uint32_t` with bit 0 (lsb) mapping to channel 0, bit 1 to channel 1, so on.

### otLinkGetTxDirectRetrySuccessHistogram

```
const uint32_t * otLinkGetTxDirectRetrySuccessHistogram(
  otInstance *aInstance,
  uint16_t *aSize
)
```
Gets histogram of retries for a single direct packet until success.

Requires `OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE`.

The configuration `OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT` specifies the size of the direct TX histogram array.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[out] aSize` A pointer to where the size of returned histogram array is placed. **Returns** A pointer to the histogram of retries (in a form of an array). The n-th element indicates that the packet has been sent with n-th retry. If the number of retries is larger than the histogram array max size, the last entry counts all retries at or above the limit.

### otLinkGetTxIndirectRetrySuccessHistogram

```
const uint32_t * otLinkGetTxIndirectRetrySuccessHistogram(
  otInstance *aInstance,
  uint16_t *aSize
)
```
Gets histogram of retries for a single indirect packet until success.

Requires `OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE`.

The configuration `OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT` specifies the size of the indirect TX histogram array.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[out] aSize` A pointer to where the size of returned histogram array is placed. **Returns** A pointer to the histogram of retries (in a form of an array). The n-th element indicates that the packet has been sent with n-th retry. If the number of retries is larger than the histogram array max size, the last entry counts all retries at or above the limit.

### otLinkIsActiveScanInProgress

```
bool otLinkIsActiveScanInProgress(
  otInstance *aInstance
)
```
Indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** true if an IEEE 802.15.4 Active Scan is in progress, false otherwise.

### otLinkIsCslEnabled

```
bool otLinkIsCslEnabled(
  otInstance *aInstance
)
```
Indicates whether or not CSL is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. Return Values `TRUE` Link layer is CSL enabled. `FALSE` Link layer is not CSL enabled.

### otLinkIsCslSupported

```
bool otLinkIsCslSupported(
  otInstance *aInstance
)
```
Indicates whether the device is connected to a parent which supports CSL.

<br />

Details Return Values `TRUE` If parent supports CSL. `FALSE` If parent does not support CSL.

### otLinkIsEnabled

```
bool otLinkIsEnabled(
  otInstance *aInstance
)
```
Indicates whether or not the link layer is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. Return Values `TRUE` Link layer is enabled. `FALSE` Link layer is not enabled.

### otLinkIsEnergyScanInProgress

```
bool otLinkIsEnergyScanInProgress(
  otInstance *aInstance
)
```
Indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** true if an IEEE 802.15.4 Energy Scan is in progress, false otherwise.

### otLinkIsInTransmitState

```
bool otLinkIsInTransmitState(
  otInstance *aInstance
)
```
Indicates whether or not an IEEE 802.15.4 MAC is in the transmit state.

MAC module is in the transmit state during CSMA/CA procedure, CCA, Data, Beacon or Data Request frame transmission and receiving an ACK of a transmitted frame. MAC module is not in the transmit state during transmission of an ACK frame or a Beacon Request frame.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. **Returns** true if an IEEE 802.15.4 MAC is in the transmit state, false otherwise.

### otLinkIsPromiscuous

```
bool otLinkIsPromiscuous(
  otInstance *aInstance
)
```
Indicates whether or not promiscuous mode is enabled at the link layer.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. Return Values `TRUE` Promiscuous mode is enabled. `FALSE` Promiscuous mode is not enabled.

### otLinkIsRadioFilterEnabled

```
bool otLinkIsRadioFilterEnabled(
  otInstance *aInstance
)
```
Indicates whether the IEEE 802.15.4 radio filter is enabled or not.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

<br />

Details Return Values `TRUE` If the radio filter is enabled. `FALSE` If the radio filter is disabled.

### otLinkResetCounters

```
void otLinkResetCounters(
  otInstance *aInstance
)
```
Resets the MAC layer counters.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance.

### otLinkResetTxRetrySuccessHistogram

```
void otLinkResetTxRetrySuccessHistogram(
  otInstance *aInstance
)
```
Clears histogram statistics for direct and indirect transmissions.

Requires `OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE`.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance.

### otLinkSendDataRequest

```
otError otLinkSendDataRequest(
  otInstance *aInstance
)
```
Enqueues an IEEE 802.15.4 Data Request message for transmission.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. Return Values `OT_ERROR_NONE` Successfully enqueued an IEEE 802.15.4 Data Request message. `OT_ERROR_INVALID_STATE` Device is not in rx-off-when-idle mode. `OT_ERROR_NO_BUFS` Insufficient message buffers available.

### otLinkSendEmptyData

```
otError otLinkSendEmptyData(
  otInstance *aInstance
)
```
Instructs the device to send an empty IEEE 802.15.4 data frame.

Is only supported on an Rx-Off-When-Idle device to send an empty data frame to its parent. Note: available only when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. Return Values `OT_ERROR_NONE` Successfully enqueued an empty message. `OT_ERROR_INVALID_STATE` Device is not in Rx-Off-When-Idle mode. `OT_ERROR_NO_BUFS` Insufficient message buffers available.

### otLinkSetChannel

```
otError otLinkSetChannel(
  otInstance *aInstance,
  uint8_t aChannel
)
```
Set the IEEE 802.15.4 channel.

Succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aChannel` The IEEE 802.15.4 channel. Return Values `OT_ERROR_NONE` Successfully set the channel. `OT_ERROR_INVALID_ARGS` If `aChannel` is not in the range \[11, 26\] or is not in the supported channel mask. `OT_ERROR_INVALID_STATE` Thread protocols are enabled. **See also:**   
[otLinkGetChannel](https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga9da34500e4a0aae64af6d8f4308a49f9)   

### otLinkSetCslChannel

```
otError otLinkSetCslChannel(
  otInstance *aInstance,
  uint8_t aChannel
)
```
Sets the CSL channel.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aChannel` The CSL sample channel. Channel value should be `0` (Set CSL Channel unspecified) or within the range \[1, 10\] (if 915-MHz supported) and [11, 26](https://openthread.io/reference/group/if 2.4 GHz supported). Return Values `OT_ERROR_NONE` Successfully set the CSL parameters. `OT_ERROR_INVALID_ARGS` Invalid `aChannel`.

### otLinkSetCslPeriod

```
otError otLinkSetCslPeriod(
  otInstance *aInstance,
  uint32_t aPeriod
)
```
Sets the CSL period in microseconds.

Disable CSL by setting this parameter to `0`.

The CSL period MUST be a multiple of `OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC`, otherwise `OT_ERROR_INVALID_ARGS` is returned.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aPeriod` The CSL period in microseconds. Return Values `OT_ERROR_NONE` Successfully set the CSL period. `OT_ERROR_INVALID_ARGS` Invalid CSL period

### otLinkSetCslTimeout

```
otError otLinkSetCslTimeout(
  otInstance *aInstance,
  uint32_t aTimeout
)
```
Sets the CSL timeout in seconds.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aTimeout` The CSL timeout in seconds. Return Values `OT_ERROR_NONE` Successfully set the CSL timeout. `OT_ERROR_INVALID_ARGS` Invalid CSL timeout.

### otLinkSetEnabled

```
otError otLinkSetEnabled(
  otInstance *aInstance,
  bool aEnable
)
```
Enables or disables the link layer.


> [!NOTE]
> **Note:** The link layer may only be enabled / disabled when the Thread Interface is disabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aEnable` true to enable the link layer, or false otherwise. Return Values `OT_ERROR_NONE` Successfully enabled / disabled the link layer. `OT_ERROR_INVALID_STATE` Could not disable the link layer because the Thread interface is enabled.

### otLinkSetExtendedAddress

```
otError otLinkSetExtendedAddress(
  otInstance *aInstance,
  const otExtAddress *aExtAddress
)
```
Sets the IEEE 802.15.4 Extended Address.


> [!NOTE]
> **Note:** Only succeeds when Thread protocols are disabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aExtAddress` A pointer to the IEEE 802.15.4 Extended Address. Return Values `OT_ERROR_NONE` Successfully set the IEEE 802.15.4 Extended Address. `OT_ERROR_INVALID_ARGS` `aExtAddress` was NULL. `OT_ERROR_INVALID_STATE` Thread protocols are enabled.

### otLinkSetMaxFrameRetriesDirect

```
void otLinkSetMaxFrameRetriesDirect(
  otInstance *aInstance,
  uint8_t aMaxFrameRetriesDirect
)
```
Sets the maximum number of frame retries during direct transmission.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aMaxFrameRetriesDirect` The maximum number of retries during direct transmission.

### otLinkSetMaxFrameRetriesIndirect

```
void otLinkSetMaxFrameRetriesIndirect(
  otInstance *aInstance,
  uint8_t aMaxFrameRetriesIndirect
)
```
Sets the maximum number of frame retries during indirect transmission.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aMaxFrameRetriesIndirect` The maximum number of retries during indirect transmission.

### otLinkSetPanId

```
otError otLinkSetPanId(
  otInstance *aInstance,
  otPanId aPanId
)
```
Set the IEEE 802.15.4 PAN ID.

Succeeds only when Thread protocols are disabled. A successful call to this function also invalidates the Active and Pending Operational Datasets in non-volatile memory.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aPanId` The IEEE 802.15.4 PAN ID. Return Values `OT_ERROR_NONE` Successfully set the PAN ID. `OT_ERROR_INVALID_ARGS` If aPanId is not in the range \[0, 65534\]. `OT_ERROR_INVALID_STATE` Thread protocols are enabled. **See also:**   
[otLinkGetPanId](https://openthread.io/reference/group/api-link-link#group__api-link-link_1ga14f390c08327924b23d00f4ab0a6fbe8)   

### otLinkSetPcapCallback

```
void otLinkSetPcapCallback(
  otInstance *aInstance,
  otLinkPcapCallback aPcapCallback,
  void *aCallbackContext
)
```
Registers a callback to provide received raw IEEE 802.15.4 frames.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aPcapCallback` A pointer to a function that is called when receiving an IEEE 802.15.4 link frame or NULL to disable the callback. `[in] aCallbackContext` A pointer to application-specific context.

### otLinkSetPollPeriod

```
otError otLinkSetPollPeriod(
  otInstance *aInstance,
  uint32_t aPollPeriod
)
```
Set/clear user-specified/external data poll period for sleepy end device.


> [!NOTE]
> **Note:** This function updates only poll period of sleepy end device. To update child timeout the function `https://openthread.io/reference/group/api-thread-general#group__api-thread-general_1gaf22e732ad154f5ca833957a1396d2e19` shall be called.

> [!NOTE]
> **Note:** Minimal non-zero value should be `OPENTHREAD_CONFIG_MAC_MINIMUM_POLL_PERIOD` (10ms). Or zero to clear user-specified poll period.

> [!NOTE]
> **Note:** User-specified value should be no more than the maximal value 0x3FFFFFF ((1 \<\< 26) - 1) allowed, otherwise it would be clipped by the maximal value.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aPollPeriod` data poll period in milliseconds. Return Values `OT_ERROR_NONE` Successfully set/cleared user-specified poll period. `OT_ERROR_INVALID_ARGS` If aPollPeriod is invalid. **See also:**   
[otLinkGetPollPeriod](https://openthread.io/reference/group/api-link-link#group__api-link-link_1gac743cdaf2e36acbebc06b82a6251de80)   

### otLinkSetPromiscuous

```
otError otLinkSetPromiscuous(
  otInstance *aInstance,
  bool aPromiscuous
)
```
Enables or disables the link layer promiscuous mode.


> [!NOTE]
> **Note:** Promiscuous mode may only be enabled when the Thread interface is disabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aPromiscuous` true to enable promiscuous mode, or false otherwise. Return Values `OT_ERROR_NONE` Successfully enabled promiscuous mode. `OT_ERROR_INVALID_STATE` Could not enable promiscuous mode because the Thread interface is enabled.

### otLinkSetRadioFilterEnabled

```
void otLinkSetRadioFilterEnabled(
  otInstance *aInstance,
  bool aFilterEnabled
)
```
Enables/disables IEEE 802.15.4 radio filter mode.

Is available when `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` configuration is enabled.

The radio filter is mainly intended for testing. It can be used to temporarily block all tx/rx on the 802.15.4 radio. When radio filter is enabled, radio is put to sleep instead of receive (to ensure device does not receive any frame and/or potentially send ack). Also the frame transmission requests return immediately without sending the frame over the air (return "no ack" error if ack is requested, otherwise return success).

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aFilterEnabled` TRUE to enable radio filter, FALSE to disable

### otLinkSetRegion

```
otError otLinkSetRegion(
  otInstance *aInstance,
  uint16_t aRegionCode
)
```
Sets the region code.

The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.

<br />

Details Parameters `[in] aInstance` The OpenThread instance structure. `[in] aRegionCode` The radio region code. The `aRegionCode >> 8` is first ascii char and the `aRegionCode & 0xff` is the second ascii char. Return Values `OT_ERROR_FAILED` Other platform specific errors. `OT_ERROR_NONE` Successfully set region code. `OT_ERROR_NOT_IMPLEMENTED` The feature is not implemented.

### otLinkSetRxOnWhenIdle

```
otError otLinkSetRxOnWhenIdle(
  otInstance *aInstance,
  bool aRxOnWhenIdle
)
```
Sets the rx-on-when-idle state.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aRxOnWhenIdle` TRUE to keep radio in Receive state, FALSE to put to Sleep state during idle periods. Return Values `OT_ERROR_NONE` If successful. `OT_ERROR_INVALID_STATE` If the raw link-layer isn't enabled.

### otLinkSetSupportedChannelMask

```
otError otLinkSetSupportedChannelMask(
  otInstance *aInstance,
  uint32_t aChannelMask
)
```
Set the supported channel mask of MAC layer.

Succeeds only when Thread protocols are disabled.

<br />

Details Parameters `[in] aInstance` A pointer to an OpenThread instance. `[in] aChannelMask` The supported channel mask (bit 0 or lsb mapping to channel 0, and so on). Return Values `OT_ERROR_NONE` Successfully set the supported channel mask. `OT_ERROR_INVALID_STATE` Thread protocols are enabled.

## Macros

### OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC

```
 OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC (160)
```
Represents CSL period ten symbols unit in microseconds.

The CSL period (in micro seconds) MUST be a multiple of this value.

### OT_MAC_FILTER_FIXED_RSS_DISABLED

```
 OT_MAC_FILTER_FIXED_RSS_DISABLED 127
```
Used to indicate no fixed received signal strength was set.

### OT_MAC_FILTER_ITERATOR_INIT

```
 OT_MAC_FILTER_ITERATOR_INIT 0
```
Initializer for otMacFilterIterator.

### OT_US_PER_TEN_SYMBOLS

```
 OT_US_PER_TEN_SYMBOLS OT_RADIO_TEN_SYMBOLS_TIME
```
Time for 10 symbols in units of microseconds.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).