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

LORAMAC_STATUS_SKIPPED_APP_DATA never pushed to application layer #1545

Open
omogenot opened this issue Jun 8, 2023 · 0 comments
Open

LORAMAC_STATUS_SKIPPED_APP_DATA never pushed to application layer #1545

omogenot opened this issue Jun 8, 2023 · 0 comments

Comments

@omogenot
Copy link

omogenot commented Jun 8, 2023

I am using LoRaMAC version 4.70 and face an issue with the application data not being sent.

After a join procedure, the application layer is supposed to quickly send a couple of upload frames in order to verify the unit installation and to allow the server to send some unit extra configuration (besides of the LoRaMAC commands it could eventually send to setup channels, etc.). However, as it is clearly written in the LoRaMAC code in loramac.c in function PrepareFrame:

                // There is application payload available but the MAC commands does NOT fit into FOpts field.
                else if( ( MacCtx.AppDataSize > 0 ) && ( macCmdsSize > LORA_MAC_COMMAND_MAX_FOPTS_LENGTH ) )
                {

                    if( LoRaMacCommandsSerializeCmds( availableSize, &macCmdsSize, MacCtx.MacCommandsBuffer ) != LORAMAC_COMMANDS_SUCCESS )
                    {
                        return LORAMAC_STATUS_MAC_COMMAD_ERROR;
                    }
                    return LORAMAC_STATUS_SKIPPED_APP_DATA;
                }

which is fine by me. However, this LORAMAC_STATUS_SKIPPED_APP_DATA is never sent back to the user application as its sole usage is in the send function that will overwrite this status value in the next call:

    // Prepare the frame
    status = PrepareFrame( macHdr, &fCtrl, fPort, fBuffer, fBufferSize );

    // Validate status
    if( ( status == LORAMAC_STATUS_OK ) || ( status == LORAMAC_STATUS_SKIPPED_APP_DATA ) )
    {
        // Schedule frame, do not allow delayed transmissions
        status = ScheduleTx( false );
    }

In other words, my application will never be aware that the initial packets were never sent. A return of this LORAMAC_STATUS_SKIPPED_APP_DATA value instead of LORAMAC_STATUS_OK would be nice, so that the user application is aware that the application data has not been sent and perform any correction method.

Olivier.

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

No branches or pull requests

1 participant