/**
 *@file ftsr.c
 *
 *@brief This file contains functions that provides demonstration of
 *       usage of FTSR frame related APIs
 *
 *The functions provided in the file provides demonstration on
 *usage of FTSR frame related APIs
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FTSR_H_
#define FTSR_H_
//#include "common.h"
#include "exo_lib/file_transfer/inc/common.h"
#include "download_def.h"
#include "message_frame_def.h"
#include "tc_tm_sample.h"

/******************************************************************************/
/*               Declaration of exported function prototypes                  */
/******************************************************************************/

/**
 * @brief This function used to encode response frame FTSR
 * It will form FTSR frame with response code
 *
 * @param[in]  set  : reponse code to be sent
 * @param[in]  timeout_time  : timeout_time value to be shared if receiver request suspend mode
 *
 * @return none
 * @retval void
 */
void send_ftsr(e_ftsr_response_code set,uint16_t timeout_time);

/**
 * @brief This function used to encode response frame FTSR with dropped sequence IDs
 * to request for re transmission
 *
 * @param[in]  rx_info  : pointer to an structure that will contain dropped sequence count and ID's
 * @param[in]  response  : type of response code
 *
 * @return none
 * @retval void
 */
void ftsr_prepare_packet_loss_notify_frame(s_treceive_info *rx_info, e_ftsr_response_code response);


/**
 * @brief This function used to resend the dropped sequence Ids
 *
 *
 * @param[in]  rx_info  : pointer to an structure that will contain dropped sequence count and ID's
 *
 * @return none
 * @retval void
 */
void ftsr_set_resend_flag(s_treceive_info *rx_info);

/**
 * @brief This function used to encode FTSR frame for Head change request
 *
 *
 * @param[in]  rx_info  : pointer to an structure that will contain head seqeunce ID
 *
 * @return none
 * @retval void
 */
tc_tm_id_e_ft ftsr_prepare_head_change_request_frame(s_treceive_info *rx_info);


#endif /*FTSR_H_ */
