Skip to main content

Entry points

These are the functions used to communicate with the SDK, they are published by the library

  • LoadSDK : load the SDK in memory
  • UnloadSDK : unload SDK from memory
  • SetParam : send parameters to the SDK (for logging purpose)
  • SendEvent : send messages to the SDK (for initializing, display, compute routes, etc.)

They return an error value (integer 32 bits) that can be :

ValueName
0SDK_JOB_OK
-1SDK_EXCEPTION_ERROR
-2SDK_INIT_NOCALLBACK
-3SDK_NOT_INITIALIZED
-4SDK_EVENT_NOTSENT
-5SDK_ALREADY_LOADED
-6SDK_UNKNOWN_PARAMETER
-7SDK_INVALID_VALUE

Load SDK

This function loads the SDK in memory, sets the callback function and returns an error code.

Syntax

LoadSDK(callbackFunction, 0);

Callback function

The callback function is a void function of type :

Deplhi
type
TCallbackFunction = procedure(Data: PWideChar); stdcall;
C++
void __stdcall onReceiveData(char* Data);

Each time the SDK needs to send information to the calling application, the callback function is used sending a Json string describing the message.

Warning

The amount of messages sent can be important.
We recommend to store them in a FIFO stack and process them outside of the callback function.

Unload SDK

This function frees the SDK from the memory and returns an error code (usually SDK_JOB_OK)

Syntax

UnloadSDK();
Note

See Closing the SDK on Get Started page for examples

Recommendation

It is strongly recommended to call this function before unloading the library.

Set Param

Sets the log level or the log directory to the SDK and returns an error code.

Syntax

SetParam(parameterName, parameterValue);

Both parameterName and parameterValue are strings.

parameterName : LOGDIRECTORY

parameterValue is a string containing a directory, accessible by the library, for logging files.

parameterName : LOGLEVEL

parameterValue can by one of these values :

ValueDescription
NONESDK won't log anhthing
FATALSDK will log fatal errors
ERRORSDK will log errors and above
WARNINGSDK will log warnings and above
INFOSDK will log general processing informations and above
DEBUGSDK will log debug messages and above (use only when debugging)
TRACESDK will log trace messages and above (use only when debugging)
Note

Each level includes the logs from the previous level.

Example: INFO level includes WARNING, ERROR and FATAL.

parameterName : LOGRETENTION

parameterValue is a string containing the number of retention days for logging files.

Send Event

Send event messages to the SDK and returns an error code.

Syntax

SendEvent(eventMessage);

eventMessage is a Json String for the message

Example : Get available roadmaps
{
"type": "AVAILABLE_ROADMAPS",
"payload": {},
"author": "<application id>",
"recipients": [
"<sdk id>"
],
"status": "SENT"
}