Skip to content

Commit 851b991

Browse files
committed
The 20150928 release of the Dummy Repeater.
1 parent a8c2e0b commit 851b991

7 files changed

+12
-96
lines changed

DummyRepeater.nsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
;Configuration
1212

1313
;General
14-
Name "DummyRepeater 20150923"
15-
OutFile "DummyRepeater-20150923.exe"
14+
Name "DummyRepeater 20150928"
15+
OutFile "DummyRepeater-20150928.exe"
1616

1717
;Folder selection page
1818
InstallDir "$PROGRAMFILES\Dummy Repeater"

DummyRepeater/BUILD.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Repeater - 20150923
1+
Repeater - 20150928
22
===================
33

44
Windows

DummyRepeater/CHANGES.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Repeater - 20150923
1+
Repeater - 20150928
22
===================
33

44
20090530
@@ -1984,3 +1984,8 @@ Add support for the DVMEGA AMBE.
19841984
--------
19851985

19861986
Small change to the initialisation of the DVMEGA AMBE.
1987+
1988+
20150928
1989+
--------
1990+
1991+
Small change to the initialisation of the DVMEGA AMBE.

DummyRepeater/Common/DVMEGAAMBEController.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const unsigned int DV3000_HEADER_LEN = 4U;
5151
const unsigned int BUFFER_LENGTH = 400U;
5252

5353
CDVMEGAAMBEController::CDVMEGAAMBEController(const wxString& device) :
54-
m_serial(device, SERIAL_115200)
54+
m_serial(device, SERIAL_230400)
5555
{
5656
}
5757

@@ -94,8 +94,6 @@ bool CDVMEGAAMBEController::open()
9494

9595
m_serial.write(DV3000_REQ_RESETSOFTCFG, DV3000_REQ_RESETSOFTCFG_LEN);
9696

97-
m_serial.setSpeed(SERIAL_230400);
98-
9997
m_serial.write(DV3000_REQ_RATEP, DV3000_REQ_RATEP_LEN);
10098

10199
for (;;) {

DummyRepeater/Common/SerialDataController.cpp

-85
Original file line numberDiff line numberDiff line change
@@ -164,30 +164,6 @@ bool CSerialDataController::open()
164164
return true;
165165
}
166166

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-
191167
int CSerialDataController::read(unsigned char* buffer, unsigned int length)
192168
{
193169
wxASSERT(m_handle != INVALID_HANDLE_VALUE);
@@ -410,67 +386,6 @@ bool CSerialDataController::open()
410386
return true;
411387
}
412388

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-
474389
int CSerialDataController::read(unsigned char* buffer, unsigned int length)
475390
{
476391
wxASSERT(buffer != NULL);

DummyRepeater/Common/SerialDataController.h

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class CSerialDataController {
4646

4747
bool open();
4848

49-
bool setSpeed(SERIAL_SPEED speed);
50-
5149
int read(unsigned char* buffer, unsigned int length);
5250
int write(const unsigned char* buffer, unsigned int length);
5351

DummyRepeater/Common/Version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
const wxString VENDOR_NAME = wxT("G4KLX");
2525

2626
#if defined(__WXDEBUG__)
27-
const wxString VERSION = wxT("20150923 - DEBUG");
27+
const wxString VERSION = wxT("20150928 - DEBUG");
2828
#else
29-
const wxString VERSION = wxT("20150923");
29+
const wxString VERSION = wxT("20150928");
3030
#endif
3131

3232
#endif

0 commit comments

Comments
 (0)