@@ -164,30 +164,6 @@ bool CSerialDataController::open()
164
164
return true ;
165
165
}
166
166
167
- bool CSerialDataController::setSpeed (SERIAL_SPEED speed)
168
- {
169
- wxASSERT (m_handle != INVALID_HANDLE_VALUE);
170
-
171
- DWORD errCode;
172
-
173
- DCB dcb;
174
- if (::GetCommState (m_handle, &dcb) == 0 ) {
175
- wxLogError (wxT (" Cannot get the attributes for %s, err=%04lx" ), m_device.c_str (), ::GetLastError ());
176
- ::ClearCommError (m_handle, &errCode, NULL );
177
- return false ;
178
- }
179
-
180
- dcb.BaudRate = DWORD (speed);
181
-
182
- if (::SetCommState (m_handle, &dcb) == 0 ) {
183
- wxLogError (wxT (" Cannot set the attributes (speed) for %s, err=%04lx" ), m_device.c_str (), ::GetLastError ());
184
- ::ClearCommError (m_handle, &errCode, NULL );
185
- return false ;
186
- }
187
-
188
- return true ;
189
- }
190
-
191
167
int CSerialDataController::read (unsigned char * buffer, unsigned int length)
192
168
{
193
169
wxASSERT (m_handle != INVALID_HANDLE_VALUE);
@@ -410,67 +386,6 @@ bool CSerialDataController::open()
410
386
return true ;
411
387
}
412
388
413
- bool CSerialDataController::setSpeed (SERIAL_SPEED speed)
414
- {
415
- wxASSERT (m_fd != -1 );
416
-
417
- termios termios;
418
- if (::tcgetattr (m_fd, &termios) < 0 ) {
419
- wxLogError (wxT (" Cannot get the attributes for %s" ), m_device.c_str ());
420
- return false ;
421
- }
422
-
423
- switch (speed) {
424
- case SERIAL_1200:
425
- ::cfsetospeed (&termios, B1200);
426
- ::cfsetispeed (&termios, B1200);
427
- break ;
428
- case SERIAL_2400:
429
- ::cfsetospeed (&termios, B2400);
430
- ::cfsetispeed (&termios, B2400);
431
- break ;
432
- case SERIAL_4800:
433
- ::cfsetospeed (&termios, B4800);
434
- ::cfsetispeed (&termios, B4800);
435
- break ;
436
- case SERIAL_9600:
437
- ::cfsetospeed (&termios, B9600);
438
- ::cfsetispeed (&termios, B9600);
439
- break ;
440
- case SERIAL_19200:
441
- ::cfsetospeed (&termios, B19200);
442
- ::cfsetispeed (&termios, B19200);
443
- break ;
444
- case SERIAL_38400:
445
- ::cfsetospeed (&termios, B38400);
446
- ::cfsetispeed (&termios, B38400);
447
- break ;
448
- case SERIAL_115200:
449
- ::cfsetospeed (&termios, B115200);
450
- ::cfsetispeed (&termios, B115200);
451
- break ;
452
- case SERIAL_230400:
453
- ::cfsetospeed (&termios, B230400);
454
- ::cfsetispeed (&termios, B230400);
455
- break ;
456
- case SERIAL_460800:
457
- ::cfsetospeed (&termios, B460800);
458
- ::cfsetispeed (&termios, B460800);
459
- break ;
460
- default :
461
- wxLogError (wxT (" Unsupported serial port speed - %d" ), int (speed));
462
- ::close (m_fd);
463
- return false ;
464
- }
465
-
466
- if (::tcsetattr (m_fd, TCSANOW, &termios) < 0 ) {
467
- wxLogError (wxT (" Cannot set the attributes for %s" ), m_device.c_str ());
468
- return false ;
469
- }
470
-
471
- return true ;
472
- }
473
-
474
389
int CSerialDataController::read (unsigned char * buffer, unsigned int length)
475
390
{
476
391
wxASSERT (buffer != NULL );
0 commit comments