@@ -11,6 +11,9 @@ Sweep::~Sweep()
11
11
12
12
bool Sweep::startScanning ()
13
13
{
14
+ if (bIsScanning)
15
+ return false ;
16
+
14
17
_writeCommand (_DATA_ACQUISITION_START);
15
18
// wait for the receipt (possible timeout)
16
19
if (_readResponseHeader ())
@@ -65,6 +68,9 @@ bool Sweep::getReading(ScanPacket &reading)
65
68
66
69
int32_t Sweep::getMotorSpeed ()
67
70
{
71
+ if (bIsScanning)
72
+ return false ;
73
+
68
74
_writeCommand (_MOTOR_INFORMATION);
69
75
if (_readResponseInfoSetting ())
70
76
{
@@ -77,6 +83,9 @@ int32_t Sweep::getMotorSpeed()
77
83
78
84
bool Sweep::setMotorSpeed (const uint8_t motorSpeedCode[2 ])
79
85
{
86
+ if (bIsScanning)
87
+ return false ;
88
+
80
89
_writeCommandWithArgument (_MOTOR_SPEED_ADJUST, motorSpeedCode);
81
90
// wait for the receipt (possible timeout)
82
91
if (_readResponseParam ())
@@ -89,6 +98,9 @@ bool Sweep::setMotorSpeed(const uint8_t motorSpeedCode[2])
89
98
90
99
int32_t Sweep::getSampleRate ()
91
100
{
101
+ if (bIsScanning)
102
+ return false ;
103
+
92
104
_writeCommand (_SAMPLE_RATE_INFORMATION);
93
105
if (_readResponseInfoSetting ())
94
106
{
@@ -111,6 +123,9 @@ int32_t Sweep::getSampleRate()
111
123
112
124
bool Sweep::setSampleRate (const uint8_t sampleRateCode[2 ])
113
125
{
126
+ if (bIsScanning)
127
+ return false ;
128
+
114
129
_writeCommandWithArgument (_SAMPLE_RATE_ADJUST, sampleRateCode);
115
130
// wait for the receipt (possible timeout)
116
131
if (_readResponseParam ())
0 commit comments