/**
 * @file download_def.h
 *
 * @brief This file contains data definitions for file receive information
 *
 *
*/

#ifndef DOWNLOAD_DEF_H_
#define DOWNLOAD_DEF_H_

#include "data_type.h"
#include "stdio.h"

#define MAX_PCKT_LOSS_DETECTION_CNTR 8

typedef struct lost_seg_info
{
	uint32_t lost_packet_list[MAX_PCKT_LOSS_DETECTION_CNTR];
    uint32_t resend_rqst_flag;
	uint16_t total_lost_segment_count;
	uint8_t head_change_request;
	uint8_t ftsr_frame_full;
	uint8_t re_request_initiate_timer;
}s_lost_seg_info;


typedef struct receive_info
{
#ifndef FT_OBC
	FILE * fptr;
#endif
	uint8_t *mptr;
	uint32_t size;      /* file or memory size */
	uint32_t pckt_seq_num;
	uint32_t checksum;
	uint32_t mem_address;
	uint32_t pckt_seq_head;
	uint16_t packet_data_size;
	uint16_t mtu_size;  /* MTU size */
	uint8_t tx_mode;
	uint8_t file_format;
	uint8_t *file_name;
	uint16_t file_name_buf_length;
	uint8_t *ftds_payload_ptr;
	s_lost_seg_info data_loss;
	uint8_t receive_busy;
	uint8_t download_pending_by_loss;
	uint16_t seq_payload_len;
	uint8_t file_opened;
	uint64_t obc_mem_addr;
	uint8_t dwnld_cmp_sts;
	uint8_t seq_loss_detect_enable;
	uint8_t app_id;
    uint8_t session_id;
    uint8_t file_id;                            ///< file id to differentiate multiple files send to same app
    uint16_t rx_node_conn_fail_timeout;          ////* receiver node timeout time for connection failure in seconds
}s_treceive_info;


#endif /* DOWNLOAD_DEF_H_ */
