navWaitEvent (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2, AX9, CX1 pro/flex/warp, SX1, MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

1.40 / 1.00.00

Nav. API level:

1


This function will wait until an event is raised with an optional timeout.

 

An event is a notification that something has happened in the navigation interface.

There are 2 types of events:

1.Events triggered by the application by a request for information (solicited event).
2.Events triggered by the Navigation device (unsolicited event).

 

 

The events are queued until appropriate action is taken as described in this table:

 

Event#

Event

Solicited

Action

1

A reply for a text message is received.

No.

Call navMessageReplyReceive.

2

A text message is received.

No.

Call navMessageReceive.

3

The status for a text message is received.

Yes.

Call navMessageStatusReceive.

4

An ETA update is received.

Yes.

Call navETAReceive.

5

The status af a destination is received.

Yes.

Call navStopReceive.

6

A user ID is received.

Yes.

Call navUserIDReceive.

7

The status of a user is received.

Yes.

Call navUserStatusReceive.

8

The ID of the GPI is received.

Yes.

Call navGPIReceiveID.

9

The progress of the file transfer is updated.

No.

Call navGPIProgressReceive.

10

The progress of the NMP update is updated.

No.

Call nmpUpdateProgressReceive.

11

A button has been pressed on the NMP.

No.

Call nmpButtonPressedReceive.

12

A button has been clicked in an NMP dialog.

No.

Call nmpDialogClickReceive.

13

A hardware button has been pressed on the NMP.

No.

Call nmpHardwareButtonPressedReceive.

14

A submitted custom form has been received.

No.

Call navFormReceive and navFormReceiveDone.

15

A Speed Limit Alert is received.

No.

Call navSpeedLimitAlert.

129

A request to refresh the quick messages.

No.

Optional: Refresh quick-messages

130

A request to refresh the message replies.

No.

Optional: Refresh message replies.

131

A request to refresh the user status list.

No.

Optional: Refresh user status.

132

Connection to navigation device established.

No.

 

133

Connection to navigation device lost.

No.

 

 

navWaitEvent notifies the application of the oldest queued event.

This means that if the appropriate action is not taken, navWaitEvent will continue to report the same event.

 

Note: waiting for an event by using this function will block the calling thread.

 

 

Input:

timeout : INT (-1,0..32000) (default -1)

Timeout period in milliseconds to wait.

0

- Disable timeout. The function will return immediately.

-1

- Wait forever. The function will only return when data is received.

 

Returns: INT

-1

- Navigation interface is not open.

0

- Timeout.

1

- A message reply is received.

2

- A message is received.

3

- A message status is received.

4

- An ETA is received.

5

- A stop status is received.

6

- A user ID is received.

7

- A user status is received.

8

- The ID of the GPI is received.

9

- The GPI transfer progress is updated.

10

- The NMP update progress is updated.

11

- A button has been pressed on the NMP.

12

- A button has been clicked in an NMP dialog.

13

- A hardware button has been pressed on the NMP.

129

- A request to refresh the quick message list is received.

130

- A request to refresh the message reply list is received.

131

- A request to refresh the user status list is received.

132

- Connection to a navigation device is established.

133

- Connection to the navigation device lost.

 

Declaration:

FUNCTION navWaitEvent : INT;
VAR_INPUT
  timeout : INT := -1;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
THREAD_BLOCK navMonitor;
VAR
  event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
  event := navWaitEvent(timeout := -1);
  CASE event OF
    1: ReadMessageReply();
    2: ReadMessage();
    3: ReadMessageStatus();
    4: ReadETA();
    5: ReadStopStatus();
    6: ReadUserID();
    7: ReadUserStatus();
    129: DebugMsg(message := "Request for refresh of quick messages");
    130: DebugMsg(message := "Request for refresh of message replies");
    131: DebugMsg(message := "Request for refresh of user status");
    132: DebugMsg(message := "Navigation device present");
    133: DebugMsg(message := "Navigation device not present");
  ELSE
    DebugFmt(message := "navWaitEvent - event=\1", v1 := event);
  END_CASE;
END_WHILE;
END_THREAD_BLOCK;