long packetHandle;
char error[100];
byte macAddress[6] = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x01 };
// create packet
packetHandle = C2xInitPacket("geo_eh");
if (C2xGetLastError() == 0)
{
// Set protocol fields
C2xSetTokenData( packetHandle, "wlan", "address2", 6, macAddress );
C2xSetTokenData( packetHandle, "eth", "source", 6, macAddress );
// set EH values
C2xSetTokenInt( packetHandle, "geo_eh", "lpvSpeed", 100 );
C2xSetTokenInt( packetHandle, "geo_eh", "lpvHeading", 1800 );
C2xSetTokenInt( packetHandle, "geo_eh", "lpvAltitude", 0 );
// Complete and send packet
C2xCompletePacket( packetHandle );
// Dispatch the packet in tx direction
C2xDispatchPacket( packetHandle, 1);
// Release packet
C2xReleasePacket( packetHandle );
}
else
{
C2xGetLastErrorText( elCount(error), error );
write("Error: %s", error );
}