<h3>Contribution description</h3>
<p>This PR does essentially 2 things:</p>
<ul>
<li>
<p>Check error codes when requesting state transitions and transmission. In some cases radios were BUSY when requesting transmission or a new state (because of IFS or the hardware accelerator was finishing a task). This ended up with a situation where "confirm_xxx" functions were called without a successful request.</p>
</li>
<li>
<p>Report errors when CCA failed or the transmission could not be performed.</p>
</li>
</ul>

<h3>Testing procedure</h3>
<p>I think <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="785093890" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/15761" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/15761/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/15761">#15761</a> would be appropiate to test this. This issue was triggered when using the <code>txtspam</code> command (Radios simply stop receiving packets after one is successfully received).</p>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/LarsKowoll/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/LarsKowoll">@LarsKowoll</a> could you give it a look? :)</p>

<h3>Issues/PRs references</h3>
<p>Discovered by <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/LarsKowoll/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/LarsKowoll">@LarsKowoll</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="785093890" data-permission-text="Title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/15761" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/15761/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/15761">#15761</a></p>


<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/16556'>https://github.com/RIOT-OS/RIOT/pull/16556</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>tests/ieee802154_hal: spin if radio is BUSY on trx_state request</li>
  <li>tests/ieee802154_hal: use _set_trx_state where possible</li>
  <li>tests/ieee802154_hal: wait for IFS during transmission</li>
  <li>tests/ieee802154_hal: improve error reporting</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/16556/files#diff-46a185713fc29cbe549a3680baff48b58bce2e594f15879368a06e4932edcae5">tests/ieee802154_hal/main.c</a>
    (70)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16556.patch'>https://github.com/RIOT-OS/RIOT/pull/16556.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/16556.diff'>https://github.com/RIOT-OS/RIOT/pull/16556.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16556">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDEBDBETL3X5EI7OBTTS5VKVANCNFSM46XPZIJA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYEOBK3SWPX7TFJYJXLTS5VKVA5CNFSM46XPZIJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NXNERDQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16556",
"url": "https://github.com/RIOT-OS/RIOT/pull/16556",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>