/**
 * @file ps_intf_ctrl_msg.h
 *
 * @brief This file contains function prototypes and data definitions that helps
 * to create a ES interface control message
 */

#ifndef ES_INTF_CTRL_MSG_H_
#define ES_INTF_CTRL_MSG_H_

/* Includes ------------------------------------------------------------------*/
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

/**
 *  @brief  Data Type definitions
 */
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;

typedef int int32;
typedef short int16;
typedef char int8;

/**
 *  @brief  CRRN Header Length macro
 */
#define ICM_HDR_LEN         (4U)

/**
 *  @brief  ICM Encoder Decoder API Execution status macros
 */
#define ICM_OK                   (0)      ///< Success return value
#define ICM_NULL_PTR             (-1)     ///< Null pointer return value
#define ICM_DEC_HDLR_UNASIGN     (-2)     ///< ICM Decoder handler not assigned
#define ICM_RSP_ENC_HDLR_UNASIGN (-3)     ///< ICM Response Encoder handler not assigned

/**
 *  @brief  CRRN Header field parameter macros
 */
#define CRRN_TYPE_POS       (26U)
#define CRRN_TYPE_MASK      (0x3U << CRRN_TYPE_POS)
#define CRRN_ID_POS         (16U)
#define CRRN_ID_MASK        (0x3FF << CRRN_ID_POS)
#define CRRN_DATA_LEN_POS   (0U)
#define CRRN_DATA_LEN_MASK  (0xFFFFU << CRRN_DATA_LEN_POS)

/**
 *  @brief  Payload Server Magic Keyword macro
 */
#define ES_MAGIC_VAL        (0x50534F4E)

/**
 *  @brief  TC TM Parameter configuration
 */
#define TC_SRC_GS                   0x01           ///< TC Source ID configuration value for Ground Station
#define TC_DST_OBC                  0x81           ///< TC Destination ID configuration value for OBC
#define TC_DST_TEST_LAYER           0x95           ///< TC Destination ID configuration value for Test layer
#define TC_DST_PS                   0x86           ///< TC Destination ID configuration value for PS
#define TM_SRC_OBC                  0x81           ///< TM Source ID configuration value for OBC
#define TM_SRC_PS                   0x86           ///< TM Source ID configuration value for PS
#define TM_DST_GS                   0x01           ///< TM Destination ID configuration value for GS

/*!
 *  @brief This enum holds the enumeration values of TC and TM ID
 */
