Entry points
These are the functions used to communicate with the SDK, they are published by the library
LoadSDK
: load the SDK in memoryUnloadSDK
: unload SDK from memorySetParam
: 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 :
Value | Name |
---|---|
0 | SDK_JOB_OK |
-1 | SDK_EXCEPTION_ERROR |
-2 | SDK_INIT_NOCALLBACK |
-3 | SDK_NOT_INITIALIZED |
-4 | SDK_EVENT_NOTSENT |
-5 | SDK_ALREADY_LOADED |
-6 | SDK_UNKNOWN_PARAMETER |
-7 | SDK_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.
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();
See Closing the SDK
on Get Started page for examples
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 :
Value | Description |
---|---|
NONE | SDK won't log anhthing |
FATAL | SDK will log fatal errors |
ERROR | SDK will log errors and above |
WARNING | SDK will log warnings and above |
INFO | SDK will log general processing informations and above |
DEBUG | SDK will log debug messages and above (use only when debugging) |
TRACE | SDK will log trace messages and above (use only when debugging) |
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
{
"type": "AVAILABLE_ROADMAPS",
"payload": {},
"author": "<application id>",
"recipients": [
"<sdk id>"
],
"status": "SENT"
}