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>
This commit is contained in:
Thomas Tsou 2013-11-15 14:22:53 -05:00
parent cb269a32dd
commit d3fccea05f
1 changed files with 5 additions and 3 deletions

View File

@ -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);