typedef enum _tc_tm_id
{
    // TODO - Enumeration value to be updated after discussion with team
/*    TC_TRGT_PT = 1,
    TM_TRGT_PT = 1,
    TC_LOC_INFO = 2,
    TM_LOC_INFO = 2,*/

    // File Transfer
    TC_FTCI = 100,
    TM_FTSR = 101,
    TC_FTDS = 102,
    TC_FTFCI = 103,

    TM_FTCI = 104,
    TC_FTSR = 105,
    TM_FTDS = 106,
    TM_FTFCI = 107,

    // TTY Debug
    TC_TTY_START = 116,
    TM_TTY_START = 116,

    TC_TTY_DEBUG = 117,
    TM_TTY_DEBUG = 117,

    TC_TTY_END = 118,
    TM_TTY_END = 118,

    // EPS
    TC_SET_CONV_BOARD_PARM = 200,
    TM_SET_CONV_BOARD_PARM = 200,

    TC_GET_CONV_BOARD_PARM = 201,
    TM_GET_CONV_BOARD_PARM = 201,

    TC_SET_BATT_BOARD_PARM =202,
    TM_SET_BATT_BOARD_PARM =202,

    TC_GET_BATT_BOARD_PARM =203,
    TM_GET_BATT_BOARD_PARM =203,

    TC_SET_OUT_CHNL_ENB =204,
    TM_SET_OUT_CHNL_ENB =204,

    TC_SET_OUT_CHNL_CUR_LMT =205,
    TM_SET_OUT_CHNL_CUR_LMT =205,

    TC_GET_OUT_CHNL_PARM =206,
    TM_GET_OUT_CHNL_PARM =206,

    TC_SET_EPS_MODE_CFG = 207,
    TM_SET_EPS_MODE_CFG = 207,

    TC_GET_EPS_MODE_CFG =208,
    TM_GET_EPS_MODE_CFG =208,

    // Interface
    TC_SET_UART_INTF_PARM = 509,
    TM_SET_UART_INTF_PARM = 509,

    TC_GET_UART_INTF_PARM = 510,
    TM_GET_UART_INTF_PARM = 510,

    TC_SET_USB_INTF_PARM = 511,
    TM_SET_USB_INTF_PARM = 511,

    TC_GET_USB_INTF_PARM = 512,
    TM_GET_USB_INTF_PARM = 512,

    TC_SET_I2C_INTF_PARM = 513,
    TM_SET_I2C_INTF_PARM = 513,

    TC_GET_I2C_INTF_PARM = 514,
    TM_GET_I2C_INTF_PARM = 514,

    TC_SET_CAN_INTF_PARM = 515,
    TM_SET_CAN_INTF_PARM = 515,

    TC_GET_CAN_INTF_PARM = 516,
    TM_GET_CAN_INTF_PARM = 516,

    TC_SET_ETH_INTF_PARM = 517,
    TM_SET_ETH_INTF_PARM = 517,

    TC_GET_ETH_INTF_PARM = 518,
    TM_GET_ETH_INTF_PARM = 518,

    TC_SET_SPI_INTF_PARM = 519,
    TM_SET_SPI_INTF_PARM = 519,

    TC_GET_SPI_INTF_PARM = 520,
    TM_GET_SPI_INTF_PARM = 520,

    // Sensors
    TC_SET_TEMP_SEN_PARM = 524,
    TM_SET_TEMP_SEN_PARM = 524,

    TC_GET_TEMP_INFO = 525,
    TM_GET_TEMP_INFO = 525,

    TC_SET_IMU_PARM = 526,
    TM_SET_IMU_PARM = 526,

    TC_GET_IMU_INFO = 527,
    TM_GET_IMU_INFO = 527,

    TC_SET_THRUST_CTRL_PARM = 528,
    TM_SET_THRUST_CTRL_PARM = 528,

    TC_GET_THRUST_CTRL_INFO = 529,
    TM_GET_THRUST_CTRL_INFO = 529,

    TC_SET_GPIO_EXP_PARM = 530,
    TM_SET_GPIO_EXP_PARM = 530,

    TC_GET_GPIO_EXP_INFO = 531,
    TM_GET_GPIO_EXP_INFO = 531,

    TC_SET_DIG_THERM_PARM = 532,
    TM_SET_DIG_THERM_PARM = 532,

    TC_GET_DIG_THERM_INFO = 533,
    TM_GET_DIG_THERM_INFO = 533,

    TC_SET_PWR_MON_PARM = 534,
    TM_SET_PWR_MON_PARM = 534,

    TC_GET_PWR_MON_INFO = 535,
    TM_GET_PWR_MON_INFO = 535,

    TC_SET_VOLT_CTRL_MON_PARM = 536,
    TM_SET_VOLT_CTRL_MON_PARM = 536,

    TC_GET_VOLT_CTRL_MON_INFO = 537,
    TM_GET_VOLT_CTRL_MON_INFO = 537,

    TC_SET_PWR_SEQ_MON_PARM =538,
    TM_SET_PWR_SEQ_MON_PARM =538,

    TC_GET_PWR_SEQ_MON_INFO = 539,
    TM_GET_PWR_SEQ_MON_INFO = 539,

    TC_SET_DATA_LOG_PARM = 540,
    TM_SET_DATA_LOG_PARM = 540,

    TC_GET_DATA_LOG_INFO =541,
    TM_GET_DATA_LOG_INFO =541,

    // Payload Server Power Controls
    TC_PS_PWR_ON = 542,
    TM_PS_PWR_ON = 542,

    TC_PS_PWR_OFF = 543,
    TM_PS_PWR_OFF = 543,

    TC_PLD_HW_PWR_ON = 544,
    TM_PLD_HW_PWR_ON = 544,

    TC_PLD_HW_PWR_OFF = 545,
    TM_PLD_HW_PWR_OFF = 545,

    TC_PLD_VM_PWR_ON = 546,
    TM_PLD_VM_PWR_ON = 546,

    TC_PLD_VM_PWR_OFF = 547,
    TM_PLD_VM_PWR_OFF = 547,

	TC_FTDB = 563,
	TM_FTDR = 564,

    TC_XBAND = 566,
    TM_XBAND = 566,

	TC_FTDR = 578,
	TM_FTDB = 579,

    TC_TM_MAX_ID

}tc_tm_id_e;

/**
 * @brief structure that holds the interface message header
 *
 * Bit Name    Value Description
 * 31:28  Reserved
 * 27:26  CRRN Type
 * 25:16  CRRN ID
 * 15:0   Data Length Indicator
 */
typedef struct _icm_header
{
    int crrn_type;
    int crrn_id;
    int data_len;
}icm_header_s;

/*!
 *  @brief This enum holds the enumeration values of CRRN type
 */
typedef enum _icm_crrn_type
{
    CRRN_TYPE_CMD = 0,
    CRRN_TYPE_REQ,
    CRRN_TYPE_RSP,
    CRRN_TYPE_NTF,
    CRRN_TYPE_INVLD
}icm_crrn_type;

