Lora-net/LoRaMac-node

Join procedure completion for Class C

Closed this issue · 3 comments

According to the Lorawan 1.0.4 specification there is a specific procedure for class c and OTAA which doesn't seem to be implemented in the stack
Capture

This is implemented and in addition it is verified by the LoRaWAN certification process.

Even if the application layer tries to perform a first uplink of type Unconfirmed the MAC layer will force it to be of Confirmed type. Please refer to:

LoRaMac-node/src/mac/LoRaMac.c

Lines 5498 to 5506 in 672b37d

// Apply confirmed downlinks, if the device has not received a valid
// downlink after a join accept.
if( ( Nvm.MacGroup2.NetworkActivation == ACTIVATION_TYPE_OTAA ) &&
( Nvm.MacGroup2.DeviceClass == CLASS_C ) &&
( Nvm.MacGroup2.DownlinkReceived == false ) &&
( request.Type == MCPS_UNCONFIRMED ) )
{
request.Type = MCPS_CONFIRMED;
}

Please note that I just noticed a typo in the comment. One should read "Apply confirmed uplinks,"" instead of "Apply confirmed downlinks,"
Commit 2bf36bd fixes the comment

so its up to the application layer to send the confirmed uplink this isnt done by the stack right?

also from my understanding this is only for lorawan 1.0.4 but for version 1.0.3 is it possible for the NS to send immediatly to the end node without a confirmed uplink first?

It is up to the application layer to ask the MAC layer to transmit uplinks.

Yes, this confirmed uplink has been introduced in 1.0.4 in order to solve issues observed on previous version of the specification.

In 1.0.3 specification this behavior is not specified then all possible combinations are valid which means all kind of weird behaviors can happen if not carefully handled.

If you don't mind I close the issue.