Skip to main content

C2xInitPacket

Open topic with navigation CAPL Functions » Car2x » C2xInitPacket

Function Syntax

  • long C2xInitPacket( void );
  • long C2xInitPacket( char protocolDesignator[] );
  • long C2xInitPacket( char protocolDesignator[], char packetTypeDesignator[] );
  • long C2xInitPacket( long packetToCopy );
  • long C2xInitPacket( long rawDataLength, byte rawData[] );
  • long C2xInitPacket( long rawDataLength, char rawData[] );
  • long C2xInitPacket( long rawDataLength, struct * rawDataStruct );

Description

This function creates a new WLAN packet. Other functions can access the newly created packet with the returned handle. Protocol fields that are marked as InitProtocol in the protocol description are initialized.

Parameters

  • protocolDesignator: Designator of the protocol, which should be used for initialization.
  • packetTypeDesignator: Designator of the packet type.
  • packetToCopy: Handle of a packet created with C2xInitPacket before or handle of a packet received within a callback (OnC2xPacket). The header and the data of this packet are copied to the newly created packet.
  • rawDataLength: Length of rawData in bytes.
  • rawData/rawDataStruct: Raw data of a WLAN packet that is used to initialize the new packet.

Return Values

With C2xGetLastError, you can check if the function has been processed successfully.
  • 0: —
  • ≠0: Handle of the created packet.

Example

See Also: C2xGetLastError