OnMostPkt
Valid for: CANoe DEFunction Syntax
OnMostPkt(long pktdatalen);
Description
When a packet is received over the Asynchronous Channel theOnMostPkt() event procedure is called.
The following functions are available for evaluating the event:
long mostPktMsgChannel()- Returns the channel of the packet event.
long mostPktMsgTime()- Returns the time stamp of the event (Units: 10 µs).
float mostPktMsgTimeNs()- Returns the time stamp of the event (Units: 1 ns).
long mostPktOrigTime()- Returns the hardware generated time stamp of the event (Units: 10 µs).
long mostPktSrcAdr(), long mostPktDestAdr()- Returns the source or destination address
long mostPktDir()- Returns the direction of transmission (Rx=0, Tx=1, TxRequest=2)
long mostPktArbitration()- Returns the packet arbitration value
long mostPktDlc()- Number of transported data bytes (= Source address + Number of used quadlets = 2 + N*4; N = 0,1,2…)
long mostPktGetData(byte[] buffer, long cnt)- Tries to copy cnt data bytes to a provided buffer. Returns the actual number of copied bytes.
long mostPktGetSelData(byte[] buffer, long begin, long cnt)- Tries to copy cnt data bytes starting at byte position ‘begin’ to a provided buffer. Returns the actual number of copied bytes.
long mostPktTelID()- Returns the TelID of the packet (upper four bits of data byte 4)
long mostPktTelLen()- Returns the TelLen of the packet (comprised of data bytes 4 and 5)
long mostPktIsSpy()- Returns 1 if the packet was received over the Spy of the asynchronous channel, otherwise 0.
long mostPktAck()- Returns the acknowledge code (MOST150 only).
long mostPktPAck- Returns the preemptive acknowledge from the potential packet receiver(s) to the packet transmitter (for mostEthPktIsSpy()=1 and MOST150).
(0x00: No Response; 0x01: Buffer full; 0x04: OK)
- Returns the preemptive acknowledge from the potential packet receiver(s) to the packet transmitter (for mostEthPktIsSpy()=1 and MOST150).
long mostPktCRC- Returns the CRC value (for mostPktIsSpy()=1 and MOST150).
long mostPktCAck()- Returns the CRC acknowledge code (for mostPktIsSpy()=1 and MOST150).
(0x00: No Response; 0x01: CRC error; 0x04: OK)
- Returns the CRC acknowledge code (for mostPktIsSpy()=1 and MOST150).
Parameters
- pktdatalen: Number of data bytes of the packet.