S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_event_timer_manager.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
30#ifndef SOPC_EVENT_TIMER_MANAGER_H_
31#define SOPC_EVENT_TIMER_MANAGER_H_
32
33#include "sopc_date_time.h"
34#include "sopc_event_handler.h"
35
40#ifndef SOPC_TIMER_RESOLUTION_MS
41#define SOPC_TIMER_RESOLUTION_MS 50
42#endif
43
44#if SOPC_TIMER_RESOLUTION_MS <= 0
45#error "Timer resolution cannot be <= 0"
46#endif
47
53
60
66
78uint32_t SOPC_EventTimer_Create(SOPC_EventHandler* eventHandler, SOPC_LooperEvent event, uint64_t msDelay);
79
90uint32_t SOPC_EventTimer_CreatePeriodic(SOPC_EventHandler* eventHandler, SOPC_LooperEvent event, uint64_t msPeriod);
91
102bool SOPC_EventTimer_ModifyPeriodic(uint32_t timerId, uint64_t msPeriod);
103
110void SOPC_EventTimer_Cancel(uint32_t timerId);
111
112#endif /* SOPC_EVENT_TIMER_MANAGER_H_ */
struct _SOPC_EventHandler SOPC_EventHandler
Processes messages from a queue.
Definition sopc_event_handler.h:35
uint32_t SOPC_EventTimer_CreatePeriodic(SOPC_EventHandler *eventHandler, SOPC_LooperEvent event, uint64_t msPeriod)
Creates a periodic timer raising an event on a dispatch manager every msPeriod milliseconds.
uint32_t SOPC_EventTimer_Create(SOPC_EventHandler *eventHandler, SOPC_LooperEvent event, uint64_t msDelay)
Create a timer which will raise the given event parameters to the given event dispatch manager.
void SOPC_EventTimer_Cancel(uint32_t timerId)
Cancel a started timer.
void SOPC_EventTimer_Initialize(void)
Initialize the event timer manager (necessary to create timers)
void SOPC_EventTimer_PreClear(void)
PreClear the event timer manager: thread triggering timers is stopped. It might be called prior to SO...
void SOPC_EventTimer_Clear(void)
Clear the event timer manager (cancel all timers not already triggered) SOPC_EventTimer_PreClear is a...
bool SOPC_EventTimer_ModifyPeriodic(uint32_t timerId, uint64_t msPeriod)
Modifies an existing periodic timer period.
Struct describing the various parts of an event.
Definition sopc_event_handler.h:49