aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-11-15 14:22:53 -0500
committerThomas Tsou <tom@tsou.cc>2013-11-15 23:35:07 -0500
commitd3fccea05fba7cb89bd467ccbfca63404507395a (patch)
treedd2007c33a3ac9bb5b3140011e81af9b753dea70
parentcb269a32ddb3db9e8d7a8e48d5c007116348fb07 (diff)
Transceiver52M: Allow only channel zero to set TSC value
We support one TSC value per each transceiver object. Only channel zero can set this value. Other channels can attempt to set the TSC value, but will error if the TSC does not match the existing value. In either case, non-zero channels do not manipulate the gloabl TSC setting. Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r--Transceiver52M/Transceiver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f2d871f..b31498b 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -654,12 +654,14 @@ void Transceiver::driveControl(size_t chan)
else
sprintf(response,"RSP TXTUNE 0 %d",freqKhz);
}
- else if (strcmp(command,"SETTSC")==0) {
+ else if (!strcmp(command,"SETTSC")) {
// set TSC
int TSC;
- sscanf(buffer,"%3s %s %d",cmdcheck,command,&TSC);
+ sscanf(buffer, "%3s %s %d", cmdcheck, command, &TSC);
if (mOn)
- sprintf(response,"RSP SETTSC 1 %d",TSC);
+ sprintf(response, "RSP SETTSC 1 %d", TSC);
+ else if (chan && (TSC != mTSC))
+ sprintf(response, "RSP SETTSC 1 %d", TSC);
else {
mTSC = TSC;
generateMidamble(mSPSRx, TSC);