Thingstream Client Library  BLD4131-v2.13
Functions

Porting functions implemented by the target for use by the SDK. More...

Collaboration diagram for Platform functions:

Functions

uint32_t Thingstream_Platform_getTimeMillis (void)
 
const char * Thingstream_Platform_getTimeString (void)
 
void Thingstream_Platform_puts (const char *str, int len)
 
void Thingstream_Platform_assertionFailure (int location, const char *expr)
 

Detailed Description

Porting functions implemented by the target for use by the SDK.

Function Documentation

◆ Thingstream_Platform_assertionFailure()

void Thingstream_Platform_assertionFailure ( int  location,
const char *  expr 
)

Report an assertion failure. When using the debug version of the SDK, calls will be made to this function to report errors. For example, when invalid parameters are passed to SDK functions. It is strongly recommended that this version of the SDK is used during development, and that this function is implemented in such a way that it is very obvious that it has been called.

Parameters
locationa representation of the location of the problem
exprdetails of the problem

◆ Thingstream_Platform_getTimeMillis()

uint32_t Thingstream_Platform_getTimeMillis ( void  )

Return the current time in milliseconds. May return milliseconds since system start, epoch, or any other reference point. This is used by the client for measuring time intervals only.

Returns
the time in milliseconds.

◆ Thingstream_Platform_getTimeString()

const char* Thingstream_Platform_getTimeString ( void  )

Returns a string representation of the current time (e.g. for logging)

Optional The SDK provides a very simple implementation of this function that formats the milliseconds as if it were a floating point number of seconds to 3 decimal places. e.g. 51234.351

If you wish loggers to use an alternative format, e.g. local time, then the platform should implement this function.

Returns
the string representation of the time (in statically allocated memory)

◆ Thingstream_Platform_puts()

void Thingstream_Platform_puts ( const char *  str,
int  len 
)

Output a string to a debugging stream.

Optional only needed if Thingstream_Util_printf() is called.

Parameters
strthe string to be written (may not be 0-terminated)
lenthe number of characters to write (may be zero).