RTI Connext Micro C++ API Version 4.3.0
Loading...
Searching...
No Matches
OSAPI System API

Abstract System API. More...

Classes

struct  OSAPI_SystemI
 System API. More...
 
struct  OSAPI_TaskProperty
 Task properties. More...
 
struct  OSAPI_SystemProperty
 The System Properties. More...
 

Macros

#define OSAPI_SYSTEM_MAX_HOSTNAME   (64)
 Maximum hostname length.
 
#define OSAPI_TaskProperty_INITIALIZER
 Initializer for OSAPI_TaskProperty.
 
#define OSAPI_SystemProperty_INITIALIZER
 Initializer for OSAPI_SystemProperty.
 

Typedefs

typedef RTI_BOOL(* OSAPI_System_start_timer_T) (OSAPI_Timer_T self, OSAPI_TimerTickHandlerFunction tick_handler)
 Start a OSAPI timer.
 
typedef RTI_INT32(* OSAPI_System_get_timer_resolution_T) (void)
 Get the resolution of the clock driving the timer in nano seconds.
 
typedef RTI_BOOL(* OSAPI_System_get_time_T) (OSAPI_SystemTime *now)
 Get the current system time.
 
typedef RTI_BOOL(* OSAPI_System_initialize_T) (void)
 Initialize the system.
 
typedef RTI_BOOL(* OSAPI_System_get_hostname_T) (char *const hostname)
 Get the hostname.
 
typedef RTI_BOOL(* OSAPI_System_generate_uuid_T) (struct OSAPI_SystemUUID *uuid_out)
 Generate a unique universal identifier (UUID).
 
typedef RTI_BOOL(* OSAPI_System_get_ticktime_T) (RTI_INT32 *sec, RTI_UINT32 *nanosec)
 Get current tick time.
 
typedef struct OSAPI_SystemI OSAPI_SystemI
 System API.
 

Detailed Description

Abstract System API.

The System is defined as the physical or virtual execution environment and implements functions that are not necessarily provided by the operating system. For example, a custom embedded board may include a special real-time clock which is synchronized via GPS, but is not available via a regular OS system call.

The following functions are not thread-safe:

Macro Definition Documentation

◆ OSAPI_SYSTEM_MAX_HOSTNAME

#define OSAPI_SYSTEM_MAX_HOSTNAME   (64)

Maximum hostname length.

◆ OSAPI_TaskProperty_INITIALIZER

#define OSAPI_TaskProperty_INITIALIZER
Value:
{\
{ /* OSAPI_ThreadProperty */ \
OSAPI_THREAD_PRIORITY_DEFAULT,\
},\
100\
}
#define OSAPI_THREAD_USE_OSDEFAULT_STACKSIZE
Use the default stack size when creating a thread.
Definition osapi_thread.h:90
#define OSAPI_THREAD_DEFAULT_OPTIONS
Use only the default options the OS provides when creating a thread.
Definition osapi_thread.h:98

Initializer for OSAPI_TaskProperty.

◆ OSAPI_SystemProperty_INITIALIZER

#define OSAPI_SystemProperty_INITIALIZER
Value:
{\
OSAPI_TimerProperty_INITIALIZER,\
{0},\
32,\
8,\
}
#define OSAPI_TaskProperty_INITIALIZER
Initializer for OSAPI_TaskProperty.
Definition osapi_system.h:348

Initializer for OSAPI_SystemProperty.

Typedef Documentation

◆ OSAPI_System_start_timer_T

typedef RTI_BOOL(* OSAPI_System_start_timer_T) (OSAPI_Timer_T self, OSAPI_TimerTickHandlerFunction tick_handler)

Start a OSAPI timer.

Parameters
self<<in>> Timer object.
tick_handler<<in>> Timer handle.
Returns
RTI_TRUE on success, RTI_FALSE on failure.

◆ OSAPI_System_get_timer_resolution_T

typedef RTI_INT32(* OSAPI_System_get_timer_resolution_T) (void)

Get the resolution of the clock driving the timer in nano seconds.

This function must return the frequency of the system timer used to implement OSAPI_SystemI::start_timer and OSAPI_SystemI::stop_timer API.

Returns
timer resolution in nanoseconds.

◆ OSAPI_System_get_time_T

typedef RTI_BOOL(* OSAPI_System_get_time_T) (OSAPI_SystemTime *now)

Get the current system time.

In general, the system time is used by components to correlate both internal and external events, such as data reception and ordering. Thus, it is recommended that this function returns the real time. However, it is not strictly required.

Notes: - It is assumed that the time returned by get_time is monotonically increasing. It is up to the implementation of this function to ensure this holds true.

- It is ok to return the same time as the last call.

- The clock used to report real-time can be different than the clock used to support start_timer and stop_timer.

Parameters
now<<out>> Time.
Returns
RTI_TRUE on success, RTI_FALSE on failure.

◆ OSAPI_System_initialize_T

typedef RTI_BOOL(* OSAPI_System_initialize_T) (void)

Initialize the system.

This function initializes the system and calls the port specific initialize method first. The port specific initialization method must return RTI_TRUE on success and RTI_FALSE on failure. A system can only be initialized once.

Returns
RTI_TRUE on success, RTI_FALSE on failure.

◆ OSAPI_System_get_hostname_T

typedef RTI_BOOL(* OSAPI_System_get_hostname_T) (char *const hostname)

Get the hostname.

Parameters
hostname<<out>> The buffer to store the hostname. Must be at least OSAPI_SYSTEM_MAX_HOSTNAME bytes. If the actual hostname is longer than OSAPI_SYSTEM_MAX_HOSTNAME bytes (including the NUL termination) the hostname is truncated.
Returns
RTI_TRUE on success, RTI_FALSE on failure.

◆ OSAPI_System_generate_uuid_T

typedef RTI_BOOL(* OSAPI_System_generate_uuid_T) (struct OSAPI_SystemUUID *uuid_out)

Generate a unique universal identifier (UUID).

Parameters
uuid_out<<out>> The generated UUID value
Returns
RTI_TRUE on success, RTI_FALSE on failure

◆ OSAPI_System_get_ticktime_T

typedef RTI_BOOL(* OSAPI_System_get_ticktime_T) (RTI_INT32 *sec, RTI_UINT32 *nanosec)

Get current tick time.

The ticktime is a time measurement used by Micro to determine how much time has elapsed in a period. It does not have to be an absolute time, but it must be monotonically increasing. For this reason it is important to choose the time source with care. For example, the system time may mbe adjusted backward or forward and this could affect the measure time lapse. The resolution of the tick time is expected to be no less than the system timer, although it is not a requirement.

Parameters
sec<<out>> The current ticktime in seconds
nanosec<<out>> Additional nanoseconds in the current ticktime
Returns
RTI_TRUE on success, RTI_FALSE on failure.

◆ OSAPI_SystemI

typedef struct OSAPI_SystemI OSAPI_SystemI

System API.

The methods in this interface are called by the corresponding OSAPI_System function. For example, OSAPI_System_get_time() calls system->get_time().