S2OPC OPCUA Toolkit
Functions
sopc_random.h File Reference

A platform independent API to retrieve random data from platform. More...

#include "sopc_buffer.h"

Go to the source code of this file.

Functions

SOPC_ReturnStatus SOPC_GetRandom (SOPC_Buffer *buffer, uint32_t length)
 Retrieve random data and put it in a buffer. More...
 

Detailed Description

A platform independent API to retrieve random data from platform.

Note
Only implemented for Linux.

Function Documentation

◆ SOPC_GetRandom()

SOPC_ReturnStatus SOPC_GetRandom ( SOPC_Buffer buffer,
uint32_t  length 
)

Retrieve random data and put it in a buffer.

Parameters
bufferThe buffer which will receive the data. Needs to be allocated (with SOPC_Buffer_Create()) before calling the function.
lengthLength of the random data wanted.
Returns
SOPC_STATUS_OK in case of success, SOPC_STATUS_NOK in case of error.