void OnStationAttributeTrigger(char attrName[])
{
long stationHandle;
char stationName[200];
stationHandle = C2xGetStationHandle("%NODE_NAME%");
if (stationHandle != 0 && C2xGetStationName(stationHandle, elCount(stationName), stationName) == 0)
{
// For all attributes of this station
write("CAPL Node '%NODE_NAME%', Car2x/V2x station '%s', %f sec : OnStationAttributeTrigger called - Attribute '%s' = %f" ,
stationName,
TimeNowNS()/1e9 ,
attrName,
C2xGetStationAttributeDouble(attrName));
// For concrete attribute of this station
if (strncmp(attrName,"Speed",strlen(attrName)) == 0)
{
write("Car2x/V2x Station '%s', %f sec : OnStationAttributeTrigger called - Station Speed = %f",
stationName,
TimeNowNS()/1e9 ,
C2xGetStationAttributeDouble("Speed"));
}
}
}