# null

[Open topic with navigation](../../../../../CANoeDEFamily.htm#Topics/CAPLFunctions/MOST/EventProcedures/CAPLfunctionOnMOSTMHPPacket.md)

**CAPL Functions** » [MOST](../CAPLfunctionsMOSTOverview.md) » OnMostMHPPacket

# OnMostMHPPacket

[Valid for](../../../Shared/FeatureAvailability.md): CANoe DE

**Note**\
`OnMostMHPPacket` can only be used in the **Measurement Setup** and should be inserted under the item "Callback function".\
For simulation of a MOST High connection sender and receiver in CAPL, the MOST High DLL can be used. The DLL is located in the Exec32 folder of the MOST High Demos.

## Function Syntax

```plaintext
long OnMostMHPPacket(long sourceDevID, long destDevID, long fBlockID, long instID, long functionID, long opType);
```

## Description

The event procedure is called up as soon as a MOST High packet is finished.

Within this event procedure, the following functions are available:

* `long mostMHPPacketIsSpy()`

  Indicates whether the packet was made up of Spy messages.\
  **Parameters**: None\
  **Returns**:\
  0: Comprised of node messages\
  1: Comprised of Spy messages

* `long mostMHPPacketVersion()`

  Indicates the used MOST High Protocol version.\
  **Parameters**: None\
  **Returns**:

* `long mostMHPPacketNegAcks()`

  Indicates the number of negative frame acknowledge messages.\
  **Parameter**: None\
  **Returns**: Number of NegAcks (see MHP specification)

* `long mostMHPPacketFrameRequests()`

  Indicates the number of single or multiple frame request messages.\
  **Parameter**: None\
  **Returns**: Number of (multiple) frame requests

* `long mostMHPPacketBlockRequests()`

  Indicates the number of block request messages.\
  **Parameter**: None\
  **Returns**: Number of block requests

* `long mostMHPPacketWarnings()`

  Indicates the number of MHP observer warnings. Warnings may indicate communication problems.\
  **Parameter**: None\
  **Returns**: Number of Observer warnings

* `long mostMHPPacketErrors()`

  Indicates the number of MHP Observer errors. Errors indicate MOST High Protocol violations.\
  **Parameter**: None\
  **Returns**: Number of Observer errors

The functions [mostEventChannel()](../Functions/CAPLfunctionMOSTEvent.md), [mostEventTime()](../Functions/CAPLfunctionMOSTEvent.md), and [mostEventTimeNS()](../Functions/CAPLfunctionMOSTEvent.md) can be used to call up supplemental information.

## Parameters

* **sourceDevID**: Address of the transmitter
* **destDevID**: Address of the receiver
* **fBlockID**: FBlockID of the receiver
* **instID**: Instance ID of the receiver
* **functionID**: FunctionID of the receiver
* **opType**: OpType of the receiver

## Return Values

The return value determines whether the MHP packet event is relayed to the next function block in the Measurement Setup (e.g., a Trace Window).

* **0**: No relay
* **1**: Relay

## Example

—

[MOST High Protocol: Simulation of Sender and Receiver](../../../CANoeCANalyzer/MOST/MOSTSimulationApplicationSocketLocalFBlockList.md) • [OnMostMHPBlock](CAPLfunctionOnMOSTMHPBlock.md) • [OnMostMHPError](CAPLfunctionOnMOSTMHPError.md) • [mostMHPPacketSetTraceColors](../Functions/CAPLfunctionMOSTMHPPacketSetTraceColors.md) • [MOST High Observer and Combiner](../CAPLfunctionsMOSTHighObserverCombiner.md)
