74 write(canpipes[i].pipe[1], m, sizeof(Message)); |
74 write(canpipes[i].pipe[1], m, sizeof(Message)); |
75 } |
75 } |
76 } |
76 } |
77 return 0; |
77 return 0; |
78 } |
78 } |
79 /* |
79 |
80 int TranslateBaudeRate(char* optarg){ |
80 /***************************************************************************/ |
81 if(!strcmp( optarg, "1M")) return 1000; |
81 int TranslateBaudRate(char* optarg){ |
82 if(!strcmp( optarg, "500K")) return 500; |
82 if(!strcmp( optarg, "1M")) return (int)1000; |
83 if(!strcmp( optarg, "250K")) return 250; |
83 if(!strcmp( optarg, "500K")) return (int)500; |
84 if(!strcmp( optarg, "125K")) return 125; |
84 if(!strcmp( optarg, "250K")) return (int)250; |
85 if(!strcmp( optarg, "100K")) return 100; |
85 if(!strcmp( optarg, "125K")) return (int)125; |
86 if(!strcmp( optarg, "50K")) return 50; |
86 if(!strcmp( optarg, "100K")) return (int)100; |
87 if(!strcmp( optarg, "20K")) return 20; |
87 if(!strcmp( optarg, "50K")) return (int)50; |
88 if(!strcmp( optarg, "10K")) return 10; |
88 if(!strcmp( optarg, "20K")) return (int)20; |
89 if(!strcmp( optarg, "5K")) return 5; |
89 if(!strcmp( optarg, "10K")) return (int)10; |
|
90 if(!strcmp( optarg, "5K")) return (int)5; |
90 if(!strcmp( optarg, "none")) return 0; |
91 if(!strcmp( optarg, "none")) return 0; |
91 return 0; |
92 return 0x0000; |
92 }*/ |
93 } |
|
94 |
|
95 UNS8 canChangeBaudRate_driver( CAN_HANDLE fd0, char* baud) |
|
96 { |
|
97 printf("%x-> changing to baud rate %s[%d]\n", (CANPipe*)fd0 - &canpipes[0],baud,TranslateBaudRate(baud)); |
|
98 return 0; |
|
99 } |
|
100 |
93 /***************************************************************************/ |
101 /***************************************************************************/ |
94 CAN_HANDLE canOpen_driver(s_BOARD *board) |
102 CAN_HANDLE canOpen_driver(s_BOARD *board) |
95 { |
103 { |
96 int i; |
104 int i; |
97 for(i=0; i < MAX_NB_CAN_PIPES; i++) |
105 for(i=0; i < MAX_NB_CAN_PIPES; i++) |