Skip to content

Other

Function: Sleep

void Sleep(int milliseconds)

Description:
Pauses the execution of the application for a specified number of milliseconds.

Parameters:
- milliseconds: The amount of time, in milliseconds, for which the application should pause.

Usage Example
1
2
3
PrintLine("Pausing for 2 seconds...");
Sleep(2000);
PrintLine("Resumed!");

Function: GetCurrentSortableTimeStamp

string GetCurrentSortableTimeStamp()

Description:
Retrieves a timestamp string formatted for easy sorting.

Return Value:
Returns a sortable timestamp string.

Usage Example
string timeStamp = GetCurrentSortableTimeStamp();
PrintLine($"Current Sortable Timestamp: {timeStamp}");

Function: GetCurrentUnixTimeStamp

double GetCurrentUnixTimeStamp()

Description:
Gets the current Unix timestamp.

Return Value:
Returns the current Unix timestamp as a double.

Usage Example
double unixTimeStamp = GetCurrentUnixTimeStamp();
PrintLine($"Current Unix Timestamp: {unixTimeStamp}");

Function: SaveBytesToFile

void SaveBytesToFile(string filename, byte[] data)

Description:
Saves a byte array to a specified file.

Parameters:
- filename: The name of the file where the byte array should be saved.
- data: The byte array to save.

Usage Example
1
2
3
byte[] sampleData = { 0x01, 0x02, 0x03 };
SaveBytesToFile("sampleData.bin", sampleData);
PrintLine("Saved data to sampleData.bin");

Function: SaveTextToFile

void SaveTextToFile(string filename, string data)

Description:
Saves a string to a specified file.

Parameters:
- filename: The name of the file where the string should be saved.
- data: The string to save.

Usage Example
1
2
3
string sampleText = "Hello, World!";
SaveTextToFile("greeting.txt", sampleText);
PrintLine("Saved greeting to greeting.txt");

Function: GetInterfaceType

int GetInterfaceType()

Description:
Retrieves the type of interface being used.

Return Value:
Returns an integer representing the interface type.

value Description
-1 Interface not selected
0 D-PDU API Interface (VAS6154 or VAS5054)
1 J2534 Interface
2 DoIP Connection
3 ELM-compatible interface
Usage Example
int interfaceType = GetInterfaceType();
string msg = interfaceType switch
{
    0 => "VAS Interface",
    1 => "J2534 Interface",
    2 => "DoIP",
    3 => "ELM",
    _ => "No interface
};
PrintLine($"Interface used: {msg}");