/**
 * @file utfw_test_main.h
 *
 * @brief This file contains function prototypes and types necessary
 *        for packing, unpacking and routing the Test layer packets
 *
 * @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.
 *        usage of TC TM Library APIs
 */

#ifndef EXO_FW_UTFW_MAIN_H_
#define EXO_FW_UTFW_MAIN_H_

#include "exo_osal.h"
#include "exo_ral_cmn.h"
#include "obc_tc_tm.h"
#include "exo_osal_common.h"

/**
 * @brief This structure contains variables
 * to be passed for queue request
 */
typedef struct
{
    uint8_t q_id;
    uint8_t pri;
    uint8_t wrap;
    uint16_t inst_cnt;
    uint32_t inst_size;
}hm_queue_req;


/**
 * @brief This structure contains variables
 * to be passed for enqueue request
 */
typedef struct
{
    uint8_t *data;
    uint8_t q_id;
    uint8_t mod_id;
    uint32_t inst_size;

}hm_enqueue_req;


/**
 * @brief This structure contains variables
 * to be passed for flush request
 */
typedef struct
{
    uint8_t q_id;
    uint8_t mod_id;
    uint8_t pri;

}hm_flush_req;


/**
 * @brief This structure contains variables
 * to be passed for change queue pri request
 */
typedef struct
{
    uint8_t q_id;
    uint8_t mod_id;
    uint8_t pri;
    uint8_t cur_pri;

}hm_chng_queue_pri_req;

/**
 * @brief This structure contains variables
 * to be passed for change mod pri request
 */
typedef struct
{
    uint8_t mod_id;
    uint8_t pri;
    uint8_t cur_pri;

}hm_chng_mod_pri_req;


/**
 * @brief This structure contains variables
 * to be passed for dl request
 */
typedef struct
{
    uint8_t q_id;
    uint8_t mod_id;
    uint8_t pri;

}hm_dl_req;


/**
 * @brief This structure contains variables
 * to be passed for del request
 */
typedef struct
{
    uint8_t q_id;
    uint8_t app_id;

}hm_del_req;



/**
 * @brief This structure contains variables
 * to pass test_id and response of test case
 */
typedef struct
{
    uint32_t test_id;
    uint32_t test_rsp;
}test_case_rsp;

os_status_t start_test_task(void);
void test_task_init(void);

/**
 * @brief This API will send enqueue request for stress test of EPS,ADCS and sensors
 * with specified Queue ID, data and data len
 * */
void stress_test(uint8_t queue_id, uint8_t *data, uint16_t data_len, uint16_t no_instance);
/**
 * @brief This API will send buffer request to HM Framework with
 * specified Instance size, No of instance, Queue ID and Priority
 */
void queue_req(hm_queue_req test_buff_req);

/**
 * @brief This API will send enqueue request to HM Framework with
 * specified Instance size, Queue ID
 */
void enqueue_req(hm_enqueue_req test_enqueue_req);
/**
 * @brief This API will send flush the data in queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void flush_req(hm_flush_req test_flush_req);
/**
 * @brief This API will delete the queue with
 * specified Queue ID
 */
void delete_req(hm_del_req test_del_req);
/**
 * @brief This API will change priority of a queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void change_queue_pri_req(hm_chng_queue_pri_req test_queue_pri_req);
/**
 * @brief This API will change priority of a module based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void change_mod_pri_req(hm_chng_mod_pri_req test_mod_pri_req);

/**
 * @brief This API will DL a queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void dl_request(hm_dl_req test_dl_req);
/**
 * @brief This API will send the test case response
 * to OBC
 */
void send_itc_test_case_resp(uint32 test_id,uint8 src_entity, uint16 Msg_id, uint32 pld_data, uint32 dst_id);

#endif
