Friendly LWM2M client
wpp::WppPlatform Class Reference

The WppPlatform class provides a platform-specific implementation for the Wpp library. More...

#include <WppPlatform.h>

+ Collaboration diagram for wpp::WppPlatform:

Static Public Member Functions

static time_t getTime (void)
 Returns the number of seconds elapsed since a specific origin. More...
 
static void print (const char *msg, va_list arg)
 Prints a formatted message. More...
 
static void print (const char *msg,...)
 Prints a formatted message. More...
 

Detailed Description

The WppPlatform class provides a platform-specific implementation for the Wpp library.

This class uses the Linker Callback pattern, where the implementation of methods is carried out on the user side. It provides functions for retrieving the elapsed time, printing messages, and simplifying the usage of the print function.

The WppPlatform class is designed to be platform-independent and can be used with different operating systems or environments.

See also
wpp::getTime
wpp::print

Definition at line 26 of file WppPlatform.h.

Member Function Documentation

◆ getTime()

static time_t wpp::WppPlatform::getTime ( void  )
static

Returns the number of seconds elapsed since a specific origin.

This function must be implemented by the user and should return the number of seconds elapsed since a specific origin. The origin can be any reference point, such as the system boot time or the Epoch.

Note
Per POSIX specifications, time_t is a signed integer.
+ Here is the caller graph for this function:

◆ print() [1/2]

static void wpp::WppPlatform::print ( const char *  msg,
va_list  arg 
)
static

Prints a formatted message.

This function is used to print a formatted message to the output. It follows the same usage as the C89 printf() function.

Parameters
msgThe format string for the message.
argThe variable arguments list.
See also
wpp::print(const char *, ...)
+ Here is the caller graph for this function:

◆ print() [2/2]

static void wpp::WppPlatform::print ( const char *  msg,
  ... 
)
inlinestatic

Prints a formatted message.

This function is a helpful implementation that simplifies the usage of the print(const char *, va_list) function. It allows the user to directly pass the format string and variable arguments without explicitly using va_list.

Parameters
msgThe format string for the message.
...The variable arguments.
See also
wpp::print(const char *, va_list)

Definition at line 62 of file WppPlatform.h.

+ Here is the call graph for this function: