Changeset 8852 for trunk/MagicSoft/Cosy/candrv
- Timestamp:
- 02/02/08 13:06:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/candrv/vmodican.cc
r8831 r8852 41 41 42 42 #include "MLog.h" 43 #include "MLogManip.h" 43 44 44 45 ClassImp(VmodIcan); … … 81 82 while (!Send(&msg)); 82 83 83 gLog << "- CAN Bus Termination set to " << (state?"on":"off") << endl;84 gLog << inf2 << "- CAN Bus Termination set to " << (state?"on":"off") << endl; 84 85 } 85 86 … … 95 96 return 0; 96 97 97 gLog << "- Starting Receiver Loop." << endl;98 gLog << inf2 << "- Starting Receiver Loop." << endl; 98 99 99 100 while (1) … … 313 314 while (!Send(&msg)); /* transmitt to module */ 314 315 315 gLog << "- Baudrate set to " << rate << "kbps" << endl;316 gLog << inf2 << "- Baudrate set to " << rate << "kbps" << endl; 316 317 } 317 318 … … 342 343 while (!Send(&msg)); 343 344 344 gLog << "- Controller connected to bus" << endl;345 gLog << inf2 << "- Controller connected to bus" << endl; 345 346 } 346 347 … … 387 388 return -1; 388 389 389 gLog << "- Fast Host Interface Enabled" << endl;390 gLog << inf2 << "- Fast Host Interface Enabled" << endl; 390 391 391 392 return 0; … … 415 416 void VmodIcan::DisableCanBusConnection() 416 417 { 417 gLog << "- Disconnect VmodIcan module from Bus!" << endl;418 gLog << inf2 << "- Disconnect VmodIcan module from Bus!" << endl; 418 419 419 420 Message msg; /* buffer for module messages */ … … 424 425 while (!Send(&msg)); 425 426 426 gLog << "- VmodIcan disconnected." << endl;427 gLog << inf2 << "- VmodIcan disconnected." << endl; 427 428 } 428 429 … … 451 452 void VmodIcan::Close() 452 453 { 453 gLog << "- Closing device VmodIcan #" << (int)fd << endl;454 gLog << inf2 << "- Closing device VmodIcan #" << (int)fd << endl; 454 455 455 456 Message msg; /* disconnect message */ … … 462 463 close(fd); 463 464 464 gLog << "- Device closed." << endl;465 gLog << inf2 << "- Device closed." << endl; 465 466 } 466 467 … … 479 480 while (!Send(&msg)); 480 481 481 gLog << "- Fifo enabled" << endl;482 gLog << inf2 << "- Fifo enabled" << endl; 482 483 483 484 return TRUE; … … 492 493 const int rc = Ioctl(DPM_RESET, 0); 493 494 494 gLog << "- Reset done." << endl;495 gLog << inf2 << "- Reset done." << endl; 495 496 496 497 return rc; … … 516 517 if (fd < 0) 517 518 { 518 gLog << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl;519 gLog << err << "Error: Opening device '" << devname << "' (rc=" << fd << ")" << endl; 519 520 gLog << strerror(errno) << endl; 520 521 return FALSE; 521 522 } 522 523 523 gLog << "- Device " << devname << " #" << fd << " open." << endl;524 gLog << inf << "- Device " << devname << " #" << fd << " open." << endl; 524 525 525 526 return TRUE; … … 582 583 Ioctl(DPM_INIT_NEW_HOSTIF_PRIO, &hdp); 583 584 584 gLog << "- New style host interface enabled" << endl;585 gLog << inf2 << "- New style host interface enabled" << endl; 585 586 586 587 return 0; … … 757 758 while (!Send(&msg)); 758 759 759 gLog << "- All CobIds disabled." << endl;760 gLog << inf2 << "- All CobIds disabled." << endl; 760 761 } 761 762 … … 868 869 */ 869 870 870 gLog << "- VmodIcan initialized." << endl;871 gLog << inf << "- VmodIcan initialized." << endl; 871 872 872 873 } … … 879 880 VmodIcan::~VmodIcan() 880 881 { 881 gLog << "- Stopping VmodIcan module." << endl;882 gLog << inf2 << "- Stopping VmodIcan module." << endl; 882 883 CancelThread(); 883 884 DisableCanBusConnection(); 884 885 Close(); 885 gLog << "- VmodIcan stopped." << endl;886 } 886 gLog << inf << "- VmodIcan stopped." << endl; 887 }
Note:
See TracChangeset
for help on using the changeset viewer.