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 FBlock INIC (resource management parts of INIC management)
25 * \details Contains the resource management parts of INIC management
27 * \cond UCS_INTERNAL_DOC
32 /*------------------------------------------------------------------------------------------------*/
34 /*------------------------------------------------------------------------------------------------*/
36 #include "ucs_ret_pb.h"
40 /*------------------------------------------------------------------------------------------------*/
42 /*------------------------------------------------------------------------------------------------*/
43 /*! \brief API locking Bitmask for all INIC create methods. */
44 #define INIC_API_CREATE_CLASS 0x0001U
45 /*! \brief API locking Bitmask of method Inic_ResourceDestroy(). */
46 #define INIC_API_RESOURCE_DESTROY 0x0002U
47 /*! \brief API locking Bitmask of method Inic_ResourceInvalidList_Get(). */
48 #define INIC_API_RESOURCE_INVAL_LIST 0x0004U
49 /*! \brief API locking Bitmask of method Inic_Notification_Set(). */
50 #define INIC_API_NOTIFICATION 0x0008U
51 /*! \brief API locking Bitmask of method Inic_StreamPortConfig_Get(). */
52 #define INIC_API_STREAM_PORT_CONFIG 0x0010U
53 /*! \brief API locking Bitmask of method Inic_SyncMute(). */
54 #define INIC_API_SYNC_MUTE 0x0020U
55 /*! \brief API locking Bitmask of method Inic_SyncDemute(). */
56 #define INIC_API_SYNC_DEMUTE 0x0040U
57 /*! \brief API locking Bitmask of method Inic_MostPortEnable(). */
58 #define INIC_API_MOST_PORT_ENABLE 0x0080U
59 /*! \brief API locking Bitmask of method Inic_MostPortEnFullStr(). */
60 #define INIC_API_MOST_PORT_EN_FULL_STR 0x0100U
61 /*! \brief API locking Bitmask of method Inic_GpioPortPinMode_SetGet(). */
62 #define INIC_API_GPIO_PIN_MODE 0x0200U
63 /*! \brief API locking Bitmask of method Inic_GpioPortPinState_SetGet(). */
64 #define INIC_API_GPIO_PIN_STATE 0x0400U
65 /*! \brief API locking Bitmask of methods Inic_I2cPortRead_StartResultAck() and Inic_I2cPortWrite_StartResultAck(). */
66 #define INIC_API_I2C_PORT_WR 0x0800U
67 /*! \brief Bitmask for API method Inic_DeviceSync() used by API locking manager */
68 #define INIC_API_DEVICE_SYNC 0x1000U
70 /*------------------------------------------------------------------------------------------------*/
71 /* Internal prototypes */
72 /*------------------------------------------------------------------------------------------------*/
73 static void Inic_HandleResApiTimeout(void *self, void *method_mask_ptr);
74 static void Inic_ResMsgTxStatusCb(void *self, Msg_MostTel_t *tel_ptr, Ucs_MsgTxStatus_t status);
76 /*------------------------------------------------------------------------------------------------*/
78 /*------------------------------------------------------------------------------------------------*/
79 /*! \brief Initialization function of the INIC Resource Management part. Called by Inic_Ctor().
80 * \param self Instance pointer
82 void Inic_InitResourceManagement(CInic *self)
84 Sobs_Ctor(&self->lock.res_observer, self, &Inic_HandleResApiTimeout);
85 Al_Ctor(&self->lock.res_api, &self->lock.res_observer, self->base_ptr->ucs_user_ptr);
86 Alm_RegisterApi(&self->base_ptr->alm, &self->lock.res_api);
88 /* initializes the gpio report time status */
89 self->gpio_rt_status.first_report = true;
92 /*! \brief Handles an API timeout
93 * \param self Instance pointer
94 * \param method_mask_ptr Bitmask to signal which API method has caused the timeout
96 static void Inic_HandleResApiTimeout(void *self, void *method_mask_ptr)
98 CInic *self_ = (CInic *)self;
99 Alm_ModuleMask_t method_mask = *((Alm_ModuleMask_t *)method_mask_ptr);
100 Inic_StdResult_t res_data;
102 res_data.data_info = NULL;
103 res_data.result.code = UCS_RES_ERR_TIMEOUT;
104 res_data.result.info_ptr = NULL;
108 case INIC_API_CREATE_CLASS:
109 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
110 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for INIC create method.", 0U));
112 case INIC_API_RESOURCE_DESTROY:
113 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_DESTROY], &res_data, true);
114 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_ResourceDestroy().", 0U));
116 case INIC_API_RESOURCE_INVAL_LIST:
117 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST], &res_data, true);
118 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_ResourceInvalidList_Get().", 0U));
120 case INIC_API_NOTIFICATION:
121 Ssub_Notify(&self_->ssubs[INIC_SSUB_NOTIFICATION], &res_data, true);
122 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_Notification_Get().", 0U));
124 case INIC_API_STREAM_PORT_CONFIG:
125 Ssub_Notify(&self_->ssubs[INIC_SSUB_STREAM_PORT_CONFIG], &res_data, true);
126 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_StreamPortConfig_Get().", 0U));
128 case INIC_API_SYNC_MUTE:
129 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_MUTE], &res_data, true);
130 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_SyncMute().", 0U));
132 case INIC_API_SYNC_DEMUTE:
133 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_DEMUTE], &res_data, true);
134 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_SyncDemute().", 0U));
136 case INIC_API_MOST_PORT_ENABLE:
137 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_ENABLE], &res_data, true);
138 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_MostPortEnable().", 0U));
140 case INIC_API_MOST_PORT_EN_FULL_STR:
141 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_EN_FULL_STR], &res_data, true);
142 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_MostPortEnFullStr().", 0U));
144 case INIC_API_GPIO_PIN_MODE:
145 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_MODE], &res_data, true);
146 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_GpioPortPinMode_SetGet().", 0U));
148 case INIC_API_GPIO_PIN_STATE:
149 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_STATE], &res_data, true);
150 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_GpioPortPinState_SetGet().", 0U));
152 case INIC_API_DEVICE_SYNC:
153 Ssub_Notify(&self_->ssubs[INIC_SSUB_DEVICE_SYNC], &res_data, true);
154 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "API locking timeout occurred for method Inic_DeviceSync_StartResult().", 0U));
157 TR_ERROR((self_->base_ptr->ucs_user_ptr, "[INIC_RES]", "Unknown API locking bitmask detected. Mask: 0x%02X", 1U, method_mask));
162 /*! \brief Add an observer to the ResourceMonitor subject
163 * \param self Instance of CInic
164 * \param obs_ptr Pointer to observer to be informed
166 void Inic_AddObsrvResMonitor(CInic *self, CObserver *obs_ptr)
168 (void)Sub_AddObserver(&self->subs[INIC_SUB_RES_MONITOR], obs_ptr);
171 /*! \brief Delete an observer from the ResourceMonitor subject
172 * \param self Instance of CInic
173 * \param obs_ptr Pointer to observer to be informed
175 void Inic_DelObsrvResMonitor(CInic *self, CObserver *obs_ptr)
177 (void)Sub_RemoveObserver(&self->subs[INIC_SUB_RES_MONITOR], obs_ptr);
180 /*! \brief Add an observer to the MOSTPortStatus subject
181 * \param self Instance of CInic
182 * \param obs_ptr Pointer to observer to be informed
184 void Inic_AddObsrvMostPortStatus(CInic *self, CObserver *obs_ptr)
186 if (Sub_AddObserver(&self->subs[INIC_SUB_MOST_PORT_STATUS], obs_ptr) != SUB_UNKNOWN_OBSERVER)
188 Sub_Notify(&self->subs[INIC_SUB_MOST_PORT_STATUS], &self->most_port_status);
192 /*! \brief Delete an observer from the MOSTPortStatus subject
193 * \param self Instance of CInic
194 * \param obs_ptr Pointer to observer to be informed
196 void Inic_DelObsrvMostPortStatus(CInic *self, CObserver *obs_ptr)
198 (void)Sub_RemoveObserver(&self->subs[INIC_SUB_MOST_PORT_STATUS], obs_ptr);
201 /*! \brief Add an observer to the GpioTriggerEvent subject
202 * \param self Instance of CInic
203 * \param obs_ptr Pointer to observer to be informed
205 void Inic_AddObsrvGpioTriggerEvent(CInic *self, CObserver *obs_ptr)
207 (void)Sub_AddObserver(&self->subs[INIC_SUB_GPIO_TRIGGER_EVENT], obs_ptr);
210 /*! \brief Removes an observer from the GpioTriggerEvent subject
211 * \param self Instance of CInic
212 * \param obs_ptr Pointer to observer to be informed
214 void Inic_DelObsrvGpioTriggerEvent(CInic *self, CObserver *obs_ptr)
216 (void)Sub_RemoveObserver(&self->subs[INIC_SUB_GPIO_TRIGGER_EVENT], obs_ptr);
219 /*! \brief Destroys the resources associated with the given resource handles
220 * \param self Reference to CInic instance
221 * \param res_handle_list resource handle list
222 * \param obs_ptr Reference to an optional observer. The result must be casted into type
224 * \return UCS_RET_SUCCESS message was created
225 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
226 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
227 * \return UCS_RET_ERR_PARAM Wrong length of resource handle list
229 Ucs_Return_t Inic_ResourceDestroy(CInic *self,
230 Inic_ResHandleList_t res_handle_list,
231 CSingleObserver *obs_ptr)
233 Ucs_Return_t result = UCS_RET_SUCCESS;
236 if(Al_Lock(&self->lock.res_api, INIC_API_RESOURCE_DESTROY) != false)
238 /* sender handle + number of resource handles */
239 len = 2U * res_handle_list.num_handles;
241 if ((len == 0U) || ((MAX_INVALID_HANDLES_LIST << 1) < len))
243 Al_Release(&self->lock.res_api, INIC_API_RESOURCE_DESTROY);
244 result = UCS_RET_ERR_PARAM;
248 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, len);
254 msg_ptr->destination_addr = self->target_address;
256 msg_ptr->id.fblock_id = FB_INIC;
257 msg_ptr->id.instance_id = 0U;
258 msg_ptr->id.function_id = INIC_FID_RESOURCE_DESTROY;
259 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
261 for (i=0U; i < res_handle_list.num_handles; ++i)
263 msg_ptr->tel.tel_data_ptr[2U*i] = MISC_HB(res_handle_list.res_handles[i]);
264 msg_ptr->tel.tel_data_ptr[1U + (2U*i)] = MISC_LB(res_handle_list.res_handles[i]);
267 self->ssubs[INIC_SSUB_RESOURCE_DESTROY].user_mask = INIC_API_RESOURCE_DESTROY;
268 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_RESOURCE_DESTROY];
269 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
271 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_RESOURCE_DESTROY], obs_ptr);
275 Al_Release(&self->lock.res_api, INIC_API_RESOURCE_DESTROY);
276 result = UCS_RET_ERR_BUFFER_OVERFLOW;
282 result = UCS_RET_ERR_API_LOCKED;
288 /*! \brief Retrieves the list of invalid resources
289 * \param self Reference to CInic instance
290 * \param obs_ptr Reference to an optional observer. The result must be casted into type
292 * \return UCS_RET_SUCCESS message was created
293 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
294 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
296 Ucs_Return_t Inic_ResourceInvalidList_Get(CInic *self, CSingleObserver *obs_ptr)
298 Ucs_Return_t result = UCS_RET_SUCCESS;
300 if(Al_Lock(&self->lock.res_api, INIC_API_RESOURCE_INVAL_LIST) != false)
302 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 0U);
306 msg_ptr->destination_addr = self->target_address;
307 msg_ptr->id.fblock_id = FB_INIC;
308 msg_ptr->id.instance_id = 0U;
309 msg_ptr->id.function_id = INIC_FID_RESOURCE_INVALID_LIST;
310 msg_ptr->id.op_type = UCS_OP_GET;
312 self->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST].user_mask = INIC_API_RESOURCE_INVAL_LIST;
313 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST];
314 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
315 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST], obs_ptr);
319 Al_Release(&self->lock.res_api, INIC_API_RESOURCE_INVAL_LIST);
320 result = UCS_RET_ERR_BUFFER_OVERFLOW;
325 result = UCS_RET_ERR_API_LOCKED;
331 /*! \brief Resets the resource monitor back to its default state.
332 * \param self Reference to CInic instance
333 * \param control Used to reset the resource monitor
334 * \return UCS_RET_SUCCESS message was created
335 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
337 Ucs_Return_t Inic_ResourceMonitor_Set(CInic *self, Ucs_Resource_MonitorCtrl_t control)
339 Ucs_Return_t result = UCS_RET_SUCCESS;
341 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 1U);
345 msg_ptr->destination_addr = self->target_address;
346 msg_ptr->id.fblock_id = FB_INIC;
347 msg_ptr->id.instance_id = 0U;
348 msg_ptr->id.function_id = INIC_FID_RESOURCE_MONITOR;
349 msg_ptr->id.op_type = UCS_OP_SET;
350 msg_ptr->tel.tel_data_ptr[0] = (uint8_t)control;
351 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
355 result = UCS_RET_ERR_BUFFER_OVERFLOW;
361 /*! \brief Triggers notification of the given function_id list.
362 * \param self Reference to CInic instance
363 * \param control control command used
364 * \param device_id Id of the sending device (local node address).
365 * \param fktid_list function ids list.
366 * \return UCS_RET_SUCCESS message was created
367 * \return UCS_RET_ERR_PARAM parameter exceeds its admissible range was created
368 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
370 Ucs_Return_t Inic_Notification_Set(CInic *self, Ucs_Inic_NotificationCtrl_t control, uint16_t device_id, Inic_FktIdList_t fktid_list)
372 Ucs_Return_t result = UCS_RET_SUCCESS;
374 /* control + device_id + size of the funcids list */
375 uint8_t len = 1U + 2U + (2U * fktid_list.num_fktids);
377 if (len > MSG_MAX_SIZE_PAYLOAD)
379 result = UCS_RET_ERR_PARAM;
383 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, len);
389 msg_ptr->destination_addr = self->target_address;
391 msg_ptr->id.fblock_id = FB_INIC;
392 msg_ptr->id.instance_id = 0U;
393 msg_ptr->id.function_id = INIC_FID_NOTIFICATION;
394 msg_ptr->id.op_type = UCS_OP_SET;
396 msg_ptr->tel.tel_data_ptr[0] = (uint8_t)control;
397 msg_ptr->tel.tel_data_ptr[1] = MISC_HB(device_id);
398 msg_ptr->tel.tel_data_ptr[2] = MISC_LB(device_id);
400 if ((len > 3U) && (fktid_list.fktids_ptr != NULL) )
402 for (i=0U; i < fktid_list.num_fktids; ++i)
404 msg_ptr->tel.tel_data_ptr[3U+(2U*i)] = MISC_HB(fktid_list.fktids_ptr[i]);
405 msg_ptr->tel.tel_data_ptr[4U+(2U*i)] = MISC_LB(fktid_list.fktids_ptr[i]);
409 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_NOTIFICATION];
410 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
414 result = UCS_RET_ERR_BUFFER_OVERFLOW;
421 /*! \brief Gets the device id that has notified the given function_id
422 * \param self Reference to CInic instance
423 * \param fktid The function id to be looked for
424 * \param obs_ptr Reference to an optional observer
425 * \return UCS_RET_SUCCESS message was created
426 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
427 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
429 Ucs_Return_t Inic_Notification_Get(CInic *self, uint16_t fktid, CSingleObserver *obs_ptr)
431 Ucs_Return_t result = UCS_RET_SUCCESS;
433 if(Al_Lock(&self->lock.res_api, INIC_API_NOTIFICATION) != false)
435 Msg_MostTel_t * msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
439 msg_ptr->destination_addr = self->target_address;
441 msg_ptr->id.fblock_id = FB_INIC;
442 msg_ptr->id.instance_id = 0U;
443 msg_ptr->id.function_id = INIC_FID_NOTIFICATION;
444 msg_ptr->id.op_type = UCS_OP_GET;
446 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(fktid);
447 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(fktid);
449 self->ssubs[INIC_SSUB_NOTIFICATION].user_mask = INIC_API_NOTIFICATION;
450 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_NOTIFICATION];
451 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
453 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_NOTIFICATION], obs_ptr);
457 Al_Release(&self->lock.res_api, INIC_API_NOTIFICATION);
458 result = UCS_RET_ERR_BUFFER_OVERFLOW;
463 result = UCS_RET_ERR_API_LOCKED;
469 /*! \brief Creates a synchronous data connection. The connection can be directly associated with
470 * an input and output socket.
471 * \param self Reference to CInic instance
472 * \param resource_handle_in The ID number of the socket or splitter resource that is the
473 * starting point of the link.
474 * \param resource_handle_out The ID number of the socket or splitter resource that is the ending
476 * \param default_mute specifies if the connection is muted by default
477 * \param mute_mode Configures how the resource monitor shall handle events that may
478 * the streamed data invalid.
479 * \param offset Denotes the offset from/to where data from/to a socket should be
480 * routed from/to a splitter/combiner.
481 * \param obs_ptr Reference to an optional observer
482 * \return UCS_RET_SUCCESS message was created
483 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
484 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
486 Ucs_Return_t Inic_SyncCreate(CInic *self,
487 uint16_t resource_handle_in,
488 uint16_t resource_handle_out,
490 Ucs_Sync_MuteMode_t mute_mode,
492 CSingleObserver *obs_ptr)
494 Ucs_Return_t result = UCS_RET_SUCCESS;
496 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
498 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 8U);
502 msg_ptr->destination_addr = self->target_address;
504 msg_ptr->id.fblock_id = FB_INIC;
505 msg_ptr->id.instance_id = 0U;
506 msg_ptr->id.function_id = INIC_FID_SYNC_CREATE;
507 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
509 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(resource_handle_in);
510 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(resource_handle_in);
511 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(resource_handle_out);
512 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(resource_handle_out);
513 msg_ptr->tel.tel_data_ptr[4] = (default_mute != false) ? 1U : 0U;
514 msg_ptr->tel.tel_data_ptr[5] = (uint8_t)mute_mode;
515 msg_ptr->tel.tel_data_ptr[6] = MISC_HB(offset);
516 msg_ptr->tel.tel_data_ptr[7] = MISC_LB(offset);
518 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
519 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
520 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
522 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
526 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
527 result = UCS_RET_ERR_BUFFER_OVERFLOW;
532 result = UCS_RET_ERR_API_LOCKED;
538 /*! \brief This function manually mutes a synchronous data connection.
539 * \param self Reference to CInic instance
540 * \param sync_handle Resource handle of the synchronous connection
541 * \param obs_ptr Reference to an optional observer
542 * \return UCS_RET_SUCCESS message was created
543 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
544 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
546 Ucs_Return_t Inic_SyncMute(CInic *self,
547 uint16_t sync_handle,
548 CSingleObserver *obs_ptr)
550 Ucs_Return_t result = UCS_RET_SUCCESS;
552 if(Al_Lock(&self->lock.res_api, INIC_API_SYNC_MUTE) != false)
554 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
558 msg_ptr->destination_addr = self->target_address;
560 msg_ptr->id.fblock_id = FB_INIC;
561 msg_ptr->id.instance_id = 0U;
562 msg_ptr->id.function_id = INIC_FID_SYNC_MUTE;
563 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
565 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(sync_handle);
566 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(sync_handle);
568 self->ssubs[INIC_SSUB_SYNC_MUTE].user_mask = INIC_API_SYNC_MUTE;
569 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_SYNC_MUTE];
570 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
572 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_SYNC_MUTE], obs_ptr);
576 Al_Release(&self->lock.res_api, INIC_API_SYNC_MUTE);
577 result = UCS_RET_ERR_BUFFER_OVERFLOW;
582 result = UCS_RET_ERR_API_LOCKED;
588 /*! \brief This function manually de-mutes a synchronous data connection.
589 * \param self Reference to CInic instance
590 * \param sync_handle Resource handle of the synchronous connection
591 * \param obs_ptr Reference to an optional observer
592 * \return UCS_RET_SUCCESS message was created
593 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
594 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
596 Ucs_Return_t Inic_SyncDemute(CInic *self,
597 uint16_t sync_handle,
598 CSingleObserver *obs_ptr)
600 Ucs_Return_t result = UCS_RET_SUCCESS;
602 if(Al_Lock(&self->lock.res_api, INIC_API_SYNC_DEMUTE) != false)
604 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
608 msg_ptr->destination_addr = self->target_address;
610 msg_ptr->id.fblock_id = FB_INIC;
611 msg_ptr->id.instance_id = 0U;
612 msg_ptr->id.function_id = INIC_FID_SYNC_DEMUTE;
613 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
615 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(sync_handle);
616 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(sync_handle);
618 self->ssubs[INIC_SSUB_SYNC_DEMUTE].user_mask = INIC_API_SYNC_DEMUTE;
619 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_SYNC_DEMUTE];
620 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
622 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_SYNC_DEMUTE], obs_ptr);
626 Al_Release(&self->lock.res_api, INIC_API_SYNC_DEMUTE);
627 result = UCS_RET_ERR_BUFFER_OVERFLOW;
632 result = UCS_RET_ERR_API_LOCKED;
638 /*! \brief Creates a DiscreteFrame Isochronous streaming phase connection. The connection can be
639 * directly associated with an input and output socket.
640 * \param self Reference to CInic instance
641 * \param resource_handle_in The ID number of the socket or splitter resource that is the
642 * starting point of the link.
643 * \param resource_handle_out The ID number of the socket or splitter resource that is the ending
645 * \param obs_ptr Reference to an optional observer
646 * \return UCS_RET_SUCCESS message was created
647 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
648 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
650 Ucs_Return_t Inic_DfiPhaseCreate(CInic *self,
651 uint16_t resource_handle_in,
652 uint16_t resource_handle_out,
653 CSingleObserver *obs_ptr)
655 Ucs_Return_t result = UCS_RET_SUCCESS;
657 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
659 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
663 msg_ptr->destination_addr = self->target_address;
665 msg_ptr->id.fblock_id = FB_INIC;
666 msg_ptr->id.instance_id = 0U;
667 msg_ptr->id.function_id = INIC_FID_DFIPHASE_CREATE;
668 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
670 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(resource_handle_in);
671 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(resource_handle_in);
672 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(resource_handle_out);
673 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(resource_handle_out);
675 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
676 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
677 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
679 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
683 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
684 result = UCS_RET_ERR_BUFFER_OVERFLOW;
689 result = UCS_RET_ERR_API_LOCKED;
695 /*! \brief Creates a combiner resource. A Combiner enables grouping of data from multiple network
696 * sockets into the same port socket.
697 * \param self Reference to CInic instance
698 * \param port_socket_handle Only supported sockets are Streaming Port, MLB, USB (OS81118) or PCI
699 * (OS81160) sockets of data type Synchronous. Direction must be OUT.
700 * \param most_port_handle When the splitter is created with a MOST socket, the socket must be
701 * created on the same port indicated by this handle.
702 * \param bytes_per_frame Specifies the total number of data bytes that are to be transferred
704 * \param obs_ptr Reference to an optional observer
705 * \return UCS_RET_SUCCESS message was created
706 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
707 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
709 Ucs_Return_t Inic_CombinerCreate(CInic *self,
710 uint16_t port_socket_handle,
711 uint16_t most_port_handle,
712 uint16_t bytes_per_frame,
713 CSingleObserver *obs_ptr)
715 Ucs_Return_t result = UCS_RET_SUCCESS;
717 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
719 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
723 msg_ptr->destination_addr = self->target_address;
725 msg_ptr->id.fblock_id = FB_INIC;
726 msg_ptr->id.instance_id = 0U;
727 msg_ptr->id.function_id = INIC_FID_COMBINER_CREATE;
728 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
730 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(port_socket_handle);
731 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(port_socket_handle);
732 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(most_port_handle);
733 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(most_port_handle);
734 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(bytes_per_frame);
735 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(bytes_per_frame);
737 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
738 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
739 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
741 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
745 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
746 result = UCS_RET_ERR_BUFFER_OVERFLOW;
751 result = UCS_RET_ERR_API_LOCKED;
757 /*! \brief Creates a splitter resource. A Splitter enables splitting up the data from a single
758 * channel into multiple channels.
759 * \param self Reference to CInic instance
760 * \param socket_handle_in All sockets of data type Synchronous are supported, regardless of
761 * the port the socket is created on. The direction must be IN.
762 * \param most_port_handle When the splitter is created with a MOST socket, the socket must be
763 * created on the same port indicated by this handle.
764 * \param bytes_per_frame Specifies the total number of data bytes that are to be transferred
766 * \param obs_ptr Reference to an optional observer
767 * \return UCS_RET_SUCCESS message was created
768 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
769 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
771 Ucs_Return_t Inic_SplitterCreate(CInic *self,
772 uint16_t socket_handle_in,
773 uint16_t most_port_handle,
774 uint16_t bytes_per_frame,
775 CSingleObserver *obs_ptr)
777 Ucs_Return_t result = UCS_RET_SUCCESS;
779 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
781 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
785 msg_ptr->destination_addr = self->target_address;
787 msg_ptr->id.fblock_id = FB_INIC;
788 msg_ptr->id.instance_id = 0U;
789 msg_ptr->id.function_id = INIC_FID_SPLITTER_CREATE;
790 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
792 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(socket_handle_in);
793 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(socket_handle_in);
794 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(most_port_handle);
795 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(most_port_handle);
796 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(bytes_per_frame);
797 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(bytes_per_frame);
799 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
800 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
801 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
803 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
807 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
808 result = UCS_RET_ERR_BUFFER_OVERFLOW;
813 result = UCS_RET_ERR_API_LOCKED;
819 /*! \brief Creates an Quality of Service IP Streaming data connection.
820 * \param self Reference to CInic instance
821 * \param socket_in_handle The ID number of the created socket that is the starting point of
822 * the link. Must be a socket of type Input.
823 * \param socket_out_handle The ID number of the created socket that is the ending point of
824 * the link. Must be a socket of type Output.
825 * \param obs_ptr Reference to an optional observer
826 * \return UCS_RET_SUCCESS message was created
827 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
828 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
830 Ucs_Return_t Inic_QoSCreate(CInic *self,
831 uint16_t socket_in_handle,
832 uint16_t socket_out_handle,
833 CSingleObserver *obs_ptr)
835 Ucs_Return_t result = UCS_RET_SUCCESS;
837 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
839 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
843 msg_ptr->destination_addr = self->target_address;
845 msg_ptr->id.fblock_id = FB_INIC;
846 msg_ptr->id.instance_id = 0U;
847 msg_ptr->id.function_id = INIC_FID_QOS_CREATE;
848 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
850 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(socket_in_handle);
851 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(socket_in_handle);
852 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(socket_out_handle);
853 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(socket_out_handle);
855 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
856 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
857 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
859 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
863 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
864 result = UCS_RET_ERR_BUFFER_OVERFLOW;
869 result = UCS_RET_ERR_API_LOCKED;
875 /*! \brief Creates an IPC (Inter-Processor Communication) packet connection.
876 * \param self Reference to CInic instance
877 * \param socket_in_handle The ID number of the created socket that is the starting point of
878 * the link. Must be a socket of type Input.
879 * \param socket_out_handle The ID number of the created socket that is the ending point of
880 * the link. Must be a socket of type Output.
881 * \param obs_ptr Reference to an optional observer
882 * \return UCS_RET_SUCCESS message was created
883 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
884 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
886 Ucs_Return_t Inic_IpcCreate(CInic *self,
887 uint16_t socket_in_handle,
888 uint16_t socket_out_handle,
889 CSingleObserver *obs_ptr)
891 Ucs_Return_t result = UCS_RET_SUCCESS;
893 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
895 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
899 msg_ptr->destination_addr = self->target_address;
901 msg_ptr->id.fblock_id = FB_INIC;
902 msg_ptr->id.instance_id = 0U;
903 msg_ptr->id.function_id = INIC_FID_IPC_CREATE;
904 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
906 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(socket_in_handle);
907 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(socket_in_handle);
908 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(socket_out_handle);
909 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(socket_out_handle);
911 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
912 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
913 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
915 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
919 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
920 result = UCS_RET_ERR_BUFFER_OVERFLOW;
925 result = UCS_RET_ERR_API_LOCKED;
931 /*! \brief Creates an A/V Packetized Isochronous Streaming data connection.
932 * \param self Reference to CInic instance
933 * \param socket_in_handle The ID number of the created socket that is the starting point of
934 * the link. Must be a socket of type Input.
935 * \param socket_out_handle The ID number of the created socket that is the ending point of
936 * the link. Must be a socket of type Output.
937 * \param isoc_packet_size Specifies the size of data packets that are to be transported over
938 * the isochronous channel.
939 * \param obs_ptr Reference to an optional observer
940 * \return UCS_RET_SUCCESS message was created
941 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
942 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
944 Ucs_Return_t Inic_AvpCreate(CInic *self,
945 uint16_t socket_in_handle,
946 uint16_t socket_out_handle,
947 Ucs_Avp_IsocPacketSize_t isoc_packet_size,
948 CSingleObserver *obs_ptr)
950 Ucs_Return_t result = UCS_RET_SUCCESS;
952 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
954 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
958 msg_ptr->destination_addr = self->target_address;
960 msg_ptr->id.fblock_id = FB_INIC;
961 msg_ptr->id.instance_id = 0U;
962 msg_ptr->id.function_id = INIC_FID_AVP_CREATE;
963 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
965 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(socket_in_handle);
966 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(socket_in_handle);
967 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(socket_out_handle);
968 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(socket_out_handle);
969 msg_ptr->tel.tel_data_ptr[4] = MISC_HB((uint16_t)isoc_packet_size);
970 msg_ptr->tel.tel_data_ptr[5] = MISC_LB((uint16_t)isoc_packet_size);
972 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
973 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
974 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
976 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
980 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
981 result = UCS_RET_ERR_BUFFER_OVERFLOW;
986 result = UCS_RET_ERR_API_LOCKED;
992 /*! \brief This function creates a MOST socket bound to the MOST Network Port.
993 * \param self Reference to CInic instance
994 * \param most_port_handle MOST Network Port resource handle
995 * \param direction indicates the direction of the data stream from the perspective of
997 * \param data_type Specifies the data type
998 * \param bandwidth Required socket bandwidth in bytes. Maximum value depends on current
999 * free network resources.
1000 * \param connection_label MOST network connection label. When used as parameter with direction
1001 * Input, the connection label is used to connect to the appropriate MOST
1002 * frame bytes. When used as parameter with direction Output, the
1003 * connection label is not used and must be set to 0xFFFF.
1004 * \param obs_ptr Reference to an optional observer
1005 * \return UCS_RET_SUCCESS message was created
1006 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1007 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1009 Ucs_Return_t Inic_MostSocketCreate(CInic *self,
1010 uint16_t most_port_handle,
1011 Ucs_SocketDirection_t direction,
1012 Ucs_Most_SocketDataType_t data_type,
1014 uint16_t connection_label,
1015 CSingleObserver *obs_ptr)
1017 Ucs_Return_t result = UCS_RET_SUCCESS;
1019 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1021 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 8U);
1023 if (msg_ptr != NULL)
1025 msg_ptr->destination_addr = self->target_address;
1027 msg_ptr->id.fblock_id = FB_INIC;
1028 msg_ptr->id.instance_id = 0U;
1029 msg_ptr->id.function_id = INIC_FID_MOST_SOCKET_CREATE;
1030 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1032 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(most_port_handle);
1033 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(most_port_handle);
1034 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)direction;
1035 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)data_type;
1036 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(bandwidth);
1037 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(bandwidth);
1038 msg_ptr->tel.tel_data_ptr[6] = MISC_HB(connection_label);
1039 msg_ptr->tel.tel_data_ptr[7] = MISC_LB(connection_label);
1041 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1042 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1043 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1045 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1049 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1050 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1055 result = UCS_RET_ERR_API_LOCKED;
1061 /*! \brief Creates the MediaLB Port with its associated port instance identifier.
1062 * \param self Reference to CInic instance
1063 * \param index MediaLB Port instance
1064 * \param clock_config Stores the clock speed configuration. The value is a multiple
1065 * of the MOST network frame rate Fs; this means the MediaLB Port
1066 * can only be frequency locked to the network's system clock.
1067 * \param obs_ptr Reference to an optional observer
1068 * \return UCS_RET_SUCCESS message was created
1069 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1070 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1072 Ucs_Return_t Inic_MlbPortCreate(CInic *self,
1074 Ucs_Mlb_ClockConfig_t clock_config,
1075 CSingleObserver *obs_ptr)
1077 Ucs_Return_t result = UCS_RET_SUCCESS;
1079 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1081 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
1083 if (msg_ptr != NULL)
1085 msg_ptr->destination_addr = self->target_address;
1087 msg_ptr->id.fblock_id = FB_INIC;
1088 msg_ptr->id.instance_id = 0U;
1089 msg_ptr->id.function_id = INIC_FID_MLB_PORT_CREATE;
1090 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1092 msg_ptr->tel.tel_data_ptr[0] = index;
1093 msg_ptr->tel.tel_data_ptr[1] = (uint8_t)clock_config;
1095 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1096 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1097 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1099 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1103 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1104 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1109 result = UCS_RET_ERR_API_LOCKED;
1115 /*! \brief Creates a MediaLB socket bound to the MediaLB Port with the associated port instance
1116 * identifier. If INIC enters Protected Mode, the MediaLB socket will be automatically
1118 * \param self Reference to CInic instance
1119 * \param mlb_port_handle MediaLB Port resource handle
1120 * \param direction Indicates the direction of the data stream from the perspective of
1122 * \param data_type Specifies the data type
1123 * \param bandwidth Required socket bandwidth in bytes
1124 * \param channel_address Indicates the MediaLB ChannelAddress where the socket is mapped to.
1125 * If the MediaLB Port is created by default, ChannelAddresses 0x0002
1126 * and 0x0004 are reserved and cannot be used.
1127 * \param obs_ptr Reference to an optional observer
1128 * \return UCS_RET_SUCCESS message was created
1129 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1130 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1132 Ucs_Return_t Inic_MlbSocketCreate(CInic *self,
1133 uint16_t mlb_port_handle,
1134 Ucs_SocketDirection_t direction,
1135 Ucs_Mlb_SocketDataType_t data_type,
1137 uint16_t channel_address,
1138 CSingleObserver *obs_ptr)
1140 Ucs_Return_t result = UCS_RET_SUCCESS;
1142 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1144 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 8U);
1146 if (msg_ptr != NULL)
1148 msg_ptr->destination_addr = self->target_address;
1150 msg_ptr->id.fblock_id = FB_INIC;
1151 msg_ptr->id.instance_id = 0U;
1152 msg_ptr->id.function_id = INIC_FID_MLB_SOCKET_CREATE;
1153 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1155 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(mlb_port_handle);
1156 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(mlb_port_handle);
1157 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)direction;
1158 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)data_type;
1159 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(bandwidth);
1160 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(bandwidth);
1161 msg_ptr->tel.tel_data_ptr[6] = MISC_HB(channel_address);
1162 msg_ptr->tel.tel_data_ptr[7] = MISC_LB(channel_address);
1164 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1165 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1166 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1168 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1172 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1173 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1178 result = UCS_RET_ERR_API_LOCKED;
1184 /*! \brief Creates the USB Port with its associated port instance identifier. The instance
1185 * identifier of an USB Port is always directly bound to a specific hardware port.
1186 * \param self Reference to CInic instance
1187 * \param index USB Port instance
1188 * \param physical_layer USB Port physical layer
1189 * \param devices_interfaces USB Interfaces supported by the device
1190 * \param streaming_if_ep_out_count number of USB OUT Endpoints being provided through the USB streaming interface
1191 * \param streaming_if_ep_in_count number of USB IN Endpoints being provided through the USB Streaming interface
1192 * \param obs_ptr Reference to an optional observer
1193 * \return UCS_RET_SUCCESS message was created
1194 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1195 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1197 Ucs_Return_t Inic_UsbPortCreate(CInic *self,
1199 Ucs_Usb_PhysicalLayer_t physical_layer,
1200 uint16_t devices_interfaces,
1201 uint8_t streaming_if_ep_out_count,
1202 uint8_t streaming_if_ep_in_count,
1203 CSingleObserver *obs_ptr)
1205 Ucs_Return_t result = UCS_RET_SUCCESS;
1207 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1209 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
1211 if (msg_ptr != NULL)
1213 msg_ptr->destination_addr = self->target_address;
1215 msg_ptr->id.fblock_id = FB_INIC;
1216 msg_ptr->id.instance_id = 0U;
1217 msg_ptr->id.function_id = INIC_FID_USB_PORT_CREATE;
1218 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1220 msg_ptr->tel.tel_data_ptr[0] = index;
1221 msg_ptr->tel.tel_data_ptr[1] = (uint8_t)physical_layer;
1222 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(devices_interfaces);
1223 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(devices_interfaces);
1224 msg_ptr->tel.tel_data_ptr[4] = streaming_if_ep_out_count;
1225 msg_ptr->tel.tel_data_ptr[5] = streaming_if_ep_in_count;
1227 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1228 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1229 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1231 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1235 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1236 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1241 result = UCS_RET_ERR_API_LOCKED;
1247 /*! \brief Creates a USB socket bound to the USB port with its associated port instance identifier.
1248 * If INIC enters Protected Mode, the USB socket will be automatically destroyed.
1249 * \param self Reference to CInic instance
1250 * \param usb_port_handle USB Port resource handle
1251 * \param direction Indicates the direction of the data stream from the perspective of
1253 * \param data_type Specifies the data type
1254 * \param end_point_addr Denotes the address of a USB endpoint as per its description in the
1255 * USB 2.0 Specification
1256 * \param frames_per_transfer Indicates the number of MOST frames per transfer per one USB
1258 * \param obs_ptr Reference to an optional observer
1259 * \return UCS_RET_SUCCESS message was created
1260 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1261 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1263 Ucs_Return_t Inic_UsbSocketCreate(CInic *self,
1264 uint16_t usb_port_handle,
1265 Ucs_SocketDirection_t direction,
1266 Ucs_Usb_SocketDataType_t data_type,
1267 uint8_t end_point_addr,
1268 uint16_t frames_per_transfer,
1269 CSingleObserver *obs_ptr)
1271 Ucs_Return_t result = UCS_RET_SUCCESS;
1273 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1275 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 7U);
1277 if (msg_ptr != NULL)
1279 msg_ptr->destination_addr = self->target_address;
1281 msg_ptr->id.fblock_id = FB_INIC;
1282 msg_ptr->id.instance_id = 0U;
1283 msg_ptr->id.function_id = INIC_FID_USB_SOCKET_CREATE;
1284 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1286 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(usb_port_handle);
1287 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(usb_port_handle);
1288 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)direction;
1289 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)data_type;
1290 msg_ptr->tel.tel_data_ptr[4] = end_point_addr;
1291 msg_ptr->tel.tel_data_ptr[5] = MISC_HB(frames_per_transfer);
1292 msg_ptr->tel.tel_data_ptr[6] = MISC_LB(frames_per_transfer);
1294 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1295 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1296 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1298 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1302 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1303 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1308 result = UCS_RET_ERR_API_LOCKED;
1314 /*! \brief This function is used to configure the Streaming Ports.
1315 * \param self Reference to CInic instance
1316 * \param index Streaming Port instance
1317 * \param op_mode Streaming Port Operation mode
1318 * \param port_option Streaming Port Options
1319 * \param clock_mode Stream Port Clock Mode
1320 * \param clock_data_delay Stream Port Clock Data Delay
1321 * \param obs_ptr Reference to an optional observer
1322 * \return UCS_RET_SUCCESS message was created
1323 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1325 Ucs_Return_t Inic_StreamPortConfig_SetGet(CInic *self,
1327 Ucs_Stream_PortOpMode_t op_mode,
1328 Ucs_Stream_PortOption_t port_option,
1329 Ucs_Stream_PortClockMode_t clock_mode,
1330 Ucs_Stream_PortClockDataDelay_t clock_data_delay,
1331 CSingleObserver *obs_ptr)
1333 Ucs_Return_t result = UCS_RET_SUCCESS;
1335 if(Al_Lock(&self->lock.res_api, INIC_API_STREAM_PORT_CONFIG) != false)
1337 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 5U);
1339 if (msg_ptr != NULL)
1341 msg_ptr->destination_addr = self->target_address;
1342 msg_ptr->id.fblock_id = FB_INIC;
1343 msg_ptr->id.instance_id = 0U;
1344 msg_ptr->id.function_id = INIC_FID_STREAM_PORT_CONFIG;
1345 msg_ptr->id.op_type = UCS_OP_SETGET;
1347 msg_ptr->tel.tel_data_ptr[0] = (uint8_t)index;
1348 msg_ptr->tel.tel_data_ptr[1] = (uint8_t)op_mode;
1349 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)port_option;
1350 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)clock_mode;
1351 msg_ptr->tel.tel_data_ptr[4] = (uint8_t)clock_data_delay;
1353 self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG].user_mask = INIC_API_STREAM_PORT_CONFIG;
1354 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG];
1355 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1357 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG], obs_ptr);
1361 Al_Release(&self->lock.res_api, INIC_API_STREAM_PORT_CONFIG);
1362 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1367 result = UCS_RET_ERR_API_LOCKED;
1373 /*! \brief This function is used to request the configurations of the Streaming Ports.
1374 * \param self Reference to CInic instance
1375 * \param index Streaming Port Instance ID
1376 * \param obs_ptr Reference to an optional observer
1377 * \return UCS_RET_SUCCESS message was created
1378 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1379 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1381 Ucs_Return_t Inic_StreamPortConfig_Get(CInic *self,
1383 CSingleObserver *obs_ptr)
1385 Ucs_Return_t result = UCS_RET_SUCCESS;
1387 if(Al_Lock(&self->lock.res_api, INIC_API_STREAM_PORT_CONFIG) != false)
1389 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 1U);
1391 if (msg_ptr != NULL)
1393 msg_ptr->destination_addr = self->target_address;
1395 msg_ptr->id.fblock_id = FB_INIC;
1396 msg_ptr->id.instance_id = 0U;
1397 msg_ptr->id.function_id = INIC_FID_STREAM_PORT_CONFIG;
1398 msg_ptr->id.op_type = UCS_OP_GET;
1400 msg_ptr->tel.tel_data_ptr[0] = (uint8_t)index;
1402 self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG].user_mask = INIC_API_STREAM_PORT_CONFIG;
1403 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG];
1404 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1406 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_STREAM_PORT_CONFIG], obs_ptr);
1410 Al_Release(&self->lock.res_api, INIC_API_STREAM_PORT_CONFIG);
1411 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1416 result = UCS_RET_ERR_API_LOCKED;
1422 /*! \brief This function creates the Streaming Port with its associated port instance identifier.
1423 * \param self Reference to CInic instance
1424 * \param index Streaming Port instance
1425 * \param clock_config Clock speed configuration of the SCK signal
1426 * \param data_alignment Defines the alignment of the data bytes within the streaming port frame
1427 * \param obs_ptr Reference to an optional observer
1428 * \return UCS_RET_SUCCESS message was created
1429 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1430 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1432 Ucs_Return_t Inic_StreamPortCreate(CInic *self,
1434 Ucs_Stream_PortClockConfig_t clock_config,
1435 Ucs_Stream_PortDataAlign_t data_alignment,
1436 CSingleObserver *obs_ptr)
1438 Ucs_Return_t result = UCS_RET_SUCCESS;
1440 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1442 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 3U);
1444 if (msg_ptr != NULL)
1446 msg_ptr->destination_addr = self->target_address;
1448 msg_ptr->id.fblock_id = FB_INIC;
1449 msg_ptr->id.instance_id = 0U;
1450 msg_ptr->id.function_id = INIC_FID_STREAM_PORT_CREATE;
1451 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1453 msg_ptr->tel.tel_data_ptr[0] = index;
1454 msg_ptr->tel.tel_data_ptr[1] = (uint8_t)clock_config;
1455 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)data_alignment;
1457 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1458 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1459 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1461 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1465 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1466 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1471 result = UCS_RET_ERR_API_LOCKED;
1477 /*! \brief This function creates a Synchronous or DiscreteFrame Isochronous Streaming data socket
1478 * bound to the Streaming Port with the denoted port instance identifier.
1479 * \param self Reference to CInic instance
1480 * \param stream_port_handle Streaming Port resource handle
1481 * \param direction Indicates the direction of the data stream, from the INIC's
1483 * \param data_type Specifies the data type
1484 * \param bandwidth Required socket bandwidth in bytes
1485 * \param stream_pin_id ID of the serial interface pin of the addressed Streaming Port
1487 * \param obs_ptr Reference to an optional observer
1488 * \return UCS_RET_SUCCESS message was created
1489 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1490 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1492 Ucs_Return_t Inic_StreamSocketCreate(CInic *self,
1493 uint16_t stream_port_handle,
1494 Ucs_SocketDirection_t direction,
1495 Ucs_Stream_SocketDataType_t data_type,
1497 Ucs_Stream_PortPinId_t stream_pin_id,
1498 CSingleObserver *obs_ptr)
1500 Ucs_Return_t result = UCS_RET_SUCCESS;
1502 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1504 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 7U);
1506 if (msg_ptr != NULL)
1508 msg_ptr->destination_addr = self->target_address;
1510 msg_ptr->id.fblock_id = FB_INIC;
1511 msg_ptr->id.instance_id = 0U;
1512 msg_ptr->id.function_id = INIC_FID_STREAM_SOCKET_CREATE;
1513 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1515 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(stream_port_handle);
1516 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(stream_port_handle);
1517 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)direction;
1518 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)data_type;
1519 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(bandwidth);
1520 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(bandwidth);
1521 msg_ptr->tel.tel_data_ptr[6] = (uint8_t)stream_pin_id;
1523 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1524 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1525 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1527 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1531 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1532 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1537 result = UCS_RET_ERR_API_LOCKED;
1543 /*! \brief This function creates an RMCK Port with its associated port instance identifier.
1544 * \param self Reference to CInic instance
1545 * \param index RMCK Port instance
1546 * \param clock_source Indicates the source of the RMCK clock
1547 * \param divisor Divisor of the clock source
1548 * \param obs_ptr Reference to an optional observer
1549 * \return UCS_RET_SUCCESS message was created
1550 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1551 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1553 Ucs_Return_t Inic_RmckPortCreate(CInic *self,
1555 Ucs_Rmck_PortClockSource_t clock_source,
1557 CSingleObserver *obs_ptr)
1559 Ucs_Return_t result = UCS_RET_SUCCESS;
1561 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1563 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
1565 if (msg_ptr != NULL)
1567 msg_ptr->destination_addr = self->target_address;
1569 msg_ptr->id.fblock_id = FB_INIC;
1570 msg_ptr->id.instance_id = 0U;
1571 msg_ptr->id.function_id = INIC_FID_RMCK_PORT_CREATE;
1572 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1574 msg_ptr->tel.tel_data_ptr[0] = index;
1575 msg_ptr->tel.tel_data_ptr[1] = (uint8_t)clock_source;
1576 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(divisor);
1577 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(divisor);
1579 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1580 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1581 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1583 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1587 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1588 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1593 result = UCS_RET_ERR_API_LOCKED;
1599 /*! \brief This function creates an I2C Port with its associated port instance identifier.
1600 * \param self Reference to CInic instance
1601 * \param index I2C Port instance
1602 * \param address The 7-bit I2C slave address of the peripheral to be read.
1603 * \param mode The operation mode of the I2C Port
1604 * \param speed The speed grade of the I2C Port
1605 * \param obs_ptr Reference to an optional observer
1606 * \return UCS_RET_SUCCESS message was created
1607 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1608 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1610 Ucs_Return_t Inic_I2cPortCreate(CInic *self,
1614 Ucs_I2c_Speed_t speed,
1615 CSingleObserver *obs_ptr)
1617 Ucs_Return_t result = UCS_RET_SUCCESS;
1619 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1621 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
1623 if (msg_ptr != NULL)
1625 msg_ptr->destination_addr = self->target_address;
1627 msg_ptr->id.fblock_id = FB_INIC;
1628 msg_ptr->id.instance_id = 0U;
1629 msg_ptr->id.function_id = INIC_FID_I2C_PORT_CREATE;
1630 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1632 msg_ptr->tel.tel_data_ptr[0] = index;
1633 msg_ptr->tel.tel_data_ptr[1] = address;
1634 msg_ptr->tel.tel_data_ptr[2] = mode;
1635 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)speed;
1637 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1638 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1639 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1641 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1645 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1646 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1651 result = UCS_RET_ERR_API_LOCKED;
1657 /*! \brief This function reads a block of bytes from an I2C device at a specified I2C address.
1658 * \param self Reference to CInic instance
1659 * \param port_handle Port resource handle
1660 * \param slave_address The 7-bit I2C slave address of the peripheral to be read
1661 * \param data_len Number of bytes to be read from the address
1662 * \param timeout The timeout for the I2C Port read
1663 * \param obs_ptr Reference to an optional observer
1664 * \return UCS_RET_SUCCESS message was created
1665 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1666 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1668 Ucs_Return_t Inic_I2cPortRead(CInic *self,
1669 uint16_t port_handle,
1670 uint8_t slave_address,
1673 CSingleObserver *obs_ptr)
1675 Ucs_Return_t result = UCS_RET_SUCCESS;
1677 if(Al_Lock(&self->lock.res_api, INIC_API_I2C_PORT_WR) != false)
1679 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
1681 if (msg_ptr != NULL)
1683 msg_ptr->destination_addr = self->target_address;
1685 msg_ptr->id.fblock_id = FB_INIC;
1686 msg_ptr->id.instance_id = 0U;
1687 msg_ptr->id.function_id = INIC_FID_I2C_PORT_READ;
1688 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1690 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(port_handle);
1691 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(port_handle);
1692 msg_ptr->tel.tel_data_ptr[2] = slave_address;
1693 msg_ptr->tel.tel_data_ptr[3] = data_len;
1694 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(timeout);
1695 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(timeout);
1697 self->ssubs[INIC_SSUB_I2C_PORT_WR].user_mask = INIC_API_I2C_PORT_WR;
1698 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_I2C_PORT_WR];
1699 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1701 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_I2C_PORT_WR], obs_ptr);
1705 Al_Release(&self->lock.res_api, INIC_API_I2C_PORT_WR);
1706 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1711 result = UCS_RET_ERR_API_LOCKED;
1717 /*! \brief This function writes a block of bytes to an I2C device at a specified I2C address.
1718 * \param self Reference to CInic instance
1719 * \param port_handle Port resource handle
1720 * \param mode The write transfer mode
1721 * \param block_count The number of blocks to be written to the I2C address.
1722 * \param slave_address The 7-bit I2C slave address of the peripheral to be read
1723 * \param timeout The timeout for the I2C Port write
1724 * \param data_len Number of bytes to be written to the addressed I2C peripheral
1725 * \param data_list Reference to the data list to be written
1726 * \param obs_ptr Reference to an optional observer
1727 * \return UCS_RET_SUCCESS message was created
1728 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1729 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1731 Ucs_Return_t Inic_I2cPortWrite(CInic *self,
1732 uint16_t port_handle,
1733 Ucs_I2c_TrMode_t mode,
1734 uint8_t block_count,
1735 uint8_t slave_address,
1738 uint8_t data_list[],
1739 CSingleObserver *obs_ptr)
1741 Ucs_Return_t result = UCS_RET_SUCCESS;
1743 if(Al_Lock(&self->lock.res_api, INIC_API_I2C_PORT_WR) != false)
1746 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, (8U + data_len));
1748 if (msg_ptr != NULL)
1750 msg_ptr->destination_addr = self->target_address;
1752 msg_ptr->id.fblock_id = FB_INIC;
1753 msg_ptr->id.instance_id = 0U;
1754 msg_ptr->id.function_id = INIC_FID_I2C_PORT_WRITE;
1755 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1757 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(port_handle);
1758 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(port_handle);
1759 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)mode;
1760 msg_ptr->tel.tel_data_ptr[3] = block_count;
1761 msg_ptr->tel.tel_data_ptr[4] = slave_address;
1762 msg_ptr->tel.tel_data_ptr[5] = (mode == UCS_I2C_BURST_MODE) ? (data_len/block_count):data_len;
1763 msg_ptr->tel.tel_data_ptr[6] = MISC_HB(timeout);
1764 msg_ptr->tel.tel_data_ptr[7] = MISC_LB(timeout);
1766 if (data_list != NULL)
1768 for (i = 0U; i < data_len; i++)
1770 msg_ptr->tel.tel_data_ptr[8U + i] = data_list[i];
1774 self->ssubs[INIC_SSUB_I2C_PORT_WR].user_mask = INIC_API_I2C_PORT_WR;
1775 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_I2C_PORT_WR];
1776 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1778 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_I2C_PORT_WR], obs_ptr);
1782 Al_Release(&self->lock.res_api, INIC_API_I2C_PORT_WR);
1783 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1788 result = UCS_RET_ERR_API_LOCKED;
1794 /*! \brief This function creates an PCIe Port with its associated port instance identifier.
1795 * \param self Reference to CInic instance
1796 * \param index PCIe Port instance
1797 * \param obs_ptr Reference to an optional observer
1798 * \return UCS_RET_SUCCESS message was created
1799 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1800 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1802 Ucs_Return_t Inic_PciPortCreate(CInic *self,
1804 CSingleObserver *obs_ptr)
1806 Ucs_Return_t result = UCS_RET_SUCCESS;
1808 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1810 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 1U);
1812 if (msg_ptr != NULL)
1814 msg_ptr->destination_addr = self->target_address;
1816 msg_ptr->id.fblock_id = FB_INIC;
1817 msg_ptr->id.instance_id = 0U;
1818 msg_ptr->id.function_id = INIC_FID_PCI_PORT_CREATE;
1819 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1821 msg_ptr->tel.tel_data_ptr[0] = index;
1823 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1824 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1825 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1827 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1831 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1832 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1837 result = UCS_RET_ERR_API_LOCKED;
1843 /*! \brief This function creates a PCIe socket bound to the PCIe Port with the associated port
1844 * instance identifier. If the EHC detaches, the PCIe socket will be automatically
1846 * \param self Reference to CInic instance
1847 * \param pci_port_handle PCIe Port resource handle
1848 * \param direction Indicates the direction of the data stream from the perspective of
1850 * \param data_type Specifies the data type
1851 * \param dma_channel Specifies the DMA channel
1852 * \param obs_ptr Reference to an optional observer
1853 * \return UCS_RET_SUCCESS message was created
1854 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1855 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1857 Ucs_Return_t Inic_PciSocketCreate(CInic *self,
1858 uint16_t pci_port_handle,
1859 Ucs_SocketDirection_t direction,
1860 Ucs_Pci_SocketDataType_t data_type,
1861 uint8_t dma_channel,
1862 CSingleObserver *obs_ptr)
1864 Ucs_Return_t result = UCS_RET_SUCCESS;
1866 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1868 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 5U);
1870 if (msg_ptr != NULL)
1872 msg_ptr->destination_addr = self->target_address;
1874 msg_ptr->id.fblock_id = FB_INIC;
1875 msg_ptr->id.instance_id = 0U;
1876 msg_ptr->id.function_id = INIC_FID_PCI_SOCKET_CREATE;
1877 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1879 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(pci_port_handle);
1880 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(pci_port_handle);
1881 msg_ptr->tel.tel_data_ptr[2] = (uint8_t)direction;
1882 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)data_type;
1883 msg_ptr->tel.tel_data_ptr[4] = dma_channel;
1885 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1886 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1887 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1889 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1893 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1894 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1899 result = UCS_RET_ERR_API_LOCKED;
1905 /*! \brief This function creates a GPIO Port with its associated port instance identifier.
1906 * \param self Reference to CInic instance
1907 * \param gpio_port_index GPIO Port instance
1908 * \param debounce_time Timeout for the GPIO debounce timer
1909 * \param obs_ptr Reference to an optional observer
1910 * \return UCS_RET_SUCCESS message was created
1911 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1912 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1914 Ucs_Return_t Inic_GpioPortCreate(CInic *self,
1915 uint8_t gpio_port_index,
1916 uint16_t debounce_time,
1917 CSingleObserver *obs_ptr)
1919 Ucs_Return_t result = UCS_RET_SUCCESS;
1921 if(Al_Lock(&self->lock.res_api, INIC_API_CREATE_CLASS) != false)
1923 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 3U);
1925 if (msg_ptr != NULL)
1927 msg_ptr->destination_addr = self->target_address;
1929 msg_ptr->id.fblock_id = FB_INIC;
1930 msg_ptr->id.instance_id = 0U;
1931 msg_ptr->id.function_id = INIC_FID_GPIO_PORT_CREATE;
1932 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1934 msg_ptr->tel.tel_data_ptr[0] = gpio_port_index;
1935 msg_ptr->tel.tel_data_ptr[1] = MISC_HB(debounce_time);
1936 msg_ptr->tel.tel_data_ptr[2] = MISC_LB(debounce_time);
1938 self->ssubs[INIC_SSUB_CREATE_CLASS].user_mask = INIC_API_CREATE_CLASS;
1939 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_CREATE_CLASS];
1940 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1942 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_CREATE_CLASS], obs_ptr);
1946 Al_Release(&self->lock.res_api, INIC_API_CREATE_CLASS);
1947 result = UCS_RET_ERR_BUFFER_OVERFLOW;
1952 result = UCS_RET_ERR_API_LOCKED;
1958 /*! \brief This function enables or disables a specific MOST Network Port.
1959 * \param self Reference to CInic instance
1960 * \param most_port_handle Port resource handle
1961 * \param enabled Indicates whether a MOST Network Port should be enabled or disabled
1962 * \param obs_ptr Reference to an optional observer
1963 * \return UCS_RET_SUCCESS message was created
1964 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
1965 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
1967 Ucs_Return_t Inic_MostPortEnable(CInic *self,
1968 uint16_t most_port_handle,
1970 CSingleObserver *obs_ptr)
1972 Ucs_Return_t result = UCS_RET_SUCCESS;
1974 if(Al_Lock(&self->lock.res_api, INIC_API_MOST_PORT_ENABLE) != false)
1976 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 3U);
1978 if (msg_ptr != NULL)
1980 msg_ptr->destination_addr = self->target_address;
1982 msg_ptr->id.fblock_id = FB_INIC;
1983 msg_ptr->id.instance_id = 0U;
1984 msg_ptr->id.function_id = INIC_FID_MOST_PORT_ENABLE;
1985 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
1987 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(most_port_handle);
1988 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(most_port_handle);
1989 msg_ptr->tel.tel_data_ptr[2] = (enabled != false) ? 1U : 0U;
1991 self->ssubs[INIC_SSUB_MOST_PORT_ENABLE].user_mask = INIC_API_MOST_PORT_ENABLE;
1992 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_MOST_PORT_ENABLE];
1993 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
1995 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_MOST_PORT_ENABLE], obs_ptr);
1999 Al_Release(&self->lock.res_api, INIC_API_MOST_PORT_ENABLE);
2000 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2005 result = UCS_RET_ERR_API_LOCKED;
2011 /*! \brief This function retrieves the current pin mode of the given GPIO Port.
2012 * \param self Reference to CInic instance
2013 * \param gpio_handle GPIO Port instance
2014 * \param obs_ptr Reference to an optional observer
2015 * \return UCS_RET_SUCCESS message was created
2016 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2017 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
2019 Ucs_Return_t Inic_GpioPortPinMode_Get(CInic *self, uint16_t gpio_handle, CSingleObserver *obs_ptr)
2021 Ucs_Return_t result = UCS_RET_SUCCESS;
2023 if(Al_Lock(&self->lock.res_api, INIC_API_GPIO_PIN_MODE) != false)
2025 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
2027 if (msg_ptr != NULL)
2029 msg_ptr->destination_addr = self->target_address;
2031 msg_ptr->id.fblock_id = FB_INIC;
2032 msg_ptr->id.instance_id = 0U;
2033 msg_ptr->id.function_id = INIC_FID_GPIO_PORT_PIN_MODE;
2034 msg_ptr->id.op_type = UCS_OP_GET;
2036 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(gpio_handle);
2037 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(gpio_handle);
2039 self->ssubs[INIC_SSUB_GPIO_PIN_MODE].user_mask = INIC_API_GPIO_PIN_MODE;
2040 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_GPIO_PIN_MODE];
2041 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2043 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_GPIO_PIN_MODE], obs_ptr);
2047 Al_Release(&self->lock.res_api, INIC_API_GPIO_PIN_MODE);
2048 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2053 result = UCS_RET_ERR_API_LOCKED;
2059 /*! \brief This function sets and retrieves the mode of a pin on the GPIO Port
2060 * \param self Reference to CInic instance
2061 * \param gpio_handle GPIO Port instance
2062 * \param pin The GPIO pin that is to be configured
2063 * \param mode The mode of the GPIO pin
2064 * \param obs_ptr Reference to an optional observer
2065 * \return UCS_RET_SUCCESS message was created
2066 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2067 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
2069 Ucs_Return_t Inic_GpioPortPinMode_SetGet(CInic *self, uint16_t gpio_handle, uint8_t pin, Ucs_Gpio_PinMode_t mode, CSingleObserver *obs_ptr)
2071 Ucs_Return_t result = UCS_RET_SUCCESS;
2073 if(Al_Lock(&self->lock.res_api, INIC_API_GPIO_PIN_MODE) != false)
2075 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 4U);
2077 if (msg_ptr != NULL)
2079 msg_ptr->destination_addr = self->target_address;
2081 msg_ptr->id.fblock_id = FB_INIC;
2082 msg_ptr->id.instance_id = 0U;
2083 msg_ptr->id.function_id = INIC_FID_GPIO_PORT_PIN_MODE;
2084 msg_ptr->id.op_type = UCS_OP_SETGET;
2086 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(gpio_handle);
2087 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(gpio_handle);
2088 msg_ptr->tel.tel_data_ptr[2] = pin;
2089 msg_ptr->tel.tel_data_ptr[3] = (uint8_t)mode;
2091 self->ssubs[INIC_SSUB_GPIO_PIN_MODE].user_mask = INIC_API_GPIO_PIN_MODE;
2092 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_GPIO_PIN_MODE];
2093 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2095 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_GPIO_PIN_MODE], obs_ptr);
2099 Al_Release(&self->lock.res_api, INIC_API_GPIO_PIN_MODE);
2100 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2105 result = UCS_RET_ERR_API_LOCKED;
2111 /*! \brief This function retrieves the pin state of the given GPIO Port.
2112 * \param self Reference to CInic instance
2113 * \param gpio_handle GPIO Port instance
2114 * \param obs_ptr Reference to an optional observer
2115 * \return UCS_RET_SUCCESS message was created
2116 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2117 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
2119 Ucs_Return_t Inic_GpioPortPinState_Get(CInic *self, uint16_t gpio_handle, CSingleObserver *obs_ptr)
2121 Ucs_Return_t result = UCS_RET_SUCCESS;
2123 if(Al_Lock(&self->lock.res_api, INIC_API_GPIO_PIN_STATE) != false)
2125 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 2U);
2127 if (msg_ptr != NULL)
2129 msg_ptr->destination_addr = self->target_address;
2131 msg_ptr->id.fblock_id = FB_INIC;
2132 msg_ptr->id.instance_id = 0U;
2133 msg_ptr->id.function_id = INIC_FID_GPIO_PORT_PIN_STATE;
2134 msg_ptr->id.op_type = UCS_OP_GET;
2136 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(gpio_handle);
2137 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(gpio_handle);
2139 self->ssubs[INIC_SSUB_GPIO_PIN_STATE].user_mask = INIC_API_GPIO_PIN_STATE;
2140 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_GPIO_PIN_STATE];
2141 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2143 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_GPIO_PIN_STATE], obs_ptr);
2147 Al_Release(&self->lock.res_api, INIC_API_GPIO_PIN_STATE);
2148 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2153 result = UCS_RET_ERR_API_LOCKED;
2159 /*! \brief This function sets and retrieves the state of a pin on the GPIO Port
2160 * \param self Reference to CInic instance
2161 * \param gpio_handle GPIO Port instance
2162 * \param mask The GPIO pins to be written
2163 * \param data The state of the GPIO pins to be written
2164 * \param obs_ptr Reference to an optional observer
2165 * \return UCS_RET_SUCCESS message was created
2166 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2167 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
2169 Ucs_Return_t Inic_GpioPortPinState_SetGet(CInic *self, uint16_t gpio_handle, uint16_t mask, uint16_t data, CSingleObserver *obs_ptr)
2171 Ucs_Return_t result = UCS_RET_SUCCESS;
2173 if(Al_Lock(&self->lock.res_api, INIC_API_GPIO_PIN_STATE) != false)
2175 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 6U);
2177 if (msg_ptr != NULL)
2179 msg_ptr->destination_addr = self->target_address;
2181 msg_ptr->id.fblock_id = FB_INIC;
2182 msg_ptr->id.instance_id = 0U;
2183 msg_ptr->id.function_id = INIC_FID_GPIO_PORT_PIN_STATE;
2184 msg_ptr->id.op_type = UCS_OP_SETGET;
2186 msg_ptr->tel.tel_data_ptr[0] = MISC_HB(gpio_handle);
2187 msg_ptr->tel.tel_data_ptr[1] = MISC_LB(gpio_handle);
2188 msg_ptr->tel.tel_data_ptr[2] = MISC_HB(mask);
2189 msg_ptr->tel.tel_data_ptr[3] = MISC_LB(mask);
2190 msg_ptr->tel.tel_data_ptr[4] = MISC_HB(data);
2191 msg_ptr->tel.tel_data_ptr[5] = MISC_LB(data);
2193 self->ssubs[INIC_SSUB_GPIO_PIN_STATE].user_mask = INIC_API_GPIO_PIN_STATE;
2194 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_GPIO_PIN_STATE];
2195 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2197 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_GPIO_PIN_STATE], obs_ptr);
2201 Al_Release(&self->lock.res_api, INIC_API_GPIO_PIN_STATE);
2202 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2207 result = UCS_RET_ERR_API_LOCKED;
2213 /*! \brief This function enables full streaming for a specific MOST Network Port.
2214 * \param self Reference to CInic instance
2215 * \param most_port_handle Port resource handle
2216 * \param enabled Indicates whether full streaming is enabled or disabled
2217 * \param obs_ptr Reference to an optional observer
2218 * \return UCS_RET_SUCCESS message was created
2219 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2220 * \return UCS_RET_ERR_API_LOCKED Resource API is already used by another command
2222 Ucs_Return_t Inic_MostPortEnFullStr(CInic *self,
2223 uint16_t most_port_handle,
2225 CSingleObserver *obs_ptr)
2228 MISC_UNUSED(most_port_handle);
2229 MISC_UNUSED(enabled);
2230 MISC_UNUSED(obs_ptr);
2232 return UCS_RET_ERR_NOT_SUPPORTED;
2235 /*! \brief Allows remote synchronization of the given device
2236 * \param self Reference to CInic instance
2237 * \param obs_ptr Reference to an optional observer
2238 * \return UCS_RET_SUCCESS message was created
2239 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2241 Ucs_Return_t Inic_DeviceSync(CInic *self, CSingleObserver *obs_ptr)
2243 Ucs_Return_t result = UCS_RET_SUCCESS;
2245 if(Al_Lock(&self->lock.res_api, INIC_API_DEVICE_SYNC) != false)
2247 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 1U);
2249 if (msg_ptr != NULL)
2251 msg_ptr->destination_addr = self->target_address;
2253 msg_ptr->id.fblock_id = FB_INIC;
2254 msg_ptr->id.instance_id = 0U;
2255 msg_ptr->id.function_id = INIC_FID_DEVICE_SYNC;
2256 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
2258 msg_ptr->tel.tel_data_ptr[0] = 0x01U;
2260 self->ssubs[INIC_SSUB_DEVICE_SYNC].user_mask = INIC_API_DEVICE_SYNC;
2261 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_DEVICE_SYNC];
2262 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2264 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_DEVICE_SYNC], obs_ptr);
2268 Al_Release(&self->lock.res_api, INIC_API_DEVICE_SYNC);
2269 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2274 result = UCS_RET_ERR_API_LOCKED;
2280 /*! \brief Un-synchronizes to the given remote device
2281 * \param self Reference to CInic instance
2282 * \param obs_ptr Reference to an optional observer
2283 * \return UCS_RET_SUCCESS message was created
2284 * \return UCS_RET_ERR_BUFFER_OVERFLOW no message buffer available
2286 Ucs_Return_t Inic_DeviceUnsync(CInic *self, CSingleObserver *obs_ptr)
2288 Ucs_Return_t result = UCS_RET_SUCCESS;
2289 Msg_MostTel_t *msg_ptr = Trcv_TxAllocateMsg(self->xcvr_ptr, 1U);
2291 if(Al_Lock(&self->lock.res_api, INIC_API_DEVICE_SYNC) != false)
2293 if (msg_ptr != NULL)
2295 msg_ptr->destination_addr = self->target_address;
2297 msg_ptr->id.fblock_id = FB_INIC;
2298 msg_ptr->id.instance_id = 0U;
2299 msg_ptr->id.function_id = INIC_FID_DEVICE_SYNC;
2300 msg_ptr->id.op_type = UCS_OP_STARTRESULT;
2302 msg_ptr->tel.tel_data_ptr[0] = 0U;
2304 self->ssubs[INIC_SSUB_DEVICE_SYNC].user_mask = INIC_API_DEVICE_SYNC;
2305 msg_ptr->info_ptr = &self->ssubs[INIC_SSUB_DEVICE_SYNC];
2306 Trcv_TxSendMsgExt(self->xcvr_ptr, msg_ptr, &Inic_ResMsgTxStatusCb, self);
2308 (void)Ssub_AddObserver(&self->ssubs[INIC_SSUB_DEVICE_SYNC], obs_ptr);
2312 Al_Release(&self->lock.res_api, INIC_API_DEVICE_SYNC);
2313 result = UCS_RET_ERR_BUFFER_OVERFLOW;
2318 result = UCS_RET_ERR_API_LOCKED;
2324 /*------------------------------------------------------------------------------------------------*/
2325 /* Handler functions */
2326 /*------------------------------------------------------------------------------------------------*/
2327 /*! \brief Handle message Tx status, Unlock the API and free the message objects
2328 * \param self The instance
2329 * \param tel_ptr Reference to transmitted message
2330 * \param status Status of the transmitted message
2332 static void Inic_ResMsgTxStatusCb(void *self, Msg_MostTel_t *tel_ptr, Ucs_MsgTxStatus_t status)
2334 CInic *self_ = (CInic *)self;
2335 CSingleSubject *ssub_ptr = (CSingleSubject *)tel_ptr->info_ptr;
2337 if ((status != UCS_MSG_STAT_OK) && (tel_ptr->info_ptr != NULL))
2339 Inic_StdResult_t res_data;
2341 res_data.data_info = &status;
2342 res_data.result.code = UCS_RES_ERR_TRANSMISSION;
2343 res_data.result.info_ptr = NULL;
2344 res_data.result.info_size = 0U;
2345 Ssub_Notify(ssub_ptr, &res_data, true);
2347 if ((ssub_ptr != NULL) && (ssub_ptr->user_mask != 0U))
2349 Al_Release(&self_->lock.res_api, (Alm_ModuleMask_t)ssub_ptr->user_mask);
2352 Trcv_TxReleaseMsg(tel_ptr);
2353 /* Reset user mask of the single subject if available */
2354 if (ssub_ptr != NULL)
2356 ssub_ptr->user_mask = 0U;
2359 /* ICM messages pending? */
2360 if (Sub_GetNumObservers(&self_->subs[INIC_SUB_TX_MSG_OBJ_AVAIL]) > 0U)
2362 Sub_Notify(&self_->subs[INIC_SUB_TX_MSG_OBJ_AVAIL], NULL);
2366 /*! \brief Handler function for INIC.ResourceDestroy.ErrorAck
2367 * \param self reference to INIC object
2368 * \param msg_ptr received message
2370 void Inic_ResourceDestroy_Error(void *self, Msg_MostTel_t *msg_ptr)
2372 CInic *self_ = (CInic *)self;
2373 Inic_StdResult_t res_data;
2374 res_data.data_info = NULL;
2375 res_data.result = Inic_TranslateError(self_,
2376 &msg_ptr->tel.tel_data_ptr[0],
2377 (msg_ptr->tel.tel_len));
2378 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_DESTROY], &res_data, true);
2379 Al_Release(&self_->lock.res_api, INIC_API_RESOURCE_DESTROY);
2382 /*! \brief Handler function for INIC.ResourceDestroy.ResultAck
2383 * \param self reference to INIC object
2384 * \param msg_ptr received message
2386 void Inic_ResourceDestroy_Result(void *self, Msg_MostTel_t *msg_ptr)
2388 CInic *self_ = (CInic *)self;
2389 Inic_StdResult_t res_data;
2390 MISC_UNUSED(msg_ptr);
2392 res_data.data_info = NULL;
2393 res_data.result.code = UCS_RES_SUCCESS;
2394 res_data.result.info_ptr = NULL;
2395 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_DESTROY], &res_data, true);
2396 Al_Release(&self_->lock.res_api, INIC_API_RESOURCE_DESTROY);
2399 /*! \brief Handler function for INIC.ResourceInvalidList.Status
2400 * \param self reference to INIC object
2401 * \param msg_ptr received message
2403 void Inic_ResourceInvalidList_Status(void *self, Msg_MostTel_t *msg_ptr)
2405 CInic *self_ = (CInic *)self;
2406 Inic_StdResult_t res_data;
2407 Inic_ResHandleList_t result;
2409 uint16_t inv_res_handles[22]; /* Max. ICM message size is 45 -> max. 22 16-bit values */
2411 res_data.data_info = &result;
2412 res_data.result.code = UCS_RES_SUCCESS;
2413 res_data.result.info_ptr = NULL;
2415 /* Length of message must be even, since 16-Bit values are transmitted via two 8-bit fields. */
2416 TR_ASSERT(self_->base_ptr->ucs_user_ptr, "[INIC_RES]", ((msg_ptr->tel.tel_len % 2U) == 0U));
2418 for(i=0U; (i < (uint8_t)(msg_ptr->tel.tel_len >> 1)); i++)
2420 MISC_DECODE_WORD(&inv_res_handles[i],
2421 &(msg_ptr->tel.tel_data_ptr[(uint8_t)((uint8_t)i << 1)]));
2423 result.res_handles = &inv_res_handles[0];
2424 result.num_handles = (uint8_t)((uint8_t)msg_ptr->tel.tel_len >> 1);
2425 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST], &res_data, true);
2426 Al_Release(&self_->lock.res_api, INIC_API_RESOURCE_INVAL_LIST);
2429 /*! \brief Handler function for INIC.ResourceInvalidList.Error
2430 * \param self reference to INIC object
2431 * \param msg_ptr received message
2433 void Inic_ResourceInvalidList_Error(void *self, Msg_MostTel_t *msg_ptr)
2435 CInic *self_ = (CInic *)self;
2436 Inic_StdResult_t res_data;
2438 res_data.data_info = NULL;
2439 res_data.result = Inic_TranslateError(self_,
2440 &msg_ptr->tel.tel_data_ptr[0],
2441 msg_ptr->tel.tel_len);
2442 Ssub_Notify(&self_->ssubs[INIC_SSUB_RESOURCE_INVAL_LIST], &res_data, true);
2443 Al_Release(&self_->lock.res_api, INIC_API_RESOURCE_INVAL_LIST);
2446 /*! \brief Handler function for INIC.ResourceMonitor.Status
2447 * \param self reference to INIC object
2448 * \param msg_ptr received message
2450 void Inic_ResourceMonitor_Status(void *self, Msg_MostTel_t *msg_ptr)
2452 CInic *self_ = (CInic *)self;
2453 Inic_StdResult_t res_data;
2454 Ucs_Resource_MonitorState_t state;
2456 res_data.data_info = &state;
2457 res_data.result.code = UCS_RES_SUCCESS;
2458 res_data.result.info_ptr = NULL;
2459 state = (Ucs_Resource_MonitorState_t)msg_ptr->tel.tel_data_ptr[0];
2460 Sub_Notify(&self_->subs[INIC_SUB_RES_MONITOR], &res_data);
2463 /*! \brief Handler function for INIC.ResourceMonitor.Error
2464 * \param self reference to INIC object
2465 * \param msg_ptr received message
2467 void Inic_ResourceMonitor_Error(void *self, Msg_MostTel_t *msg_ptr)
2469 CInic *self_ = (CInic *)self;
2470 Inic_StdResult_t res_data;
2472 res_data.data_info = NULL;
2473 res_data.result = Inic_TranslateError(self_,
2474 &msg_ptr->tel.tel_data_ptr[0],
2475 msg_ptr->tel.tel_len);
2476 Sub_Notify(&self_->subs[INIC_SUB_RES_MONITOR], &res_data);
2479 /*! \brief Handler function for INIC.SyncCreate.ErrorAck
2480 * \param self reference to INIC object
2481 * \param msg_ptr received message
2483 void Inic_SyncCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2485 CInic *self_ = (CInic *)self;
2486 Inic_StdResult_t res_data;
2488 res_data.data_info = NULL;
2489 res_data.result = Inic_TranslateError(self_,
2490 &msg_ptr->tel.tel_data_ptr[0],
2491 (msg_ptr->tel.tel_len));
2492 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2493 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2496 /*! \brief Handler function for INIC.SyncCreate.ResultAck. res_data.data_info points to the
2497 * resource handle of the synchronous connection which was created.
2498 * \param self reference to INIC object
2499 * \param msg_ptr received message
2501 void Inic_SyncCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2503 CInic *self_ = (CInic *)self;
2505 Inic_StdResult_t res_data;
2507 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2508 res_data.data_info = &handle;
2509 res_data.result.code = UCS_RES_SUCCESS;
2510 res_data.result.info_ptr = NULL;
2511 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2512 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2516 /*! \brief Handler function for INIC.SyncMute.ErrorAck
2517 * \param self reference to INIC object
2518 * \param msg_ptr received message
2520 void Inic_SyncMute_Error(void *self, Msg_MostTel_t *msg_ptr)
2522 CInic *self_ = (CInic *)self;
2523 Inic_StdResult_t res_data;
2525 res_data.data_info = NULL;
2526 res_data.result = Inic_TranslateError(self_,
2527 &msg_ptr->tel.tel_data_ptr[0],
2528 (msg_ptr->tel.tel_len));
2529 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_MUTE], &res_data, true);
2530 Al_Release(&self_->lock.res_api, INIC_API_SYNC_MUTE);
2533 /*! \brief Handler function for INIC.SyncMute.ResultAck
2534 * \param self reference to INIC object
2535 * \param msg_ptr received message
2537 void Inic_SyncMute_Result(void *self, Msg_MostTel_t *msg_ptr)
2539 CInic *self_ = (CInic *)self;
2540 Inic_StdResult_t res_data;
2542 MISC_UNUSED(msg_ptr);
2544 res_data.data_info = NULL;
2545 res_data.result.code = UCS_RES_SUCCESS;
2546 res_data.result.info_ptr = NULL;
2547 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_MUTE], &res_data, true);
2548 Al_Release(&self_->lock.res_api, INIC_API_SYNC_MUTE);
2551 /*! \brief Handler function for INIC.SyncDemute.ErrorAck
2552 * \param self reference to INIC object
2553 * \param msg_ptr received message
2555 void Inic_SyncDemute_Error(void *self, Msg_MostTel_t *msg_ptr)
2557 CInic *self_ = (CInic *)self;
2558 Inic_StdResult_t res_data;
2560 res_data.data_info = NULL;
2561 res_data.result = Inic_TranslateError(self_,
2562 &msg_ptr->tel.tel_data_ptr[0],
2563 (msg_ptr->tel.tel_len));
2564 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_DEMUTE], &res_data, true);
2565 Al_Release(&self_->lock.res_api, INIC_API_SYNC_DEMUTE);
2568 /*! \brief Handler function for INIC.SyncDemute.ResultAck
2569 * \param self reference to INIC object
2570 * \param msg_ptr received message
2572 void Inic_SyncDemute_Result(void *self, Msg_MostTel_t *msg_ptr)
2574 CInic *self_ = (CInic *)self;
2575 Inic_StdResult_t res_data;
2577 MISC_UNUSED(msg_ptr);
2579 res_data.data_info = NULL;
2580 res_data.result.code = UCS_RES_SUCCESS;
2581 res_data.result.info_ptr = NULL;
2582 Ssub_Notify(&self_->ssubs[INIC_SSUB_SYNC_DEMUTE], &res_data, true);
2583 Al_Release(&self_->lock.res_api, INIC_API_SYNC_DEMUTE);
2586 /*! \brief Handler function for INIC.DFIPhaseCreate.ErrorAck
2587 * \param self reference to INIC object
2588 * \param msg_ptr received message
2590 void Inic_DfiPhaseCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2592 CInic *self_ = (CInic *)self;
2593 Inic_StdResult_t res_data;
2595 res_data.data_info = NULL;
2596 res_data.result = Inic_TranslateError(self_,
2597 &msg_ptr->tel.tel_data_ptr[0],
2598 (msg_ptr->tel.tel_len));
2599 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2600 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2603 /*! \brief Handler function for INIC.DFIPhaseCreate.ResultAck. res_data.data_info points to the
2604 * resource handle of the DFIPhase streaming phase connection which was created.
2605 * \param self reference to INIC object
2606 * \param msg_ptr received message
2608 void Inic_DfiPhaseCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2610 CInic *self_ = (CInic *)self;
2612 Inic_StdResult_t res_data;
2614 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2615 res_data.data_info = &handle;
2616 res_data.result.code = UCS_RES_SUCCESS;
2617 res_data.result.info_ptr = NULL;
2618 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2619 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2622 /*! \brief Handler function for INIC.CombinerCreate.ErrorAck
2623 * \param self reference to INIC object
2624 * \param msg_ptr received message
2626 void Inic_CombinerCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2628 CInic *self_ = (CInic *)self;
2629 Inic_StdResult_t res_data;
2631 res_data.data_info = NULL;
2632 res_data.result = Inic_TranslateError(self_,
2633 &msg_ptr->tel.tel_data_ptr[0],
2634 (msg_ptr->tel.tel_len));
2635 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2636 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2639 /*! \brief Handler function for INIC.CombinerCreate.ResultAck
2640 * \param self reference to INIC object
2641 * \param msg_ptr received message
2643 void Inic_CombinerCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2645 CInic *self_ = (CInic *)self;
2647 Inic_StdResult_t res_data;
2649 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2650 res_data.data_info = &handle;
2651 res_data.result.code = UCS_RES_SUCCESS;
2652 res_data.result.info_ptr = NULL;
2653 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2654 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2657 /*! \brief Handler function for INIC.SplitterCreate.ErrorAck
2658 * \param self reference to INIC object
2659 * \param msg_ptr received message
2661 void Inic_SplitterCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2663 CInic *self_ = (CInic *)self;
2664 Inic_StdResult_t res_data;
2666 res_data.data_info = NULL;
2667 res_data.result = Inic_TranslateError(self_,
2668 &msg_ptr->tel.tel_data_ptr[0],
2669 (msg_ptr->tel.tel_len));
2670 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2671 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2674 /*! \brief Handler function for INIC.SplitterCreate.ResultAck
2675 * \param self reference to INIC object
2676 * \param msg_ptr received message
2678 void Inic_SplitterCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2680 CInic *self_ = (CInic *)self;
2682 Inic_StdResult_t res_data;
2684 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2685 res_data.data_info = &handle;
2686 res_data.result.code = UCS_RES_SUCCESS;
2687 res_data.result.info_ptr = NULL;
2688 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2689 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2692 /*! \brief Handler function for INIC.QoSCreate.ErrorAck
2693 * \param self reference to INIC object
2694 * \param msg_ptr received message
2696 void Inic_QoSCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2698 CInic *self_ = (CInic *)self;
2699 Inic_StdResult_t res_data;
2701 res_data.data_info = NULL;
2702 res_data.result = Inic_TranslateError(self_,
2703 &msg_ptr->tel.tel_data_ptr[0],
2704 (msg_ptr->tel.tel_len));
2705 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2706 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2709 /*! \brief Handler function for INIC.QoSCreate.ResultAck.res_data.data_info points to the Resource
2710 * handle of the Quality of Service IP Streaming data connection which was created.
2711 * \param self reference to INIC object
2712 * \param msg_ptr received message
2714 void Inic_QoSCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2716 CInic *self_ = (CInic *)self;
2718 Inic_StdResult_t res_data;
2720 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2721 res_data.data_info = &handle;
2722 res_data.result.code = UCS_RES_SUCCESS;
2723 res_data.result.info_ptr = NULL;
2724 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2725 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2728 /*! \brief Handler function for INIC.IPCPacketCreate.ErrorAck
2729 * \param self reference to INIC object
2730 * \param msg_ptr received message
2732 void Inic_IpcCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2734 CInic *self_ = (CInic *)self;
2735 Inic_StdResult_t res_data;
2737 res_data.data_info = NULL;
2738 res_data.result = Inic_TranslateError(self_,
2739 &msg_ptr->tel.tel_data_ptr[0],
2740 (msg_ptr->tel.tel_len));
2741 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2742 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2745 /*! \brief Handler function for INIC.IPCPacketCreate.ResultAck.res_data.data_info points to the resource
2746 * handle of the Inter-Processor Communication packet connection which was created.
2747 * \param self reference to INIC object
2748 * \param msg_ptr received message
2750 void Inic_IpcCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2752 CInic *self_ = (CInic *)self;
2754 Inic_StdResult_t res_data;
2756 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2757 res_data.data_info = &handle;
2758 res_data.result.code = UCS_RES_SUCCESS;
2759 res_data.result.info_ptr = NULL;
2760 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2761 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2764 /*! \brief Handler function for INIC.AVPCreate.ErrorAck
2765 * \param self reference to INIC object
2766 * \param msg_ptr received message
2768 void Inic_AvpCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2770 CInic *self_ = (CInic *)self;
2771 Inic_StdResult_t res_data;
2773 res_data.data_info = NULL;
2774 res_data.result = Inic_TranslateError(self_,
2775 &msg_ptr->tel.tel_data_ptr[0],
2776 (msg_ptr->tel.tel_len));
2777 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2778 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2781 /*! \brief Handler function for INIC.AVPCreate.ResultAck. res_data.data_info points to the Resource
2782 * handle of the A/V Packetized Isochronous Streaming connection which was created.
2783 * \param self reference to INIC object
2784 * \param msg_ptr received message
2786 void Inic_AvpCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2788 CInic *self_ = (CInic *)self;
2790 Inic_StdResult_t res_data;
2792 MISC_DECODE_WORD(&handle, &(msg_ptr->tel.tel_data_ptr[0]));
2793 res_data.data_info = &handle;
2794 res_data.result.code = UCS_RES_SUCCESS;
2795 res_data.result.info_ptr = NULL;
2796 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2797 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2800 /*! \brief Handler function for INIC.MOSTPortStatus.Status
2801 * \param self Reference to CInic instance
2802 * \param msg_ptr Pointer to received message
2804 void Inic_MostPortStatus_Status(void *self, Msg_MostTel_t *msg_ptr)
2806 CInic *self_ = (CInic *)self;
2807 Inic_MostPortStatus_t result;
2809 MISC_DECODE_WORD(&(result.most_port_handle), &(msg_ptr->tel.tel_data_ptr[0]));
2810 result.availability = (Ucs_Most_PortAvail_t)msg_ptr->tel.tel_data_ptr[2];
2811 result.avail_info = (Ucs_Most_PortAvailInfo_t)msg_ptr->tel.tel_data_ptr[3];
2812 result.fullstreaming_enabled = (msg_ptr->tel.tel_data_ptr[4] != 0U) ? true : false;
2813 MISC_DECODE_WORD(&(result.freestreaming_bw), &(msg_ptr->tel.tel_data_ptr[5]));
2815 self_->most_port_status = result;
2817 Sub_Notify(&self_->subs[INIC_SUB_MOST_PORT_STATUS], &result);
2820 /*! \brief Handler function for INIC.MOSTPortStatus.Error
2821 * \param self Reference to CInic instance
2822 * \param msg_ptr Pointer to received message
2824 void Inic_MostPortStatus_Error(void *self, Msg_MostTel_t *msg_ptr)
2826 CInic *self_ = (CInic *)self;
2827 Inic_StdResult_t res_data;
2829 res_data.data_info = NULL;
2830 res_data.result = Inic_TranslateError(self_,
2831 &msg_ptr->tel.tel_data_ptr[0],
2832 msg_ptr->tel.tel_len);
2834 Sub_Notify(&self_->subs[INIC_SUB_MOST_PORT_STATUS], &res_data);
2837 /*! \brief Handler function for INIC.MOSTSocketCreate.ErrorAck. Result is delivered via the
2838 * SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2839 * \param self Reference to CInic instance
2840 * \param msg_ptr Pointer to received message
2842 void Inic_MostSocketCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2844 CInic *self_ = (CInic *)self;
2845 Inic_StdResult_t res_data;
2847 res_data.data_info = NULL;
2848 res_data.result = Inic_TranslateError(self_,
2849 &msg_ptr->tel.tel_data_ptr[0],
2850 (msg_ptr->tel.tel_len));
2851 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2852 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2855 /*! \brief Handler function for INIC.MOSTSocketCreate.ResultAck
2856 * \details Result is delivered via the SingleObserver element ssubs[INIC_SSUB_CREATE_CLASS]. Element
2857 * res_data.data_info points to a variable of type Inic_MostSocketCreate_Result_t
2858 * which holds the results of the MOSTSocketCreate command.
2859 * \param self Reference to CInic instance
2860 * \param msg_ptr Pointer to received message
2862 void Inic_MostSocketCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2864 CInic *self_ = (CInic *)self;
2865 Inic_StdResult_t res_data;
2866 Inic_MostSocketCreate_Result_t res;
2868 MISC_DECODE_WORD(&(res.most_socket_handle), &(msg_ptr->tel.tel_data_ptr[0]));
2869 MISC_DECODE_WORD(&(res.conn_label), &(msg_ptr->tel.tel_data_ptr[2]));
2870 res_data.data_info = &res;
2871 res_data.result.code = UCS_RES_SUCCESS;
2872 res_data.result.info_ptr = NULL;
2873 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2874 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2878 /*! \brief Handler function for INIC.MLBPortCreate.ErrorAck
2879 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2880 * \param self Reference to CInic instance
2881 * \param msg_ptr Pointer to received message
2883 void Inic_MlbPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2885 CInic *self_ = (CInic *)self;
2886 Inic_StdResult_t res_data;
2888 res_data.data_info = NULL;
2889 res_data.result = Inic_TranslateError(self_,
2890 &msg_ptr->tel.tel_data_ptr[0],
2891 (msg_ptr->tel.tel_len));
2892 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2893 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2896 /*! \brief Handler function for INIC.MLBPortCreate.ResultAck
2897 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2898 * Element res_data.data_info points to the variable mlb_port_handle which holds the
2899 * MediaLB Port resource handle.
2900 * \param self Reference to CInic instance
2901 * \param msg_ptr Pointer to received message
2903 void Inic_MlbPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2905 CInic *self_ = (CInic *)self;
2906 uint16_t mlb_port_handle;
2907 Inic_StdResult_t res_data;
2909 MISC_DECODE_WORD(&mlb_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
2910 res_data.data_info = &mlb_port_handle;
2911 res_data.result.code = UCS_RES_SUCCESS;
2912 res_data.result.info_ptr = NULL;
2913 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2914 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2917 /*! \brief Handler function for INIC.MLBSocketCreate.ErrorAck
2918 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2919 * \param self Reference to CInic instance
2920 * \param msg_ptr Pointer to received message
2922 void Inic_MlbSocketCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2924 CInic *self_ = (CInic *)self;
2925 Inic_StdResult_t res_data;
2927 res_data.data_info = NULL;
2928 res_data.result = Inic_TranslateError(self_,
2929 &msg_ptr->tel.tel_data_ptr[0],
2930 (msg_ptr->tel.tel_len));
2931 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2932 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2935 /*! \brief Handler function for INIC.MLBSocketCreate.ResultAck
2936 * \details Element res_data.data_info points to the variable mlb_socket_handle which holds the
2937 * MediaLB Socket resource handle of the created socket. Result is delivered via the
2938 * SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2939 * \param self Reference to CInic instance
2940 * \param msg_ptr Pointer to received message
2942 void Inic_MlbSocketCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2944 CInic *self_ = (CInic *)self;
2945 uint16_t mlb_socket_handle;
2946 Inic_StdResult_t res_data;
2948 MISC_DECODE_WORD(&mlb_socket_handle, &(msg_ptr->tel.tel_data_ptr[0]));
2949 res_data.data_info = &mlb_socket_handle;
2950 res_data.result.code = UCS_RES_SUCCESS;
2951 res_data.result.info_ptr = NULL;
2952 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2953 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2956 /*! \brief Handler function for INIC.USBPortCreate.ErrorAck
2957 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2958 * \param self Reference to CInic instance
2959 * \param msg_ptr Pointer to received message
2961 void Inic_UsbPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
2963 CInic *self_ = (CInic *)self;
2964 Inic_StdResult_t res_data;
2966 res_data.data_info = NULL;
2967 res_data.result = Inic_TranslateError(self_,
2968 &msg_ptr->tel.tel_data_ptr[0],
2969 (msg_ptr->tel.tel_len));
2970 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2971 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2974 /*! \brief Handler function for INIC.USBPortCreate.ResultAck
2975 * \details Element res_data.data_info points to the variable usb_port_handle which holds the USB
2976 * Port resource handle.
2977 * \param self Reference to CInic instance
2978 * \param msg_ptr Pointer to received message
2980 void Inic_UsbPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
2982 CInic *self_ = (CInic *)self;
2983 uint16_t usb_port_handle;
2984 Inic_StdResult_t res_data;
2986 MISC_DECODE_WORD(&usb_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
2987 res_data.data_info = &usb_port_handle;
2988 res_data.result.code = UCS_RES_SUCCESS;
2989 res_data.result.info_ptr = NULL;
2990 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
2991 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
2994 /*! \brief Handler function for INIC.USBSocketCreate.ErrorAck
2995 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
2996 * \param self Reference to CInic instance
2997 * \param msg_ptr Pointer to received message
2999 void Inic_UsbSocketCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3001 CInic *self_ = (CInic *)self;
3002 Inic_StdResult_t res_data;
3004 res_data.data_info = NULL;
3005 res_data.result = Inic_TranslateError(self_,
3006 &msg_ptr->tel.tel_data_ptr[0],
3007 (msg_ptr->tel.tel_len));
3008 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3009 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3012 /*! \brief Handler function for INIC.USBSocketCreate.ResultAck
3013 * \details Element res_data.data_info points to the variable usb_socket_handle which holds the
3014 * Socket resource handle of the created socket. Result is delivered via the
3015 * SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3016 * \param self Reference to CInic instance
3017 * \param msg_ptr Pointer to received message
3019 void Inic_UsbSocketCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3021 CInic *self_ = (CInic *)self;
3022 uint16_t usb_socket_handle;
3023 Inic_StdResult_t res_data;
3025 MISC_DECODE_WORD(&usb_socket_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3026 res_data.data_info = &usb_socket_handle;
3027 res_data.result.code = UCS_RES_SUCCESS;
3028 res_data.result.info_ptr = NULL;
3029 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3030 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3033 /*! \brief Handler function for INIC.StreamPortConfiguration.Status
3034 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_STREAM_PORT_CONFIG].
3035 * Element res_data.data_info points to a variable of type Inic_StreamPortConfigStatus_t
3036 * which holds the results of the INIC.StreamPortConfiguration.Get command.
3037 * \param self Reference to CInic instance
3038 * \param msg_ptr Pointer to received message
3040 void Inic_StreamPortConfig_Status(void *self, Msg_MostTel_t *msg_ptr)
3042 CInic *self_ = (CInic *)self;
3043 Inic_StreamPortConfigStatus_t res;
3044 Inic_StdResult_t res_data;
3046 res_data.data_info = &res;
3047 res_data.result.code = UCS_RES_SUCCESS;
3048 res_data.result.info_ptr = NULL;
3050 res.index = msg_ptr->tel.tel_data_ptr[0];
3051 res.op_mode = (Ucs_Stream_PortOpMode_t)msg_ptr->tel.tel_data_ptr[1];
3052 res.port_option = (Ucs_Stream_PortOption_t)msg_ptr->tel.tel_data_ptr[2];
3053 res.clock_mode = (Ucs_Stream_PortClockMode_t)msg_ptr->tel.tel_data_ptr[3];
3054 res.clock_data_delay = (Ucs_Stream_PortClockDataDelay_t)msg_ptr->tel.tel_data_ptr[4];
3056 Ssub_Notify(&self_->ssubs[INIC_SSUB_STREAM_PORT_CONFIG], &res_data, true);
3057 Al_Release(&self_->lock.res_api, INIC_API_STREAM_PORT_CONFIG);
3060 /*! \brief Handler function for INIC.StreamPortConfiguration.Error
3061 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_STREAM_PORT_CONFIG].
3062 * \param self Reference to CInic instance
3063 * \param msg_ptr Pointer to received message
3065 void Inic_StreamPortConfig_Error(void *self, Msg_MostTel_t *msg_ptr)
3067 CInic *self_ = (CInic *)self;
3068 Inic_StdResult_t res_data;
3070 res_data.data_info = NULL;
3071 res_data.result = Inic_TranslateError(self_,
3072 &msg_ptr->tel.tel_data_ptr[0],
3073 msg_ptr->tel.tel_len);
3074 Ssub_Notify(&self_->ssubs[INIC_SSUB_STREAM_PORT_CONFIG], &res_data, true);
3075 Al_Release(&self_->lock.res_api, INIC_API_STREAM_PORT_CONFIG);
3078 /*! \brief Handler function for INIC.StreamPortCreate.ErrorAck
3079 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3080 * \param self Reference to CInic instance
3081 * \param msg_ptr Pointer to received message
3083 void Inic_StreamPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3085 CInic *self_ = (CInic *)self;
3086 Inic_StdResult_t res_data;
3088 res_data.data_info = NULL;
3089 res_data.result = Inic_TranslateError(self_,
3090 &msg_ptr->tel.tel_data_ptr[0],
3091 (msg_ptr->tel.tel_len));
3092 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3093 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3096 /*! \brief Handler function for INIC.StreamPortCreate.ResultAck
3097 * \details Element res_data.data_info points to the variable stream_port_handle which holds the
3098 * Streaming Port resource handle. Result is delivered via the SingleObserver object
3099 * ssubs[INIC_SSUB_CREATE_CLASS].
3100 * \param self Reference to CInic instance
3101 * \param msg_ptr Pointer to received message
3103 void Inic_StreamPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3105 CInic *self_ = (CInic *)self;
3106 uint16_t stream_port_handle;
3107 Inic_StdResult_t res_data;
3109 MISC_DECODE_WORD(&stream_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3110 res_data.data_info = &stream_port_handle;
3111 res_data.result.code = UCS_RES_SUCCESS;
3112 res_data.result.info_ptr = NULL;
3113 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3114 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3117 /*! \brief Handler function for INIC.StreamSocketCreate.ErrorAck
3118 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3119 * \param self Reference to CInic instance
3120 * \param msg_ptr Pointer to received message
3122 void Inic_StreamSocketCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3124 CInic *self_ = (CInic *)self;
3125 Inic_StdResult_t res_data;
3127 res_data.data_info = NULL;
3128 res_data.result = Inic_TranslateError(self_,
3129 &msg_ptr->tel.tel_data_ptr[0],
3130 (msg_ptr->tel.tel_len));
3131 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3132 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3135 /*! \brief Handler function for INIC.StreamSocketCreate.ResultAck
3136 * \details Element res_data.data_info points to the variable stream_socket_handle which holds
3137 * the Socket resource handle of the created socket. Result is delivered via the
3138 * SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3139 * \param self Reference to CInic instance
3140 * \param msg_ptr Pointer to received message
3142 void Inic_StreamSocketCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3144 CInic *self_ = (CInic *)self;
3145 uint16_t stream_socket_handle;
3146 Inic_StdResult_t res_data;
3148 MISC_DECODE_WORD(&stream_socket_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3149 res_data.data_info = &stream_socket_handle;
3150 res_data.result.code = UCS_RES_SUCCESS;
3151 res_data.result.info_ptr = NULL;
3152 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3153 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3156 /*! \brief Handler function for INIC.RMCKOutPortCreate.ErrorAck
3157 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3158 * \param self Reference to CInic instance
3159 * \param msg_ptr Pointer to received message
3161 void Inic_RmckPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3163 CInic *self_ = (CInic *)self;
3164 Inic_StdResult_t res_data;
3166 res_data.data_info = NULL;
3167 res_data.result = Inic_TranslateError(self_,
3168 &msg_ptr->tel.tel_data_ptr[0],
3169 (msg_ptr->tel.tel_len));
3170 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3171 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3174 /*! \brief Handler function for INIC.RMCKOutPortCreate.ResultAck
3175 * \details Element res_data.data_info points to the variable rmck_port_handle which holds the
3176 * RMCK Port resource handle. Result is delivered via the SingleObserver object
3177 * ssubs[INIC_SSUB_CREATE_CLASS].
3178 * \param self Reference to CInic instance
3179 * \param msg_ptr Pointer to received message
3181 void Inic_RmckPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3183 CInic *self_ = (CInic *)self;
3184 uint16_t rmck_port_handle;
3185 Inic_StdResult_t res_data;
3187 MISC_DECODE_WORD(&rmck_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3188 res_data.data_info = &rmck_port_handle;
3189 res_data.result.code = UCS_RES_SUCCESS;
3190 res_data.result.info_ptr = NULL;
3191 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3192 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3195 /*! \brief Handler function for INIC.I2CPortCreate.ErrorAck
3196 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3197 * \param self Reference to CInic instance
3198 * \param msg_ptr Pointer to received message
3200 void Inic_I2cPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3202 CInic *self_ = (CInic *)self;
3203 Inic_StdResult_t res_data;
3205 res_data.data_info = NULL;
3206 res_data.result = Inic_TranslateError(self_,
3207 &msg_ptr->tel.tel_data_ptr[0],
3208 (msg_ptr->tel.tel_len));
3209 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3210 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3213 /*! \brief Handler function for INIC.I2CPortCreate.ResultAck
3214 * \details Element res_data.data_info points to the variable i2c_port_handle which holds the
3215 * I2C Port resource handle. Result is delivered via the SingleObserver object
3216 * ssubs[INIC_SSUB_CREATE_CLASS].
3217 * \param self Reference to CInic instance
3218 * \param msg_ptr Pointer to received message
3220 void Inic_I2cPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3222 CInic *self_ = (CInic *)self;
3223 uint16_t i2c_port_handle;
3224 Inic_StdResult_t res_data;
3226 MISC_DECODE_WORD(&i2c_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3227 res_data.data_info = &i2c_port_handle;
3228 res_data.result.code = UCS_RES_SUCCESS;
3229 res_data.result.info_ptr = NULL;
3230 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3231 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3234 /*! \brief Handler function for INIC.I2CPortRead.ErrorAck
3235 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_I2C_PORT_WR].
3236 * \param self Reference to CInic instance
3237 * \param msg_ptr Pointer to received message
3239 void Inic_I2cPortRead_Error(void *self, Msg_MostTel_t *msg_ptr)
3241 CInic *self_ = (CInic *)self;
3242 Inic_StdResult_t res_data;
3244 res_data.data_info = NULL;
3245 res_data.result = Inic_TranslateError(self_,
3246 &msg_ptr->tel.tel_data_ptr[0],
3247 (msg_ptr->tel.tel_len));
3248 Ssub_Notify(&self_->ssubs[INIC_SSUB_I2C_PORT_WR], &res_data, true);
3249 Al_Release(&self_->lock.res_api, INIC_API_I2C_PORT_WR);
3252 /*! \brief Handler function for INIC.I2CPortRead.ResultAck
3253 * \details Element res_data.data_info points to a variable of type Inic_I2cReadResStatus_t which holds the
3254 * the results of the INIC.I2CPortRead.StartResultAck command.
3255 * Result is delivered via the SingleObserver object ssubs[INIC_SSUB_I2C_PORT_WR].
3256 * \param self Reference to CInic instance
3257 * \param msg_ptr Pointer to received message
3259 void Inic_I2cPortRead_Result(void *self, Msg_MostTel_t *msg_ptr)
3261 CInic *self_ = (CInic *)self;
3262 Inic_I2cReadResStatus_t i2c_read_res;
3263 Inic_StdResult_t res_data;
3265 res_data.data_info = &i2c_read_res;
3266 res_data.result.code = UCS_RES_SUCCESS;
3267 res_data.result.info_ptr = NULL;
3269 MISC_DECODE_WORD(&i2c_read_res.port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3270 i2c_read_res.slave_address = msg_ptr->tel.tel_data_ptr[2];
3271 i2c_read_res.data_len = msg_ptr->tel.tel_data_ptr[3];
3272 i2c_read_res.data_ptr = &msg_ptr->tel.tel_data_ptr[4];
3274 Ssub_Notify(&self_->ssubs[INIC_SSUB_I2C_PORT_WR], &res_data, true);
3275 Al_Release(&self_->lock.res_api, INIC_API_I2C_PORT_WR);
3278 /*! \brief Handler function for INIC.I2CPortWrite.ErrorAck
3279 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_I2C_PORT_WR].
3280 * \param self Reference to CInic instance
3281 * \param msg_ptr Pointer to received message
3283 void Inic_I2cPortWrite_Error(void *self, Msg_MostTel_t *msg_ptr)
3285 CInic *self_ = (CInic *)self;
3286 Inic_StdResult_t res_data;
3288 res_data.data_info = NULL;
3289 res_data.result = Inic_TranslateError(self_,
3290 &msg_ptr->tel.tel_data_ptr[0],
3291 (msg_ptr->tel.tel_len));
3292 Ssub_Notify(&self_->ssubs[INIC_SSUB_I2C_PORT_WR], &res_data, true);
3293 Al_Release(&self_->lock.res_api, INIC_API_I2C_PORT_WR);
3296 /*! \brief Handler function for INIC.I2CPortWrite.ResultAck
3297 * \details Element res_data.data_info points to a variable of type Inic_I2cWriteResStatus_t which holds the
3298 * the results of the INIC.I2CPortWrite.StartResultAck command.
3299 * Result is delivered via the SingleObserver object ssubs[INIC_SSUB_I2C_PORT_WR].
3300 * \param self Reference to CInic instance
3301 * \param msg_ptr Pointer to received message
3303 void Inic_I2cPortWrite_Result(void *self, Msg_MostTel_t *msg_ptr)
3305 CInic *self_ = (CInic *)self;
3306 Inic_I2cWriteResStatus_t i2c_write_res;
3307 Inic_StdResult_t res_data;
3309 res_data.data_info = &i2c_write_res;
3310 res_data.result.code = UCS_RES_SUCCESS;
3311 res_data.result.info_ptr = NULL;
3313 MISC_DECODE_WORD(&i2c_write_res.port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3314 i2c_write_res.slave_address = msg_ptr->tel.tel_data_ptr[2];
3315 i2c_write_res.data_len = msg_ptr->tel.tel_data_ptr[3];
3317 Ssub_Notify(&self_->ssubs[INIC_SSUB_I2C_PORT_WR], &res_data, true);
3318 Al_Release(&self_->lock.res_api, INIC_API_I2C_PORT_WR);
3321 /*! \brief Handler function for INIC.PCIPortCreate.ErrorAck
3322 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3323 * \param self Reference to CInic instance
3324 * \param msg_ptr Pointer to received message
3326 void Inic_PciPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3328 CInic *self_ = (CInic *)self;
3329 Inic_StdResult_t res_data;
3331 res_data.data_info = NULL;
3332 res_data.result = Inic_TranslateError(self_,
3333 &msg_ptr->tel.tel_data_ptr[0],
3334 (msg_ptr->tel.tel_len));
3335 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3336 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3339 /*! \brief Handler function for INIC.PCIPortCreate.ResultAck
3340 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3341 * \param self Reference to CInic instance
3342 * \param msg_ptr Pointer to received message
3344 void Inic_PciPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3346 CInic *self_ = (CInic *)self;
3347 uint16_t pci_port_handle;
3348 Inic_StdResult_t res_data;
3350 MISC_DECODE_WORD(&pci_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3351 res_data.data_info = &pci_port_handle;
3352 res_data.result.code = UCS_RES_SUCCESS;
3353 res_data.result.info_ptr = NULL;
3354 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3355 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3358 /*! \brief Handler function for INIC.PCISocketCreate.ErrorAck
3359 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3360 * \param self Reference to CInic instance
3361 * \param msg_ptr Pointer to received message
3363 void Inic_PciSocketCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3365 CInic *self_ = (CInic *)self;
3366 Inic_StdResult_t res_data;
3368 res_data.data_info = NULL;
3369 res_data.result = Inic_TranslateError(self_,
3370 &msg_ptr->tel.tel_data_ptr[0],
3371 (msg_ptr->tel.tel_len));
3372 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3373 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3376 /*! \brief Handler function for INIC.PCISocketCreate.ResultAck
3377 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3378 * \param self Reference to CInic instance
3379 * \param msg_ptr Pointer to received message
3381 void Inic_PciSocketCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3383 CInic *self_ = (CInic *)self;
3384 uint16_t pci_socket_port_handle;
3385 Inic_StdResult_t res_data;
3387 MISC_DECODE_WORD(&pci_socket_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3388 res_data.data_info = &pci_socket_port_handle;
3389 res_data.result.code = UCS_RES_SUCCESS;
3390 res_data.result.info_ptr = NULL;
3391 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3392 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3395 /*! \brief Handler function for INIC.GPIOPortCreate.ErrorAck
3396 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3397 * \param self Reference to CInic instance
3398 * \param msg_ptr Pointer to received message
3400 void Inic_GpioPortCreate_Error(void *self, Msg_MostTel_t *msg_ptr)
3402 CInic *self_ = (CInic *)self;
3403 Inic_StdResult_t res_data;
3405 res_data.data_info = NULL;
3406 res_data.result = Inic_TranslateError(self_,
3407 &msg_ptr->tel.tel_data_ptr[0],
3408 (msg_ptr->tel.tel_len));
3409 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3410 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3413 /*! \brief Handler function for INIC.GPIOPortCreate.ResultAck
3414 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_CREATE_CLASS].
3415 * \param self Reference to CInic instance
3416 * \param msg_ptr Pointer to received message
3418 void Inic_GpioPortCreate_Result(void *self, Msg_MostTel_t *msg_ptr)
3420 CInic *self_ = (CInic *)self;
3421 uint16_t gpio_port_handle;
3422 Inic_StdResult_t res_data;
3424 MISC_DECODE_WORD(&gpio_port_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3425 res_data.data_info = &gpio_port_handle;
3426 res_data.result.code = UCS_RES_SUCCESS;
3427 res_data.result.info_ptr = NULL;
3428 Ssub_Notify(&self_->ssubs[INIC_SSUB_CREATE_CLASS], &res_data, true);
3429 Al_Release(&self_->lock.res_api, INIC_API_CREATE_CLASS);
3432 /*! \brief Handler function for INIC.MOSTPortEnable.ErrorAck
3433 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_MOST_PORT_ENABLE].
3434 * \param self Reference to CInic instance
3435 * \param msg_ptr Pointer to received message
3437 void Inic_MostPortEnable_Error(void *self, Msg_MostTel_t *msg_ptr)
3439 CInic *self_ = (CInic *)self;
3440 Inic_StdResult_t res_data;
3442 res_data.data_info = NULL;
3443 res_data.result = Inic_TranslateError(self_,
3444 &msg_ptr->tel.tel_data_ptr[0],
3445 (msg_ptr->tel.tel_len));
3446 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_ENABLE], &res_data, true);
3447 Al_Release(&self_->lock.res_api, INIC_API_MOST_PORT_ENABLE);
3450 /*! \brief Handler function for INIC.MOSTPortEnable.ResultAck
3451 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_MOST_PORT_ENABLE].
3452 * \param self Reference to CInic instance
3453 * \param msg_ptr Pointer to received message
3455 void Inic_MostPortEnable_Result(void *self, Msg_MostTel_t *msg_ptr)
3457 CInic *self_ = (CInic *)self;
3458 Inic_StdResult_t res_data;
3459 MISC_UNUSED(msg_ptr);
3461 res_data.data_info = NULL;
3462 res_data.result.code = UCS_RES_SUCCESS;
3463 res_data.result.info_ptr = NULL;
3464 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_ENABLE], &res_data, true);
3465 Al_Release(&self_->lock.res_api, INIC_API_MOST_PORT_ENABLE);
3468 /*! \brief Handler function for INIC.GPIOPortPinMode.Status
3469 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_PIN_MODE].
3470 * Element res_data.data_info points to a variable of type Inic_GpioPortPinModeStatus_t
3471 * which holds the results of the INIC.GPIOPortPinMode.Get command.
3472 * \param self Reference to CInic instance
3473 * \param msg_ptr Pointer to received message
3475 void Inic_GpioPortPinMode_Status(void *self, Msg_MostTel_t *msg_ptr)
3477 CInic *self_ = (CInic *)self;
3478 Inic_GpioPortPinModeStatus_t res;
3479 Inic_StdResult_t res_data;
3480 uint8_t i = 2U, j = 0U;
3481 Ucs_Gpio_PinConfiguration_t pin_ls[16U];
3483 res.cfg_list = &pin_ls[0];
3484 res.len = (msg_ptr->tel.tel_len - 2U) >> 1U;
3485 res_data.data_info = &res;
3486 res_data.result.code = UCS_RES_SUCCESS;
3487 res_data.result.info_ptr = NULL;
3489 MISC_DECODE_WORD(&res.gpio_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3490 for (; (i < msg_ptr->tel.tel_len) && (j < 16U); i=i+2U)
3492 pin_ls[j].pin = msg_ptr->tel.tel_data_ptr[i];
3493 pin_ls[j].mode = (Ucs_Gpio_PinMode_t)msg_ptr->tel.tel_data_ptr[i+1U];
3497 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_MODE], &res_data, true);
3498 Al_Release(&self_->lock.res_api, INIC_API_GPIO_PIN_MODE);
3501 /*! \brief Handler function for INIC.GPIOPortPinMode.Error
3502 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_PIN_MODE].
3503 * \param self Reference to CInic instance
3504 * \param msg_ptr Pointer to received message
3506 void Inic_GpioPortPinMode_Error(void *self, Msg_MostTel_t *msg_ptr)
3508 CInic *self_ = (CInic *)self;
3509 Inic_StdResult_t res_data;
3511 res_data.data_info = NULL;
3512 res_data.result = Inic_TranslateError(self_,
3513 &msg_ptr->tel.tel_data_ptr[0],
3514 msg_ptr->tel.tel_len);
3515 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_MODE], &res_data, true);
3516 Al_Release(&self_->lock.res_api, INIC_API_GPIO_PIN_MODE);
3519 /*! \brief Handler function for INIC.GPIOPortPinState.Status
3520 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_PIN_STATE].
3521 * Element res_data.data_info points to a variable of type Inic_GpioPortPinStateStatus_t
3522 * which holds the results of the INIC.GPIOPortPinState.Get command.
3523 * \param self Reference to CInic instance
3524 * \param msg_ptr Pointer to received message
3526 void Inic_GpioPortPinState_Status(void *self, Msg_MostTel_t *msg_ptr)
3528 CInic *self_ = (CInic *)self;
3529 Inic_GpioPortPinStateStatus_t res;
3530 Inic_StdResult_t res_data;
3532 res_data.data_info = &res;
3533 res_data.result.code = UCS_RES_SUCCESS;
3534 res_data.result.info_ptr = NULL;
3536 MISC_DECODE_WORD(&res.gpio_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3537 MISC_DECODE_WORD(&res.current_state, &(msg_ptr->tel.tel_data_ptr[2]));
3538 MISC_DECODE_WORD(&res.sticky_state, &(msg_ptr->tel.tel_data_ptr[4]));
3540 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_STATE], &res_data, true);
3541 Al_Release(&self_->lock.res_api, INIC_API_GPIO_PIN_STATE);
3544 /*! \brief Handler function for INIC.GPIOPortPinState.Error
3545 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_PIN_STATE].
3546 * \param self Reference to CInic instance
3547 * \param msg_ptr Pointer to received message
3549 void Inic_GpioPortPinState_Error(void *self, Msg_MostTel_t *msg_ptr)
3551 CInic *self_ = (CInic *)self;
3552 Inic_StdResult_t res_data;
3554 res_data.data_info = NULL;
3555 res_data.result = Inic_TranslateError(self_,
3556 &msg_ptr->tel.tel_data_ptr[0],
3557 msg_ptr->tel.tel_len);
3558 Ssub_Notify(&self_->ssubs[INIC_SSUB_GPIO_PIN_STATE], &res_data, true);
3559 Al_Release(&self_->lock.res_api, INIC_API_GPIO_PIN_STATE);
3562 /*! \brief Handler function for INIC.GPIOPortTriggerEvent.Status
3563 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_TRIGGER_EVENT].
3564 * Element res_data.data_info points to a variable of type Inic_GpioTriggerEventStatus_t
3565 * \param self Reference to CInic instance
3566 * \param msg_ptr Pointer to received message
3568 void Inic_GpioPortTrigger_Status(void *self, Msg_MostTel_t *msg_ptr)
3570 CInic *self_ = (CInic *)self;
3571 Inic_GpioTriggerEventStatus_t res;
3572 Inic_StdResult_t res_data;
3574 res_data.data_info = &res;
3575 res_data.result.code = UCS_RES_SUCCESS;
3576 res_data.result.info_ptr = NULL;
3578 MISC_DECODE_WORD(&res.gpio_handle, &(msg_ptr->tel.tel_data_ptr[0]));
3579 MISC_DECODE_WORD(&res.rising_edges, &(msg_ptr->tel.tel_data_ptr[2]));
3580 MISC_DECODE_WORD(&res.falling_edges, &(msg_ptr->tel.tel_data_ptr[4]));
3581 MISC_DECODE_WORD(&res.levels, &(msg_ptr->tel.tel_data_ptr[6]));
3582 res.is_first_report = self_->gpio_rt_status.first_report;
3583 if (self_->gpio_rt_status.first_report)
3585 self_->gpio_rt_status.first_report = false;
3588 Sub_Notify(&self_->subs[INIC_SUB_GPIO_TRIGGER_EVENT], &res_data);
3591 /*! \brief Handler function for INIC.GPIOPortTriggerEvent.Error
3592 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_GPIO_TRIGGER_EVENT].
3593 * \param self Reference to CInic instance
3594 * \param msg_ptr Pointer to received message
3596 void Inic_GpioPortTrigger_Error(void *self, Msg_MostTel_t *msg_ptr)
3598 CInic *self_ = (CInic *)self;
3599 Inic_StdResult_t res_data;
3601 res_data.data_info = NULL;
3602 res_data.result = Inic_TranslateError(self_,
3603 &msg_ptr->tel.tel_data_ptr[0],
3604 msg_ptr->tel.tel_len);
3605 Sub_Notify(&self_->subs[INIC_SUB_GPIO_TRIGGER_EVENT], &res_data);
3608 /*! \brief Handler function for INIC.MOSTPortEnableFullStreaming.ErrorAck
3609 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_MOST_PORT_EN_FULL_STR].
3610 * \param self Reference to CInic instance
3611 * \param msg_ptr Pointer to received message
3613 void Inic_MostPortEnFullStr_Error(void *self, Msg_MostTel_t *msg_ptr)
3615 CInic *self_ = (CInic *)self;
3616 Inic_StdResult_t res_data;
3618 res_data.data_info = NULL;
3619 res_data.result = Inic_TranslateError(self_,
3620 &msg_ptr->tel.tel_data_ptr[0],
3621 (msg_ptr->tel.tel_len));
3622 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_EN_FULL_STR], &res_data, true);
3623 Al_Release(&self_->lock.res_api, INIC_API_MOST_PORT_EN_FULL_STR);
3626 /*! \brief Handler function for INIC.MOSTPortEnableFullStreaming.ResultAck
3627 * \details Result is delivered via the SingleObserver object ssubs[INIC_SSUB_MOST_PORT_EN_FULL_STR].
3628 * \param self Reference to CInic instance
3629 * \param msg_ptr Pointer to received message
3631 void Inic_MostPortEnFullStr_Result(void *self, Msg_MostTel_t *msg_ptr)
3633 CInic *self_ = (CInic *)self;
3634 Inic_StdResult_t res_data;
3635 MISC_UNUSED(msg_ptr);
3637 res_data.data_info = NULL;
3638 res_data.result.code = UCS_RES_SUCCESS;
3639 res_data.result.info_ptr = NULL;
3640 Ssub_Notify(&self_->ssubs[INIC_SSUB_MOST_PORT_EN_FULL_STR], &res_data, true);
3641 Al_Release(&self_->lock.res_api, INIC_API_MOST_PORT_EN_FULL_STR);
3644 /*! \brief Handler function for INIC.Notification.Error
3645 * \param self reference to INIC object
3646 * \param msg_ptr received message
3648 void Inic_Notification_Error(void *self, Msg_MostTel_t *msg_ptr)
3650 CInic *self_ = (CInic *)self;
3651 Inic_StdResult_t res_data;
3653 res_data.data_info = NULL;
3654 res_data.result = Inic_TranslateError(self_,
3655 &msg_ptr->tel.tel_data_ptr[0],
3656 (msg_ptr->tel.tel_len));
3658 Ssub_Notify(&self_->ssubs[INIC_SSUB_NOTIFICATION], &res_data, true);
3659 Al_Release(&self_->lock.res_api, INIC_API_NOTIFICATION);
3662 /*! \brief Handler function for INIC.Notification.ResultAck
3663 * \param self reference to INIC object
3664 * \param msg_ptr received message
3666 void Inic_Notification_Status(void *self, Msg_MostTel_t *msg_ptr)
3668 CInic *self_ = (CInic *)self;
3669 Inic_StdResult_t res_data;
3670 Inic_NotificationResult_t notif_res;
3672 res_data.data_info = ¬if_res;
3673 res_data.result.code = UCS_RES_SUCCESS;
3674 res_data.result.info_ptr = NULL;
3676 MISC_DECODE_WORD(¬if_res.func_id, &(msg_ptr->tel.tel_data_ptr[0]));
3677 if (msg_ptr->tel.tel_len == 4U)
3679 MISC_DECODE_WORD(¬if_res.device_id, &(msg_ptr->tel.tel_data_ptr[2]));
3683 notif_res.device_id = 0U;
3686 Ssub_Notify(&self_->ssubs[INIC_SSUB_NOTIFICATION], &res_data, true);
3687 Al_Release(&self_->lock.res_api, INIC_API_NOTIFICATION);
3690 /*! \brief Handler function for INIC.DeviceSync.Error
3691 * \param self reference to INIC object
3692 * \param msg_ptr received message
3694 void Inic_DeviceSync_Error(void *self, Msg_MostTel_t *msg_ptr)
3696 CInic *self_ = (CInic *)self;
3697 Inic_StdResult_t res_data;
3699 res_data.data_info = NULL;
3700 res_data.result = Inic_TranslateError(self_,
3701 &msg_ptr->tel.tel_data_ptr[0],
3702 (msg_ptr->tel.tel_len));
3704 Ssub_Notify(&self_->ssubs[INIC_SSUB_DEVICE_SYNC], &res_data, true);
3705 Al_Release(&self_->lock.res_api, INIC_API_DEVICE_SYNC);
3708 /*! \brief Handler function for INIC.DeviceSync.Result
3709 * \param self reference to INIC object
3710 * \param msg_ptr received message
3712 void Inic_DeviceSync_Result(void *self, Msg_MostTel_t *msg_ptr)
3714 CInic *self_ = (CInic *)self;
3715 Inic_StdResult_t res_data;
3717 MISC_UNUSED(msg_ptr);
3719 res_data.data_info = NULL;
3720 res_data.result.code = UCS_RES_SUCCESS;
3721 res_data.result.info_ptr = NULL;
3723 Ssub_Notify(&self_->ssubs[INIC_SSUB_DEVICE_SYNC], &res_data, true);
3724 Al_Release(&self_->lock.res_api, INIC_API_DEVICE_SYNC);
3732 /*------------------------------------------------------------------------------------------------*/
3734 /*------------------------------------------------------------------------------------------------*/