Skip to main content

Configuration Settings

Contents

Msg_ConfigSetIntVal

To configure CoPilot settings that are saved as a file in user.cfg – contained in program files/copilot folder. This API is used to set the integer or boolean variables values. For Boolean use 0 or 1

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

long Msg_ConfigSetIntVal(const char* pSection,
   const char* pVariable,
   int iValue);

Parameters

Parameter Description
pSection Name of the section
pVariable Name of the variable
iValue String Value of the variable that needs to be set.

Example

Msg_ConfigSetIntVal(“SDK”, “AutomateMapUpdate”, 0);

This will appear in user.cfg as follows

[SDK]

“AutomateMapUpdate”=0

Return Value

  • -1 (Signifies Error in sending);

Any Positive values signifies success.

To receive a response from CoPilot use Msg_AddConfigCallback.


Msg_ConfigSetStrVal

In order to configure CoPilot settings that are saved as a file in user.cfg – contained in program files/CoPilot folder. This API is used to set the string variables value.

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

long Msg_ConfigSetStrVal(const char* pSection,
   const char* pVariable,
   const char* sValue);

Parameters

Parameter Description
pSection Name of the section
pVariable Name of the variable
sValue String Value of the variable that needs to be set.

Return Value

  • -1 (Signifies Error in sending);

Any Positive values signifies success.

To receive a response from the CoPilot use Msg_AddConfigCallback.


Msg_ConfigGetIntVal

In order to configure CoPilot settings that are saved as a file in user.cfg – contained in program files/CoPilot folder. This API is used to retrieve the integer or boolean variables values.

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

long Msg_ConfigGetIntVal(const char* pSection, const char* pVariable);

Parameters

Parameter Description
pSection Name of the section
pVariable Name of the variable

Return Value

  • -1 (Signifies Error);

Any Positive values signifies success.

Client Application will need to set the callback function to using Msg_AddConfigCallback to receive response from CoPilot.


Msg_ConfigGetStrVal

In order to configure CoPilot settings that are saved in user.cfg – contained in program files/CoPilot folder. This API is used to retrieve the string variables value.

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

long Msg_ConfigGetStrVal(const char* pSection, const char* pVariable);

Parameters

Parameter Description
pSection Name of the section
pVariable Name of the variable

Return Value

  • -1 (Signifies Error);

Any Positive values signifies success.

Client Application will need to set the callback function to using Msg_AddConfigCallback to receive response from CoPilot.


Msg_AddConfigCallback

This is used to add a callback to receive the messages from CoPilot when setting or getting the values using Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal.

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

long Msg_AddConfigCallback (void *fnProcessMsg, callingConvention convention =
convention_default);

Parameters

Parameter Description
pfnProcessMsg callback function of type MsgConfigRspCallback
convention Calling convention Managed Apps (.Net client application) should use convention_stdcall Other apps including native should use convention_default

For Android and using JNI layer

Syntax (Prototyped in AlkMsg.java)

long Msg_AddConfigCallback (String callbackFunctionName,
   int convention,
   Object callBackObj);

Parameters

Parameter Description
callbackFunctionName callback function name of type MsgConfigRspCallback
convention Calling convention. Should use convention_default.
callBackObj Pass the object of the class which implemented CallbackFunctionName method so JNI layer will call this method once message arrived.

Return Value

  • -1 - (Signifies that there was an error);

  • 0 or any positive value (Signifies that value is set successfully)

Enum

enum callingConvention
{
convention_default,
convention_cdecl,
convention_stdcall
};

Msg_ConfigRspCallback

This is the definition of the callback function for receiving response from CoPilot when using Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal

Supported Since Minimum Operating System
CoPilot 9.2 Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

typedef void (_CONVENTION *MsgConfigRspCallback) (const char* pSection,
   const char* pVariable,
   const int iValue,
   const char* pValue);

For Android and using JNI layer

Syntax (Prototyped in AlkMsg.java)

void MsgConfigRspCallback ( String pSection,
   String pVariable,
   int iValue,
   String pValue);

Parameters

Parameter Description
pSection Name of the section (Should be same as used by Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal while sending request to CoPilot)
pVariable Name of the variable (Should be same as used by Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal while sending request to CoPilot)
iValue Current value (will be -1 if the request is for string value)
pValue Current Value (will be empty if the request is for int/bool value)

Possible Values that can be set using Config APIs

Description Section Header Section String Default Value Options Additional Information
Hide Button [Application] “ButtonStateHide” =0 disable=1, hide=2
Quit Button [Application] “ButtonStateQuit” =0 disable=1, hide=2
Quickstart Launch menu [Application] “HomeScreen2” =popup_startmenu “#default” to disable
Disable warning pop up messages [User Settings] “ShowPopups” =TRUE =0 to disable
Sign Post view [User Settings] “SignPostView” =1 =0 to disable the signpost information
Safety Cameras [Safetycam] “Enabled” =0 =1 to enable
Speed Limit display [Speed Warnings] “DisplaySpeedLimit” =0 =2 always display
Speed Limit over speed warning [Speed Warnings] “SpeedWarningThreshold” =10 = mph/kph above the speed limit warning to be displayed
Imperial / Metric [User Settings] “DistUnits” =0 =1 metric
[Graphics] “SpriteAnimations” =1 =0 To disable
Vehicle Type at Launch [User Settings] “TruckModeAtLaunch” =0 =1 To always launch in Truck
CoPilot position X [Graphics] “ScreenXPos” =0 Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
CoPilot position Y [Graphics] “ScreenYPos” =0 Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
Screen resolution X [Graphics] “ForceScreenX” =240 Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
Screen resolution Y [Graphics] “ForceScreenY” =320 Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
GPS Port Number [GPSInfo] “PortNum” =
GPS Baud rate [GPSInfo] “BaudRate” =
Audio announcement ‘Welcome to CoPilot’ [Application] “PlayWelcome” =1 =0 disable
Disable automatic downloads of map updates [SDK] “AutomateMapUpdate” =1 =0 disable
Boolean
Provide notification once user is X distance away from destination [SDK] “NotificationXDist” =0 = N N is going to be any integer value in multiplication of 10. If user want to have notification at 0.3 miles away from destination, user need to set 3 If user want to have notification at 1 mile away from destination then user need to pass 10.
Backlight control [User Settings] “Backlight” =0 ON WITH GPS= 0, ON ALWAYS = 1 ON NEAR TURN =2 NEVER ON =3
Last updated June 6, 2024.
Contents