LoRaMac-node icon indicating copy to clipboard operation
LoRaMac-node copied to clipboard

Fragmentation : Error in init of variables can cause wrong status report

Open Kasimashi opened this issue 9 months ago • 0 comments

Description

In FragDecoderInit : Init of FragDecoder.Status.FragNbRx and FragDecoder.Status.MatrixError are missing.

#if( FRAG_DECODER_FILE_HANDLING_NEW_API == 1 )
void FragDecoderInit( uint16_t fragNb, uint8_t fragSize, FragDecoderCallbacks_t *callbacks )
#else
void FragDecoderInit( uint16_t fragNb, uint8_t fragSize, uint8_t *file, uint32_t fileSize )
#endif
{
#if( FRAG_DECODER_FILE_HANDLING_NEW_API == 1 )
    FragDecoder.Callbacks = callbacks;
#else
    FragDecoder.File = file;
    FragDecoder.FileSize = fileSize;
#endif
    FragDecoder.FragNb = fragNb;                                // FragNb = FRAG_MAX_SIZE
    FragDecoder.FragSize = fragSize;                            // number of byte on a row
    FragDecoder.Status.FragNbLastRx = 0;
    FragDecoder.Status.FragNbLost = 0;
    FragDecoder.Status.FragNbRx = 0;
    FragDecoder.Status.MatrixError = 0;
    FragDecoder.M2BLine = 0;

Actual Behavior

sequenceDiagram
    Gateway->>+Node: McGroupSetupReq
    Node->>-Gateway: McGroupSetupAns
    Gateway->>+Node: McClassCSessionReq
    Node->>-Gateway: McClassCSessionAns
    Gateway->>+Node: FragSessionSetupReq
    Node->>-Gateway: FragSessionSetupAns
    Gateway-->>+Node: FAILED TO SEND DATAFRAG
    Gateway-->>+Node: FAILED TO SEND DATAFRAG
    Gateway-->>+Node: FAILED TO SEND DATAFRAG
    Node->>Gateway: FragSessionSetupAns (FragNbRx!=0 or egal to last frag session)
    Gateway->>Gateway : Block can be considered as ok because of status

Expected Behavior

sequenceDiagram
  Gateway->>+Node: McGroupSetupReq
  Node->>-Gateway: McGroupSetupAns
  Gateway->>+Node: McClassCSessionReq
  Node->>-Gateway: McClassCSessionAns
  Gateway->>+Node: FragSessionSetupReq
  Node->>-Gateway: FragSessionSetupAns
  Gateway-->>+Node: FAILED TO SEND DATAFRAG
  Gateway-->>+Node: FAILED TO SEND DATAFRAG
  Gateway-->>+Node: FAILED TO SEND DATAFRAG
  Node->>Gateway: FragSessionSetupAns (FragNbRx=0)
  Gateway->>Gateway : Block can be considered as nok because of status

Kasimashi avatar Jan 23 '25 11:01 Kasimashi