<h1>Backport of <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="470253095" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11869" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11869/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11869">#11869</a></h1>

<h3>Contribution description</h3>

<p>With <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="445366794" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11541" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11541/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11541">#11541</a> (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/RIOT-OS/RIOT/commit/b7890b3031a653bde2d33afb54b9aa819e29af53/hovercard" href="https://github.com/RIOT-OS/RIOT/commit/b7890b3031a653bde2d33afb54b9aa819e29af53"><tt>b7890b3</tt></a>) TX notification messages are only sent after mcps confirm event, and the code sent is <code>SEMTECH_LORAMAC_TX_DONE</code> instead of <code>SEMTECH_LORAMAC_TX_OK</code>. This PR fixes the documentation and the example accordingly.</p>
<h3>Testing procedure</h3>
<p>Compile and flash <code>examples/lorawan</code> with valid keys:</p>
<p><code>make BOARD=b-l072z-lrwan1 DEVEUI=00BD35DEE58FF9CB APPEUI=70B3D57ED000B02F APPKEY=C91870835C73F5E36EDF6E5DBD1445D0 -C examples/lorawan flash term</code></p>
<p>Without this PR TX actually succeeds but SEMTECH_LORAMAC_TX_DONE return value is perceived as error:</p>
<pre><code>2019-07-19 11:54:38,531 - INFO # nding: This is Rmain(): This is RIOT! (Version: 2019.10-devel-71-ga9e72c5-pr_lorawan_retcode)
2019-07-19 11:54:38,535 - INFO # LoRaWAN Class A low-power application
2019-07-19 11:54:38,538 - INFO # =====================================
2019-07-19 11:54:38,604 - INFO # Starting join procedure
2019-07-19 11:54:43,784 - INFO # Join procedure succeeded
2019-07-19 11:54:43,786 - INFO # Sending: This is RIOT!
2019-07-19 11:54:44,902 - INFO # Cannot send message 'This is RIOT!', ret code: 6
</code></pre>
<p>With this PR everything is OK.</p>
<pre><code>2019-07-19 11:52:59,595 - INFO # main(): This is RIOT! (Version: 2019.10-devel-71-ga9e72c5-pr_lorawan_retcode)
2019-07-19 11:52:59,599 - INFO # LoRaWAN Class A low-power application
2019-07-19 11:52:59,602 - INFO # =====================================
2019-07-19 11:52:59,668 - INFO # Starting join procedure
2019-07-19 11:53:04,849 - INFO # Join procedure succeeded
2019-07-19 11:53:04,852 - INFO # Sending: This is RIOT!
2019-07-19 11:53:25,966 - INFO # Sending: This is RIOT!
</code></pre>

<h3>Issues/PRs references</h3>


<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/11873'>https://github.com/RIOT-OS/RIOT/pull/11873</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>examples/lorawan: fix semtech_loramac_send TX ret code</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11873/files#diff-0">examples/lorawan/main.c</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11873/files#diff-1">pkg/semtech-loramac/doc.txt</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11873/files#diff-2">pkg/semtech-loramac/include/semtech_loramac.h</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11873.patch'>https://github.com/RIOT-OS/RIOT/pull/11873.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11873.diff'>https://github.com/RIOT-OS/RIOT/pull/11873.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/11873?email_source=notifications&email_token=ABE7WYACMLPCBRSKAIK3Q3TQAGXXPA5CNFSM4IFFP5D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAIG3KA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCXFB7IZX7JFYP57ETQAGXXPANCNFSM4IFFP5DQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYG7TCECZMA4TYPM7KLQAGXXPA5CNFSM4IFFP5D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAIG3KA.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/11873?email_source=notifications\u0026email_token=ABE7WYACMLPCBRSKAIK3Q3TQAGXXPA5CNFSM4IFFP5D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAIG3KA",
"url": "https://github.com/RIOT-OS/RIOT/pull/11873?email_source=notifications\u0026email_token=ABE7WYACMLPCBRSKAIK3Q3TQAGXXPA5CNFSM4IFFP5D2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAIG3KA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>