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 SinceMinimum Operating System
CoPilot 9.2Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

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

Parameters

ParameterDescription
pSectionName of the section
pVariableName of the variable
iValueString 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 SinceMinimum Operating System
CoPilot 9.2Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

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

Parameters

ParameterDescription
pSectionName of the section
pVariableName of the variable
sValueString 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 SinceMinimum Operating System
CoPilot 9.2Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

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

Parameters

ParameterDescription
pSectionName of the section
pVariableName 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 SinceMinimum Operating System
CoPilot 9.2Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

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

Parameters

ParameterDescription
pSectionName of the section
pVariableName 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 SinceMinimum Operating System
CoPilot 9.2Windows 10, Android 4.1

Syntax (Prototyped in alkmsg.h)

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

Parameters

ParameterDescription
pfnProcessMsgcallback function of type MsgConfigRspCallback
conventionCalling 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

ParameterDescription
callbackFunctionNamecallback function name of type MsgConfigRspCallback
conventionCalling convention. Should use convention_default.
callBackObjPass 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 SinceMinimum Operating System
CoPilot 9.2Windows 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

ParameterDescription
pSectionName of the section (Should be same as used by Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal while sending request to CoPilot)
pVariableName of the variable (Should be same as used by Msg_ConfigSetIntVal, Msg_ConfigSetStrVal, Msg_ConfigGetIntVal, Msg_ConfigGetStrVal while sending request to CoPilot)
iValueCurrent value (will be -1 if the request is for string value)
pValueCurrent Value (will be empty if the request is for int/bool value)

Possible Values that can be set using Config APIs

DescriptionSection HeaderSection StringDefault ValueOptionsAdditional Information
Hide Button[Application]“ButtonStateHide”=0disable=1, hide=2
Quit Button[Application]“ButtonStateQuit”=0disable=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”=0Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
CoPilot position Y[Graphics]“ScreenYPos”=0Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
Screen resolution X[Graphics]“ForceScreenX”=240Only required for CoPilot Laptop version. Other platforms use ALK_StartCoPilotEx
Screen resolution Y[Graphics]“ForceScreenY”=320Only 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”=0ON WITH GPS= 0, ON ALWAYS = 1 ON NEAR TURN =2 NEVER ON =3
Last updated July 11, 2023.
Contents