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 Public header file of the Extended Resource Manager.
25 * \cond UCS_INTERNAL_DOC
33 /*------------------------------------------------------------------------------------------------*/
35 /*------------------------------------------------------------------------------------------------*/
36 #include "ucs_message_pb.h"
43 /*------------------------------------------------------------------------------------------------*/
45 /*------------------------------------------------------------------------------------------------*/
46 /*! \brief SyncLost Causes
47 * \ingroup G_UCS_RSM_TYPES
49 typedef enum Rsm_SyncLostCause_
51 RSM_SLC_NWSHUTDOWN, /*!< \brief "Network Shutdown" causes the SyncLost */
52 RSM_SLC_CFGNOTOK, /*!< \brief "Config Not Ok" causes the SyncLost */
53 RSM_SLC_SYSMODIF /*!< \brief "System Changes like own node address or MPR changes" cause the SyncLost */
55 } Rsm_SyncLostCause_t;
57 /*! \brief RSM Sync states
58 * \ingroup G_UCS_RSM_TYPES
60 typedef enum Rsm_DevSyncState_
62 RSM_DEV_UNSYNCED, /*!< \brief RSM device is "Unsynced", i.e. not in remote control mode */
63 RSM_DEV_SYNCING, /*!< \brief RSM device is "Synching" */
64 RSM_DEV_SYNCED /*!< \brief RSM device is "Synced", i.e. in remote control mode */
68 /*! \brief Result codes of the Extended Resource Manager.
69 * \ingroup G_UCS_RSM_TYPES
71 typedef enum Rsm_ResultCode_
73 RSM_RES_SUCCESS, /*!< \brief Device Sync succeeded */
74 RSM_RES_ERR_SYNC /*!< \brief Device Sync failed because of not Remote Control Mode */
78 /*------------------------------------------------------------------------------------------------*/
80 /*------------------------------------------------------------------------------------------------*/
81 /*! \brief Detailed information used for Extended Resource Manager results. */
82 typedef struct Rsm_ResultDetails_
84 /*! \brief Holds the status of the transmission. */
85 Ucs_MsgTxStatus_t tx_result;
86 /*! \brief Holds the results of the target device. */
87 Ucs_StdResult_t inic_result;
89 } Rsm_ResultDetails_t;
91 /*! \brief Result structure of the Extended Resource Manager. */
92 typedef struct Rsm_Result_
94 /*! \brief Result code. */
95 Rsm_ResultCode_t code;
96 /*! \brief Detailed information on the returned result. */
97 Rsm_ResultDetails_t details;
101 /*------------------------------------------------------------------------------------------------*/
102 /* Type definitions */
103 /*------------------------------------------------------------------------------------------------*/
104 /*! \brief Callback function type to retrieve a RSM result
105 * \param self The instance (optional)
106 * \param result The result message object
107 * \ingroup G_UCS_RSM_TYPES
109 typedef void (*Rsm_ResultCb_t)(void * self, Rsm_Result_t result);
117 * \def UCS_NUM_REMOTE_DEVICES
118 * \brief Customer assignment for number of remote devices required by Resources Management modules.
119 * \details If the macro is not defined, the UNICENS library will use a default value of 0. The user
120 * can overwrite this default value by defining the macro. Valid values are in the range
122 * \ingroup G_UCS_XRM_CFG
124 #ifndef UCS_NUM_REMOTE_DEVICES
125 # define UCS_NUM_REMOTE_DEVICES 0U
128 /*! \def UCS_ADDR_LOCAL_DEV
129 * \brief Defines the address of the local device.
130 * \details This macro is used to define the address of the local device. It should be used by
131 * the application to trigger jobs on the local device.
134 #define UCS_ADDR_LOCAL_DEV 0x0001U
140 #endif /* #ifndef UCS_RSM_PB_H */
142 /*------------------------------------------------------------------------------------------------*/
144 /*------------------------------------------------------------------------------------------------*/