S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_sk_scheduler.h File Reference

Security Keys Scheduler: it schedules the periodic update of keys retrieved from provider and set in the manager using the builder. More...

#include "sopc_sk_scheduler.h"
#include <stdbool.h>
#include <stdint.h>
#include "sopc_builtintypes.h"
#include "sopc_enums.h"
#include "sopc_sk_builder.h"
#include "sopc_sk_manager.h"
#include "sopc_sk_provider.h"

Go to the source code of this file.

Data Structures

struct  SOPC_SKscheduler
 Security Keys Scheduler structure. More...
 

Macros

#define SOPC_SK_SCHEDULER_UPDATE_TIMER_MIN   2000
 
#define SOPC_SK_SCHEDULER_UPDATE_TIMER_MAX   UINT32_MAX
 

Typedefs

typedef struct SOPC_SKscheduler SOPC_SKscheduler
 
typedef SOPC_ReturnStatus(* SOPC_SKscheduler_AddTask_Func) (SOPC_SKscheduler *sko, SOPC_SKBuilder *skb, SOPC_SKProvider *skp, SOPC_SKManager *skm, uint32_t msPeriod)
 
typedef SOPC_ReturnStatus(* SOPC_SKscheduler_Start_Func) (SOPC_SKscheduler *sko)
 
typedef void(* SOPC_SKscheduler_StopAndClear_Func) (SOPC_SKscheduler *sko)
 

Functions

SOPC_SKschedulerSOPC_SKscheduler_Create (void)
 Creates an instance of a default SOPC_SKscheduler. This scheduler manages only one task in a dedicated Thread.
 
SOPC_ReturnStatus SOPC_SKscheduler_AddTask (SOPC_SKscheduler *sko, SOPC_SKBuilder *skb, SOPC_SKProvider *skp, SOPC_SKManager *skm, uint32_t msPeriod)
 Creates a periodic task to call builder every msPeriod milliseconds. Ownership of SOPC_SKBuilder and SOPC_SKProvider is moved to the SOPC_SKscheduler Note : If Builder or Provider instance should be shared, these could be wrapped in an instance with a specific Clear function.
 
SOPC_ReturnStatus SOPC_SKscheduler_Start (SOPC_SKscheduler *sko)
 Starts a Security Keys Scheduler.
 
SOPC_ReturnStatus SOPC_SKscheduler_Stop (SOPC_SKscheduler *sko)
 Stops a Security Keys Scheduler.
 
void SOPC_SKscheduler_StopAndClear (SOPC_SKscheduler *sko)
 Stops a Security Keys Scheduler and deallocate data bytes content. This object should not be used after a call to this function.
 

Detailed Description

Security Keys Scheduler: it schedules the periodic update of keys retrieved from provider and set in the manager using the builder.

Macro Definition Documentation

◆ SOPC_SK_SCHEDULER_UPDATE_TIMER_MIN

#define SOPC_SK_SCHEDULER_UPDATE_TIMER_MIN   2000

◆ SOPC_SK_SCHEDULER_UPDATE_TIMER_MAX

#define SOPC_SK_SCHEDULER_UPDATE_TIMER_MAX   UINT32_MAX

Typedef Documentation

◆ SOPC_SKscheduler

typedef struct SOPC_SKscheduler SOPC_SKscheduler

◆ SOPC_SKscheduler_AddTask_Func

typedef SOPC_ReturnStatus(* SOPC_SKscheduler_AddTask_Func) (SOPC_SKscheduler *sko, SOPC_SKBuilder *skb, SOPC_SKProvider *skp, SOPC_SKManager *skm, uint32_t msPeriod)

◆ SOPC_SKscheduler_Start_Func

typedef SOPC_ReturnStatus(* SOPC_SKscheduler_Start_Func) (SOPC_SKscheduler *sko)

◆ SOPC_SKscheduler_StopAndClear_Func

typedef void(* SOPC_SKscheduler_StopAndClear_Func) (SOPC_SKscheduler *sko)

Function Documentation

◆ SOPC_SKscheduler_Create()

SOPC_SKscheduler * SOPC_SKscheduler_Create ( void )

Creates an instance of a default SOPC_SKscheduler. This scheduler manages only one task in a dedicated Thread.

Returns
a SOPC_SKscheduler object or NULL if not enough memory

◆ SOPC_SKscheduler_AddTask()

SOPC_ReturnStatus SOPC_SKscheduler_AddTask ( SOPC_SKscheduler * sko,
SOPC_SKBuilder * skb,
SOPC_SKProvider * skp,
SOPC_SKManager * skm,
uint32_t msPeriod )

Creates a periodic task to call builder every msPeriod milliseconds. Ownership of SOPC_SKBuilder and SOPC_SKProvider is moved to the SOPC_SKscheduler Note : If Builder or Provider instance should be shared, these could be wrapped in an instance with a specific Clear function.

Parameters
skoPointer to Security Keys Scheduler. Should not be NULL
skbPointer to Security Keys Builder. Should not be NULL
skpPointer to Security Keys Provider. Should not be NULL
skmPointer to Security Keys Manager. Should not be NULL
msPeriodThe period in milliseconds
Returns
SOPC_STATUS_OK if keys are set otherwise a bad status

◆ SOPC_SKscheduler_Start()

SOPC_ReturnStatus SOPC_SKscheduler_Start ( SOPC_SKscheduler * sko)

Starts a Security Keys Scheduler.

Parameters
skoPointer to Security Keys Scheduler. Should not be NULL
Returns
SOPC_STATUS_OK if the SKscheduler is started otherwise a bad status

◆ SOPC_SKscheduler_Stop()

SOPC_ReturnStatus SOPC_SKscheduler_Stop ( SOPC_SKscheduler * sko)

Stops a Security Keys Scheduler.

Parameters
skoPointer to Security Keys Scheduler. Should not be NULL

◆ SOPC_SKscheduler_StopAndClear()

void SOPC_SKscheduler_StopAndClear ( SOPC_SKscheduler * sko)

Stops a Security Keys Scheduler and deallocate data bytes content. This object should not be used after a call to this function.

Parameters
skoPointer to Security Keys Scheduler. Should not be NULL