示例#1
0
/*
 * Overrided from CCarMessage.
 */
void CADCInfoMessage::doAction()
{
#ifndef CENTRAL_ECU_BUILD
	alt_u8 uiNumbers[] = ADC_CHANNEL_NUMBERS;
	char uiAliases[] = ADC_CHANNEL_ALIAS_STRINGS;
	answerMessage(ADC_CONNECTED_CHANNELS, uiNumbers, (alt_u8*) uiAliases);
#endif /* CENTRAL_ECU_BUILD */

}
示例#2
0
int main()
{
	
	//ONCE VEHICLE DEGER ATA
	Vehicle vehicle;
	State state[4];
	
	state[0]=0;
	state[1]=1;
	state[2]=0;
	state[3]=1;
	
	char *name="audi";
	
	setVehicleName(&vehicle,name);
	setVehicleTemp(&vehicle, 1.0,2.0,3.5);
	setVehicleSpeed(&vehicle, 45);
	setVehicleDoor(&vehicle, state[0], state[1], state[2], state[3]);
	setVehicleWheelPressure(&vehicle, 25,30,30,25);
	
	printf("----------------------------------------------------\n");
	printf("Applied Vehicle Properties:\n");
	printf("----------------------------------------------------\n");
	printf("Name: %s\n",vehicle.name);
	printf("Speed: %d\n",vehicle.speed);
	printf("Temperature: (motor) %d , (indoor) %d , (outdoor) %d\n",vehicle.Temp.motor,vehicle.Temp.indoor,vehicle.Temp.outdoor);
	printf("Door: (frontLeft) %d ,(frontRight) %d,(rearLeft) %d,(rearRight) %d\n",vehicle.Door.frontLeft, vehicle.Door.frontRight,vehicle.Door.rearLeft, vehicle.Door.rearRight);
	printf("Wheel Pressure : (frontLeft) %d ,(frontRight) %d ,(rearLeft) %d, (rearRight) %d\n",vehicle.WheelPressure.frontLeft,vehicle.WheelPressure.frontRight,vehicle.WheelPressure.rearLeft,vehicle.WheelPressure.rearRight);
	printf("----------------------------------------------------\n");
	
	printf("open the server\n\n");
	
	int server, port,client;
	port=7777;
	if(initializeConnection(&server,port))
	{
		while(1)
		{
			client=makeConnection(&server);
			
			if(answerMessage(client,&vehicle));
		}
	}

return 0;
}