/* This function flushes the netapp data from the client.  */
int32_t otaFlushNetappReq(SlNetAppRequest_t *netAppRequest, uint32_t *flags)
/* This function flushes the netapp data from the client.  */
int32_t otaFlushNetappReq(SlNetAppRequest_t *netAppRequest, uint32_t *flags)
{
    int32_t Status;
    int32_t chunkLen;
    Status = 0;
    while ((*flags & SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION) == SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION)
    {
        chunkLen = NETAPP_MAX_RX_FRAGMENT_LEN;
        Status = sl_NetAppRecv(netAppRequest->Handle, (uint16_t *)&chunkLen, gPayloadBuffer, (_u32 *)flags);
        INFO_PRINT("[Link local task] flushing NetApp packet, len=%d \n\r", chunkLen);
        if (Status < 0)
        {
            return (Status);
        }
        if (*flags == 0)
        {
            break;
        }
    }
    return (Status);
}