1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491 */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG. */
5 /* This program is free software: you can redistribute it and/or modify */
6 /* it under the terms of the GNU General Public License as published by */
7 /* the Free Software Foundation, either version 2 of the License, or */
8 /* (at your option) any later version. */
10 /* This program is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU General Public License for more details. */
15 /* You should have received a copy of the GNU General Public License */
16 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* You may also obtain this software under a propriety license from Microchip. */
19 /* Please contact Microchip for further information. */
20 /*------------------------------------------------------------------------------------------------*/
24 * \brief Implementation of the Command Interpreter Module.
26 * \cond UCS_INTERNAL_DOC
27 * \addtogroup G_DEC_INT
31 /*------------------------------------------------------------------------------------------------*/
33 /*------------------------------------------------------------------------------------------------*/
36 #include "ucs_ret_pb.h"
38 /*------------------------------------------------------------------------------------------------*/
40 /*------------------------------------------------------------------------------------------------*/
41 /*! \brief Search in a FktOp table for matching FktID and OPType. This function is used for
42 * incoming ICM messages.
43 * \param list FktOp table
44 * \param index_ptr Reference to array index of the matching array element
45 * \param function_id FktID
46 * \param op_type OPType
47 * \return DEC_RET_SUCCESS Decoding was successful
48 * DEC_RET_FKTID_NOT_FOUND FktID/OPType not found
50 Dec_Return_t Dec_SearchFktOpIcm(Dec_FktOpIcm_t const list[], uint16_t *index_ptr,
51 uint16_t function_id, Ucs_OpType_t op_type)
55 Dec_Return_t ret_val = DEC_RET_FKTID_NOT_FOUND;
58 fktop = DEC_FKTOP(function_id, op_type);
61 while ((list[i].handler_function_ptr != NULL) && (loop != false))
63 if(list[i].fkt_op == fktop)
65 ret_val = DEC_RET_SUCCESS;
69 else if (list[i].fkt_op > fktop)
82 /*! \brief Search in a FktOp table for matching FktID and OPType. This function is used for
83 * MCM messages coming from FBlocks inside the INIC.
84 * \param list FktOp table
85 * \param index_ptr Reference to array index of the matching array element
86 * \param function_id FktID
87 * \param op_type OPType
88 * \return DEC_RET_SUCCESS Decoding was successful
89 * DEC_RET_FKTID_NOT_FOUND FktID/OPType not found
91 Dec_Return_t Dec_SearchFktOpIsh(Dec_FktOpIsh_t const list[], uint16_t *index_ptr,
92 uint16_t function_id, Ucs_OpType_t op_type)
96 Dec_Return_t ret_val = DEC_RET_FKTID_NOT_FOUND;
99 fktop = DEC_FKTOP(function_id, op_type);
102 while ((list[i].handler_function_ptr != NULL) && (loop != false))
104 if(list[i].fkt_op == fktop)
106 ret_val = DEC_RET_SUCCESS;
110 else if (list[i].fkt_op > fktop)
128 /*------------------------------------------------------------------------------------------------*/
130 /*------------------------------------------------------------------------------------------------*/