/*!
 *  @brief This enum holds the enumeration values of CRRN ID
 */
typedef enum _icm_crrn_id
{
#if 0
    OBC_PS_PWR_OFF_CMD = 1,
    OBC_PS_PLD_HW_PWR_OFF_CMD,
    OBC_PS_VM_PWR_OFF_CMD,
    OBC_PS_VM_PWR_ON_CMD,
    OBC_PS_TC_TM_MSG_CMD,
    OBC_PS_FTP_MSG_CMD,
    OBC_PS_KEEP_ALIVE_REQ,
    OBC_PS_GS_PASS_NTF,
    OBC_PS_STATE_UPDT_NTF,
    OBC_PS_RADIO_PWR_ON_NTF,
    OBC_PS_RADIO_PWR_OFF_NTF,
    OBC_PS_OBC_KEEP_ALIVE_NTF,
    OBC_PS_OBC_APP_ID_LIST_NTF,
    OBC_PS_OBC_HW_ID_LIST_NTF,
    OBC_PS_SSD_SEL_NTF,
    OBC_PS_OBC_FIRM_UPDT_NTF,
    OBC_PS_OBC_RST_RECV_UPDT_NTF,
    OBC_PS_OBC_HW_ERR_RECOV_NTF,
    OBC_PS_PS_APP_ID_LIST_REQ,
    OBC_PS_PS_APP_PRI_LIST_REQ,
    OBC_PS_PS_HW_ID_LIST_REQ,
    OBC_PS_PS_HW_PRI_LIST_REQ,
    OBC_PS_STAGED_TC_CMD,
    OBC_PS_XBAND_CMD,
    OBC_PS_MAX_ICD,
    OBC_PS_TEMP_INFO=27,
    OBC_PS_TIME_INFO,
    OBC_PS_CHIP_INFO,
    OBC_PS_EXT_MEM,

    PS_OBC_TRGT_POINT_REQ = 200,
    PS_OBC_GNSS_LOC_REQ,
    PS_OBC_GET_CURR_TIME_REQ,
    PS_OBC_KEEP_ALIVE_REQ,
    PS_OBC_SCHD_PS_PWR_ON_REQ,
    PS_OBC_OBC_APP_ID_LIST_REQ,
    PS_OBC_OBC_APP_QoS_PRI_LIST_REQ,
    PS_OBC_OBC_HW_ID_LIST_REQ,
    PS_OBC_RADIO_PWR_ON_REQ,
    PS_OBC_SSD_SEL_REQ,
    PS_OBC_RADIO_PWR_OFF_CMD,
    PS_OBC_RADIO_RX_ENBL_DSBL_CMD,
    PS_OBC_REG_ORBIT_TRIG_CMD,
    PS_OBC_REG_GRND_STN_PASS_NTF_CMD,
    PS_OBC_RADIO_TX_ENBL_DSBL_CMD,
    PS_OBC_STATE_UPDT_NTF,
    PS_OBC_PWR_ON_HNDSK_NTF,
    PS_OBC_KEEP_ALIVE_NTF,
    PS_OBC_RADIO_DATA_TX_CPLT_NTF,
    PS_OBC_SSD_ERR_NTF,
    PS_OBC_PS_FIRM_UPDT_NTF,
    PS_OBC_PLD_HW_FIRM_UPDT_NTF,
    PS_OBC_VM_FIRM_UPDT_NTF,
    PS_OBC_PS_RST_RECV_UPDT_NTF,
    PS_OBC_PS_APP_ID_LIST_NTF,
    PS_OBC_PS_HW_ID_LIST_NTF,
    PS_OBC_PS_HW_ERR_RECOV_NTF,
    PS_OBC_PS_SHUTDOWN_NTF,
    PS_OBC_PS_HW_PWR_ON_CMD,
    PS_OBC_PS_HW_PWR_OFF_CMD,

    PS_OBC_MAX_ICD,

    OBC_PS_SIMU_PS_PWR_ON_CMD = 1000,

#endif
    /** This is the max CRRN id allocated for PS */
    OBC_ES_PWR_OFF_CMD = 500,
    ES_OBC_TRGT_POINT_REQ,
    ICM_CRRN_ID_MAX = 1023,
}icm_crrn_id;

/*!
 *  @brief This structure holds the TC TM parameters information
 */
typedef struct _icm_tc_pld_info
{
    uint16 tc_id;
    uint8 src_id;
    uint8 dst_id;
    uint8 *tc_pld_buff;
    uint16 tc_pld_len;
}icm_tc_pld_info_s;

typedef struct
{
    uint32_t uptime;
    uint32_t epoch_time;
}ps_get_time_s;

typedef struct
{
    char processor_name[50];
    uint8_t chip_id;

}__attribute__((__packed__))ps_get_chip_info_s;

typedef struct
{
    uint64_t total_mem;
    uint64_t available_mem;
    uint64_t free_mem;
}ps_get_ext_mem_s;

typedef struct
{
    uint32_t clock_speed;
    uint8_t cores;
    uint32_t cache_size;
}__attribute__((__packed__))ps_get_feature_s;

/*!
 *  @brief This structure holds the TC TM parameters information
 */
typedef struct _icm_tm_pld_info
{
    uint16 tm_id;
    uint8 src_id;
    uint8 dst_id;
    uint8 *tm_pld_buff;
    uint16 tm_pld_len;
}icm_tm_pld_info_s;

/*!
 *  @brief This structure holds the PS shutdown request parameters information
 */
typedef struct _icm_ps_pwr_off_info
{
    uint8 shut_tmr_min;
    uint8 shut_tmr_sec;
    uint16 shut_tmr_ms;
    uint8 shut_purpose;
}icm_ps_pwr_off_info_s;

/*!
 *  @brief This structure holds the ground station pass notification information
 */
typedef struct _icm_gs_pass_info
{
    uint8 rem_tmr_min;
    uint8 rem_tmr_sec;
    uint16 rem_tmr_ms;
    uint8 radio_comm_intf_type;
}icm_gs_pass_info_s;

/*!
 *  @brief This structure holds the payload hardware shutdown parameter information
 */
typedef struct _icm_pld_hw_pwr_off_info
{
    uint16 pld_hw_id;
    uint8 shut_tmr_min;
    uint8 shut_tmr_sec;
    uint16 shut_tmr_ms;
    uint8 shut_purpose;
}icm_pld_hw_pwr_off_info_s;

/*!
 *  @brief This structure holds the payload Virtual Machine shutdown parameter information
 */
typedef struct _icm_vm_pwr_off_info
{
    uint16 vm_id;
    uint8 shut_tmr_min;
    uint8 shut_tmr_sec;
    uint16 shut_tmr_ms;
    uint8 shut_purpose;
}icm_vm_pwr_off_info_s;

/*!
 *  @brief This structure holds the Target Pointing request parameter information
 */
typedef struct _icm_trgt_pt_req
{
    float lat;
    float longit;
    float alt;
    uint8 pld_hw_id;
    uint8 act_tmr_min;
    uint8 act_tmr_sec;
    uint16 act_tmr_ms;
}icm_trgt_pt_req_s;

/*!
 *  @brief This structure holds the parameter information for orbit trigger
 *  registration
 */
typedef struct _icm_reg_orbt_trig
{
    float lat;
    float longit;
    float alt;
    uint8 pld_hw_id;
    uint8 alrt_tmr_min;
    uint8 alrt_tmr_sec;
    uint16 alrt_tmr_ms;
}icm_reg_orbt_trig_s;

/*!
 *  @brief This structure holds the parameter information for ground station
 *  pass notification
 */
typedef struct _icm_reg_grnd_stn_ps_ntf
{
    uint8 pld_hw_id;
    uint8 grnd_stn_id;
    uint8 alrt_tmr_min;
    uint8 alrt_tmr_sec;
    uint16 alrt_tmr_ms;
    uint8 purpose;
}icm_reg_grnd_stn_ps_ntf_s;

/*!
 *  @brief This structure holds the location information response
 */
typedef struct _icm_gnss_loc_info
{
    uint8 status;
    float lat;
    float longit;
    float alt;
}icm_gnss_loc_info_s;

/*!
 *  @brief This structure holds the SSD error information
 */
typedef struct _ssd_err_info
{
    uint8 err_type;
    uint8 sect_id;
}s_ssd_err_info;

typedef struct
{
        uint8 reset_recovery_state;
            uint8 reset_type;
}__attribute__((__packed__))obc_rst_recv_updt;

typedef struct
{
    uint8 shutdown_timer_value_minutes;
    uint8 shutdown_timer_seconds;
    uint16 shutdown_timer_milliseconds;
}__attribute__((__packed__))ps_shutdown_ntf;

typedef struct
{
    uint8 timer_seconds;
    uint8 timer_minutes;
    uint8 timer_hours;
    uint8 timer_days;
}__attribute__((__packed__))schd_ps_pwr_on_req;

typedef struct
{
    uint8 pwr_on_rsp;
    uint8 pwr_on_retry_req_dur;
}__attribute__((__packed__))obc_radio_pwr_on;

typedef struct
{
    uint8 radio_mod_id;
    uint8 radio_rx_enable_disable;
}__attribute__((__packed__))radio_rx_enbl_dsbl;

typedef struct
{
    uint8 min;
    uint8 hour;
    uint8 mday;
    uint8 mon;
    uint32 year;
    uint8 wday;
    uint16 yday;
    uint8 isday;
}__attribute__((__packed__))obc_get_curr_time;

/*!
 *  @brief This enum holds the enumeration values of types of SSD error
 */
typedef enum _ssd_err_type
{
    SSD_ACC_FAIL,
    BAD_SECTOR,
    SSD_MAX_ERR
}e_ssd_err_type;

/*!
 *  @brief This enum holds the enumeration values of PS Firmware update status
 */
typedef enum _ps_fm_updt_sts
{
    PS_FM_UPDT_STRT,
    PS_FM_UPDT_CPLT,
    PS_INVLD_FM_STS
}e_ps_fm_updt_sts;


/*!
 *  @brief This enum holds the enumeration values of Payload Hardware Firmware update status
 */
typedef enum _pld_hw_fm_updt_sts
{
    PLD_HW_FM_UPDT_STRT,
    PLD_HW_FM_UPDT_CPLT,
    PLD_HW_INVLD_FM_STS
}e_pld_hw_fm_updt_sts;

/*!
 *  @brief This enum holds the enumeration values of Payload Virtual Machine Firmware update status
 */
typedef enum _vm_fm_updt_sts
{
    VM_FM_UPDT_STRT,
    VM_FM_UPDT_CPLT,
    VM_INVLD_FM_STS
}e_vm_fm_updt_sts;

/*!
 *  @brief This enum holds the enumeration values of status of reset recovery
 */
typedef enum _ps_rcv_ste
{
    PS_RST_RCV_STRT,
    PS_RST_RCV_CPLT,
    PS_INVLD_RST_RCV_STS
}e_ps_rcv_ste;

/*!
 *  @brief This enum holds the enumeration values of Types of Reset
 */
typedef enum _ps_rst_type
{
    PS_SOFT_RST,
    PS_WDT_RST,
    PS_MAX_RST
}e_ps_rst_type;


/*!
 *  @brief This enum holds the enumeration values of Radio Module Interface
 */
typedef enum _icm_radio_comm_type
{
    ICM_RD_COMM_SBAND = 0,
    ICM_RD_COMM_XBAND,
    ICM_RD_COMM_INVDL
}icm_radio_comm_type;

/*!
 *  @brief This enum holds the enumeration values of power states of compute nodes
 */
typedef enum _icm_node_ste_type
{
    ICM_NODE_STE_ACT = 0,
    ICM_NODE_STE_PWR_SAVE,
    ICM_NODE_STE_INVLD
}icm_node_ste_type;

/*!
 *  @brief This enum holds the enumeration values of Shutdown purpose
 */
typedef enum _icm_shut_purpose
{
    ICM_SP_SYS_SHUT = 0,
    ICM_SP_LOW_BTRY,
    ICM_SP_RST_RCVRY,
    ICM_SP_OVR_TEMP,
    ICM_SP_INVLD
}icm_shut_purpose;

/*!
 *  @brief This enum holds the enumeration values of Payload HW ID
 */
typedef enum _icm_pld_hw_id
{
    ICM_PLD_HW_ID_AICRAFT = 0,
    ICM_PLD_HW_ID_NETRA,
    ICM_PLD_HW_ID_TRANSCELESTIAL,
    ICM_PLD_HW_ID_ZES,
    ICM_PLD_HW_ID_SAYAR_LABS,
    ICM_PLD_HW_ID_INVLD
}icm_pld_hw_id;

/*!
 *  @brief This enum holds the enumeration values PS Shutdown response
 */
typedef enum _icm_ps_shut_rsp
{
    ICM_PS_SHUT_CMD_ACC_ACK = 0,
    ICM_PS_SHUT_INIT,
    ICM_PS_SHUT_INVLD
}icm_ps_shut_rsp;

/*********************************************************************************/
/************** Command, Request, Notification Encoder Functions *****************/
/*********************************************************************************/

/*!
 * @brief This API encodes the Interface Control Messsage for
 * Target point request
 *
 * @param[in] tpr      : Structure instance of icm_trgt_pt_req_s
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 es_obc_trgt_point_req_enc(uint8** data, uint16* len, icm_trgt_pt_req_s *tpr);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * alert registration for orbit parameters
 *
 * @param[in] rot      : Structure instance of icm_reg_orbt_trig_s
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_reg_orbit_trig_cmd_enc(uint8** data, uint16* len, icm_reg_orbt_trig_s *rot);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * GNNS location request
 *
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_gnss_loc_req_enc(uint8** data, uint16* len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS keep alive request to OBC
 *
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_keep_alive_req_enc(uint8** data, uint16* len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * alert registration for ground station pass notification
 *
 * @param[in] rgspn    : Structure instance of icm_reg_grnd_stn_ps_ntf_s
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */

int8 ps_obc_radio_pwr_on_req_enc(uint8** data, uint16* len,uint8 radio_id);

int8 ps_obc_radio_pwr_on_req_enc(uint8** data, uint16* len,uint8 radio_id);

int8 ps_obc_get_curr_time_enc(uint8** data, uint16* len);

int8 ps_obc_schd_ps_pwr_on_req_enc(uint8** data, uint16* len,schd_ps_pwr_on_req* sprq);

int8 ps_obc_obc_app_id_list_req_enc(uint8** data, uint16* len);

int8 ps_obc_obc_hw_id_list_req_enc(uint8** data, uint16* len);

int8 ps_obc_obc_app_qos_pri_list_req_enc(uint8 **data, uint16* len);

int8 ps_obc_radio_rx_enbl_dsbl_cmd_enc(uint8** data, uint16* len,radio_rx_enbl_dsbl* radio_info);

int8 ps_obc_reg_grnd_stn_pass_ntf_cmd_enc(uint8** data, uint16* len, icm_reg_grnd_stn_ps_ntf_s *rgspn);

int8 ps_obc_radio_pwr_off_cmd_enc(uint8** data, uint16* len,uint8 radio_id);

int8 obc_ps_obc_hw_err_recv_ntf_rsp_enc(uint8** data, uint16* len,uint8 res);

int8 obc_ps_obc_frim_updt_ntf_rsp_enc(uint8** data, uint16* len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * Radio module TX enable disable control command
 *
 * @param[in] rad_mod  : Radio Module type
 * @param[in] tx_ctrl  : TX enable disable control
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_radio_tx_enbl_dsbl_cmd_enc(uint8** data, uint16* len, uint8 rad_mod, uint8 tx_ctrl);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS node state update notification
 *
 * @param[in] ste_info : PS node power state information
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ste_updt_ntf_enc(uint8** data, uint16* len, uint8 ste_info);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS node state update notification
 *
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_pwr_on_hndsh_ntf_enc(uint8** data, uint16* len);


/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS keep alive notification
 *
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_keep_alive_ntf_enc(uint8** data, uint16* len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS radio data transmission complete notification
 *
 * @param[in] radio_mod_id : Radio module ID value
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_radio_data_tx_cplt_ntf_enc(uint8** data, uint16* len, uint8 radio_mod_id);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS notification of SSD error to OBC
 *
 * @param[in] ssd_err_info : information about SSD error
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ssd_err_ntf_enc(uint8** data, uint16* len, s_ssd_err_info *ssd_err_info);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS notification of PS Firmware update status
 *
 * @param[in] fm_updt_sts : Firmware update status
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_firmware_updt_ntf_enc(uint8** data, uint16* len, uint8 fm_updt_sts);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS notification of Payload Virtual Machine Firmware update status
 *
 * @param[in] fm_updt_sts : Firmware update status
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_vm_firmware_updt_ntf_enc(uint8** data, uint16* len, uint8 fm_updt_sts, uint16 vm_id);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS reset and recovery status update notification
 *
 * @param[in] rcv_ste  : Recovery state
 * @param[in] rst_type : Reset type
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_rst_rcv_ntf_enc(uint8** data, uint16* len, uint8 rcv_ste, uint8 rst_type);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS APP ID list notification to OBC
 *
 * @param[in] app_id_info_buff  : Buffer pointer that points to APP ID information
 * @param[in] buf_len  : Length of the buffer
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_app_id_list_ntf_enc(uint8** data, uint16* len, uint8* app_id_info_buff, uint32 buf_len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS HW ID list notification to OBC
 *
 * @param[in] hw_id_info_buff  : Buffer pointer that points to HW ID information
 * @param[in] buf_len  : Length of the buffer
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_hw_id_list_ntf_enc(uint8** data, uint16* len, uint8* hw_id_info_buff, uint32 buf_len);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS notification of Playload Hardware Firmware update status
 *
 * @param[in] fm_updt_sts : Firmware update status
 * @param[in] hw_id : Payload Hardware ID
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_pld_hw_firmware_updt_ntf_enc(uint8** data, uint16* len, uint8 fm_updt_sts, uint16 hw_id);


/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS Hardware power on command
 *
 * @param[in] hw_id    : ID of the hardware to be powered on
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_hw_pwr_on_cmd_enc(uint8** data, uint16* len, uint16 hw_id);

/*!
 * @brief This API encodes the Interface Control Messsage for
 * PS Hardware power off command
 *
 * @param[in] tpr      : ID of the hardware to be powered off
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_hw_pwr_off_cmd_enc(uint8** data, uint16* len, uint16 hw_id);

int8 ps_obc_ps_shutdown_ntf_enc (uint8 **data, uint16* len, ps_shutdown_ntf* psd);

int8 ps_obc_ps_hw_err_recov_ntf_enc (uint8 **data, uint16* len, uint16 recovered_hardware_id);

/*********************************************************************************/
/************** Command, Request, Notification Decoder Functions *****************/
/*********************************************************************************/

/*!
 * @brief This API maps the decoder handler of respective CRRN ID
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 icm_data_dec_hdlr_map(void);

/*!
 * @brief This API decodes the CRRN ID of the received response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_icm_crrn_id_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of messages for which
 * specific message decoder is not assigned
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 icm_default_data_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS shutdown command
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_pwr_off_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS shutdown command
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_es_pwr_off_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS payload hardware power off command
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_pld_hw_pwr_off_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS payload Virtual Machine power off command
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_vm_pwr_off_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS payload Virtual Machine power off command
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_vm_pwr_on_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * TC_TM message from OBC to PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_tc_tm_msg_cmd_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS Keep alive request
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_keep_alive_req_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * PS APP ID list request
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_ps_app_id_list_req_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * Ground station pass alert notification
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_ps_app_pri_list_req_dec(const uint8 *data, uint16 len);

int8 obc_ps_gs_pass_ntf_dec(const uint8 *data, uint16 len);

int8 obc_ps_ps_hw_id_list_req_dec(const uint8 *data, uint16 len);

int8 obc_ps_ps_hw_pri_list_req_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * OBC state update notification
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_ste_updt_ntf_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * Radio power ON notification from OBC to PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_radio_pwr_on_ntf_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * Radio power OFF notification from OBC to PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_radio_pwr_off_ntf_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * OBC alive notification alert to PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_obc_keep_alive_ntf_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * OBC notification on OBC APP ID list
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_obc_app_id_list_ntf_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API handles the decoding of Interface control message of
 * OBC notification on OBC HW ID list
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */

int8 obc_ps_obc_frim_updt_ntf_dec(const uint8 *data, uint16 len);

int8 obc_ps_obc_rst_recv_updt_ntf_dec(const uint8 *data, uint16 len);
int8 obc_ps_staged_tc_cmd_dec(const uint8 *data, uint16 len);

int8 obc_ps_obc_hw_id_list_ntf_dec(const uint8 *data, uint16 len);

/*********************************************************************************/
/************************* Response Encoder Functions ****************************/
/*********************************************************************************/

/*!
 * @brief This API encodes the default response for Interface Control Messsage
 * for which response encoder are not assigned.
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 icm_default_rsp_enc_hdlr(void);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * PS shutdown command
 *
 * @param[in] shut_rsp : Contains the response status for shutdown command
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_pwr_off_rsp_enc(uint8** data, uint16* len, uint8 shut_rsp);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * ES shutdown command
 *
 * @param[in] shut_rsp : Contains the response status for shutdown command
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_es_pwr_off_rsp_enc(uint8** data, uint16* len, uint8 shut_rsp);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * payload hardware power off command
 *
 * @param[in] rsp_sts  : Contains the response status for hardware power off command
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_pld_hw_pwr_off_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * payload Virtual Machine power off command
 *
 * @param[in] rsp_sts  : Contains the response status for Payload VM power off command
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_vm_pwr_off_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * payload Virtual Machine power on command
 *
 * @param[in] rsp_sts  : Contains the response status for Payload VM power off command
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_vm_pwr_on_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * TC_TM data from PS to OBC
 *
 * @param[in] tc_tm_data : Contains the TC_TM data
 * @param[in] tc_tm_len  : Contains the TC_TM data length
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_tc_tm_msg_rsp_enc(uint8** data, uint16* len, \
        icm_tm_pld_info_s *tm_pld_info);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * PS Keep alive response
 *
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_keep_alive_rsp_enc(uint8** data, uint16* len);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * ground station pass alert
 *
 * @param[in] rsp_sts  : Contains the response status for ground station pass alert
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_gs_pass_ntf_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * Radio power ON notification
 *
 * @param[in] rsp_sts  : Contains the response status for Radio power ON notification
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_radio_pwr_on_ntf_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

/*!
 * @brief This API encodes the response for Interface Control Messsage of
 * Radio power OFF notification
 *
 * @param[in] rsp_sts  : Contains the response status for Radio power OFF notification
 * @param[out] data    : Data buffer containing encoded CRRN data
 * @param[out] len     : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_radio_pwr_off_ntf_rsp_enc(uint8** data, uint16* len, uint8 rsp_sts);

int8 obc_ps_obc_rst_recv_updt_ntf_rsp_enc(uint8** data, uint16* len);

int8 obc_ps_ps_app_pri_list_rsp_enc(uint8** data, uint16* len,uint8* buff_data,uint8 buf_len);

int8 obc_ps_ps_app_id_list_req_rsp_enc(uint8** data, uint16* len,uint8* buff_data,uint8 buf_len);

int8 obc_ps_ps_hw_id_list_rsp_enc(uint8** data, uint16* len,uint8* buff_data,uint8 buf_len);

int8 obc_ps_ps_hw_pri_list_rsp_enc(uint8** data, uint16* len,uint8* buff_data,uint8 buf_len);

/*********************************************************************************/
/************************* Response Decoder Functions ****************************/
/*********************************************************************************/

/*!
 * @brief This API decodes the Interface Control Message of
 * target pointing response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_trgt_pt_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * target pointing response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 es_obc_trgt_pt_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * GNSS location sharing response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_gnss_loc_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * Keep alive response from OBC
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_keep_alive_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * alert registration response for orbit parameter
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_reg_orbit_trig_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * alert registration response for Ground station pass
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_reg_grnd_stn_ps_ntf_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * response from OBC for handshake notification initiated by PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_pwr_on_hndsk_ntf_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * response from OBC for handshake notification initiated by PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_radio_data_tx_cplt_ntf_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * response from OBC for SSD error notification initiated by PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ssd_err_ntf_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * hardware power on response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_hw_pwr_on_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * hardware power off response
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 ps_obc_ps_hw_pwr_off_rsp_dec(const uint8 *data, uint16 len);

/*!
 * @brief This API decodes the Interface Control Message of
 * Simulation event trigger of OBC powering ON PS
 *
 * @param[in] data     : Data buffer containing encoded CRRN data
 * @param[in] len      : Length of the data buffer
 *
 * @return Result of API execution status
 * @retval Zero -> Success
 * @retval Negative -> Error.
 */
int8 obc_ps_simu_ps_pwr_on_cmd_dec(const uint8 *data, uint16 len);

int8 ps_obc_ps_hw_err_recov_ntf_rsp_dec(const uint8 *data, uint16 len);

int8 ps_obc_ps_shutdown_ntf_rsp_dec(const uint8 *data, uint16 len);
int8 ps_obc_radio_rx_enbl_dsbl_rsp_dec(const uint8 *data, uint16 len);
int8 ps_obc_radio_pwr_off_rsp_dec(const uint8 *data, uint16 len);
int8 ps_obc_get_curr_time_rsp_dec(const uint8 *data, uint16 len);
int8 ps_obc_schd_ps_pwr_on_rsp_dec(const uint8 *data, uint16 len);
int8 ps_obc_radio_pwr_on_rsp_dec(const uint8 *data, uint16 len);
int8 obc_ps_obc_hw_err_recov_ntf_dec(const uint8 *data, uint16 len);

int8 ps_obc_obc_app_id_list_rsp_dec(const uint8 *data, uint16 len);

int8 ps_obc_obc_hw_id_list_rsp_dec(const uint8 *data, uint16 len);

int8 ps_obc_obc_app_qos_pri_list_rsp_dec(const uint8 *data, uint16 len);

int8 obc_ps_get_temp_info_rsp_enc(uint8** data, uint16* len, uint8 temp_info_resp);
int8 obc_ps_get_temp_info_dec(const uint8 *data, uint16 len);
int8 obc_ps_get_time_info_dec(const uint8 *data, uint16 len);
int8 obc_ps_get_time_info_rsp_enc(uint8** data, uint16* len, ps_get_time_s *ps_get_time);
int8 obc_ps_get_chip_info_dec(const uint8 *data, uint16 len);
int8 obc_ps_get_ext_mem_dec(const uint8 *data, uint16 len);
int8 obc_ps_get_ext_mem_rsp_enc(uint8** data, uint16* len, ps_get_ext_mem_s *ps_get_ext_mem);
int8 obc_ps_get_chip_info_rsp_enc(uint8** data, uint16* len, ps_get_chip_info_s *ps_get_chip_info,ps_get_feature_s *ps_get_features);
uint8_t ps_tty_execute(char* tty_data,uint32_t data_len,char* tty_rsp);
int8 obc_ps_ftp_msg_cmd_dec(const uint8 *data, uint16 len);
int8 obc_ps_staged_tc_cmd_rsp_enc(uint8** data, uint16* len);
int8 obc_ps_xband_cmd_dec(const uint8 *data, uint16 len);
#endif /*PS_INTF_CTRL_MSG_H_*/
