/**
 * @file comms_ftm.h
 *
 * @brief This file has the function prototypes of S-Band firmware file transfer
 *
 * @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 _INC_COMMS_FTM_H_
#define _INC_COMMS_FTM_H_

#include "file_transfer.h"
#include "notify_apps.h"



typedef enum comms_fw_name_def
{
	COMMS_UHF_FW,
	COMMS_IQS_1_FW,
	COMMS_IQS_2_FW,
	COMMS_IQS_3_FW
}comms_fw_name;


typedef struct comms_firmwre_info_save_def
{
	uint32_t src_addrs;
	uint32_t des_addrs;
	uint32_t size;
	uint32_t checksum;
}comms_firmwre_info_save;


/**
* @brief This function will return the download address to be allocated for file transfer
*
* @param[in]  void : none
*
* @return memory address
* @retval allocated address
*/
uint32_t comms_get_ftm_download_address(void);

/**
* @brief This function will return the storage address to be used to move firmware stored in sdram to
* external flash
*
* @param[in]  void : none
*
* @return memory address
* @retval allocated address
*/
uint32_t comms_get_fw_storage_address(void);


/**
* @brief It should be called in initialization of thread, it should not be
* called before the FTM module initialization routine has not complete
*/
void comms_ftm_init(void);

void comms_ft_receiver_notificataion_clbk(ft_notification_info *ft_sts);


uint8_t comms_read_fw_info(comms_fw_name fw_id, comms_firmwre_info_save* fw_info);

uint8_t comms_get_firmware_availablity_status(comms_fw_name fw_id, uint32_t bin_length, uint32_t bin_crc);

int8_t comms_read_uhf_fw(void);


#endif /* _INC_COMMS_FTM_H_ */
