Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The reset of flag is not correct for the OP_NEXTCHNL part. #197

Merged

Conversation

ngraziano
Copy link

It can be removed in the current source but I think that it should be set after like in line 2075 (LMIC_setSession).

It can be removed in the current source but I think that it should be set after like in line 2075 (LMIC_setSession).
@terrillmoore
Copy link
Member

I think I agree. The OP_NEXTCHNL handling stuff is complex, but it is clear that that the following is true:

  1. if you're (re)joining, OP_NEXTCHNL should always be reset. (There are ASSERT()s in the various bandplans in the join engine that this must be so.)

  2. it's only sensed here:

    arduino-lmic/src/lmic/lmic.c

    Lines 1805 to 1810 in 2f6cabe

    if( (LMIC.opmode & OP_NEXTCHNL) != 0 ) {
    txbeg = LMIC.txend = LMICbandplan_nextTx(now);
    LMIC.opmode &= ~OP_NEXTCHNL;
    } else {
    txbeg = LMIC.txend;
    }
    .

This line is right after a successful join-accept, and it will cause the next non-join tx to choose a new channel.

@terrillmoore terrillmoore merged commit c208277 into mcci-catena:master Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants