Skip to main content

C2xGetStationHandle

Valid for: CANoe DE

Function Syntax

long C2xGetStationHandle(long packetHandle);
long C2xGetStationHandle(char *dbNodeName);

Description

Retrieve an ITS Station handle associated with a received packet or a database node. The handle can be used as input for the other functions of the Station API.

Parameters

  • packetHandle: Handle of the received packet. This function is only usable in a CAPL callback that had been registered with C2xReceivePacket or with C2xRegisterCallback for Receive Indications.
  • dbNodeName: Name of a database node. Returns the handle of the station which is assigned to the database node in the StationManager.

Return Values

  • 0: Not available or failure
  • ≠0: Station handle

Example

void OnC2xPacket (LONG channel, LONG dir, LONG radioChannel, LONG signalStrength, LONG sigQuality, LONG packet)
{
  long rxStationHdl;
  long dbStationHdl;

  rxStationHdl = C2xGetStationHandle(packet);
  dbStationHdl = C2xGetStationHandle("nodename");
}