S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
p_sopc_utils.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef P_UTILS_H
21#define P_UTILS_H
22
23#include "sopc_enums.h"
24
25#include "FreeRTOS.h"
26#include "semphr.h"
27#include "task.h"
28
29#define MAX_P_UTILS_LIST (16)
30
31typedef struct T_TASK_LIST_ELT
32{
34 TaskHandle_t value;
35 void* pContext;
36 uint32_t infosField1;
37 uint32_t infosField2;
38 uint16_t nxId;
39 uint16_t prId;
41
42typedef struct T_TASK_LIST
43{
45 uint16_t firstValid;
48 uint16_t firstFree;
51 SemaphoreHandle_t lockHandle;
53
54/* Non Thread safe private list api */
55
56uint16_t P_UTILS_LIST_GetEltIndex(tUtilsList* ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2);
58
59/* \brief Adds an element to the list, if possible. \p handleTask can't be NULL. */
61 TaskHandle_t handleTask,
62 void* pContext,
63 uint32_t infos1,
64 uint32_t infos2);
65
73 uint32_t* pOutValue,
74 uint32_t* pOutValue2,
75 void** ppOutContext,
76 uint16_t* pCurrentSlotId);
77
78void* P_UTILS_LIST_ParseContextElt(tUtilsList* ptr, uint16_t* pCurrentSlotId);
79
81 TaskHandle_t taskNotified,
82 uint32_t infos1,
83 uint32_t infos2,
84 uint16_t* pOutNextOQPSlot);
85
87
89
90/* Thread safe private list api */
91
92uint16_t P_UTILS_LIST_GetEltIndexMT(tUtilsList* ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2);
93
94void* P_UTILS_LIST_GetContextFromHandleMT(tUtilsList* ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2);
95
97 uint32_t* pOutValue,
98 uint32_t* pOutValue2,
99 void** ppOutContext,
100 uint16_t* pCurrentSlotId);
101
103
105 TaskHandle_t handleTask,
106 void* pContext,
107 uint32_t infos,
108 uint32_t info2);
109
110void* P_UTILS_LIST_ParseContextEltMT(tUtilsList* ptr, uint16_t* pCurrentSlotId);
111
113 TaskHandle_t taskNotified,
114 uint32_t infos1,
115 uint32_t infos2,
116 uint16_t* pOutNextOQPSlot);
117
119
121
123
124#endif
void * P_UTILS_LIST_ParseContextElt(tUtilsList *ptr, uint16_t *pCurrentSlotId)
TaskHandle_t P_UTILS_LIST_ParseValueElt(tUtilsList *ptr, uint32_t *pOutValue, uint32_t *pOutValue2, void **ppOutContext, uint16_t *pCurrentSlotId)
Enumerate and parse elements of the list.
void P_UTILS_LIST_DeInitMT(tUtilsList *ptr)
void P_UTILS_LIST_DeInit(tUtilsList *ptr)
TaskHandle_t P_UTILS_LIST_ParseValueEltMT(tUtilsList *ptr, uint32_t *pOutValue, uint32_t *pOutValue2, void **ppOutContext, uint16_t *pCurrentSlotId)
void * P_UTILS_LIST_ParseContextEltMT(tUtilsList *ptr, uint16_t *pCurrentSlotId)
uint16_t P_UTILS_LIST_RemoveEltMT(tUtilsList *pv, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2, uint16_t *pOutNextOQPSlot)
uint16_t P_UTILS_LIST_GetNbEltMT(tUtilsList *ptr)
uint16_t P_UTILS_LIST_RemoveElt(tUtilsList *pv, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2, uint16_t *pOutNextOQPSlot)
uint16_t P_UTILS_LIST_GetEltIndex(tUtilsList *ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2)
struct T_TASK_LIST tUtilsList
SOPC_ReturnStatus P_UTILS_LIST_AddElt(tUtilsList *ptr, TaskHandle_t handleTask, void *pContext, uint32_t infos1, uint32_t infos2)
void * P_UTILS_LIST_GetContextFromHandleMT(tUtilsList *ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2)
SOPC_ReturnStatus P_UTILS_LIST_AddEltMT(tUtilsList *ptr, TaskHandle_t handleTask, void *pContext, uint32_t infos, uint32_t info2)
uint16_t P_UTILS_LIST_GetEltIndexMT(tUtilsList *ptr, TaskHandle_t taskNotified, uint32_t infos1, uint32_t infos2)
struct T_TASK_LIST_ELT tUtilsListElt
SOPC_ReturnStatus P_UTILS_LIST_Init(tUtilsList *ptr, uint16_t wMaxRDV)
SOPC_ReturnStatus P_UTILS_LIST_InitMT(tUtilsList *ptr, uint16_t wMaxRDV)
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
Definition p_sopc_utils.h:32
uint16_t nxId
Definition p_sopc_utils.h:38
uint32_t infosField2
Definition p_sopc_utils.h:37
void * pContext
Definition p_sopc_utils.h:35
TaskHandle_t value
Definition p_sopc_utils.h:34
uint16_t prId
Definition p_sopc_utils.h:39
uint32_t infosField1
Definition p_sopc_utils.h:36
Definition p_sopc_utils.h:43
uint16_t firstFreePreviousOQP
Definition p_sopc_utils.h:47
tUtilsListElt * list
Definition p_sopc_utils.h:44
uint16_t wNbRegisteredTasks
Definition p_sopc_utils.h:50
uint16_t firstFreeNextOQP
Definition p_sopc_utils.h:46
uint16_t firstFree
Definition p_sopc_utils.h:48
uint16_t firstValid
Definition p_sopc_utils.h:45
uint16_t wMaxWaitingTasks
Definition p_sopc_utils.h:49
SemaphoreHandle_t lockHandle
Definition p_sopc_utils.h:51