nmpHardwareButtonsEnable (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2i pro, CX1 pro/flex/warp, SX1, MX2 turbo, NX-200, NX-400, NX-900, LX2

Firmware version:

2.84 / 1.00.00

Nav. API level:

2


This function will enable or disable the hardware buttons on the NMP.

 

 

Input:

enable : BOOL (default : true)

This determines if the buttons are enabled and can raise the "Hardware Button Pressed" event.

 

led_state : SINT (default : -1)

Determines the state of the keyboard LED.

-1

- Follow-enabled state (turned on when keys are enabled, turned off when they are not).

0

- Turns LED off.

1

- Turns LED on.

2..4

- Blinks LED by using a different pattern.

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- Failed to enable buttons.

-11

- This is not supported by the device (the device is not an NMP device).

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION nmpHardwareButtonsEnable : INT;
VAR_INPUT
  enable   : BOOL := TRUE;
  led_state : SINT := -1;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc : INT;
END_VAR;
BEGIN
  ...
  // Enable buttons and turn on LED
  rc := nmpHardwareButtonsEnable();
  IF rc <> 0 THEN
    DebugFmt(message := "Error: nmpHardwareButtonsEnable=\1", v1 := rc);
  END_IF;
  ...
END;
END_PROGRAM;