Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in sbitx.c code - sBitx DE does not transmit #57

Open
ramonlh opened this issue Sep 14, 2023 · 1 comment
Open

Error in sbitx.c code - sBitx DE does not transmit #57

ramonlh opened this issue Sep 14, 2023 · 1 comment

Comments

@ramonlh
Copy link

ramonlh commented Sep 14, 2023

I think there is an error in the code in the "sbitx.c" file, in the "sdr_request" function, at approximately line 1358.

This piece of code:


else if (!strcmp(cmd, "tx")){
if (!strcmp(value, "on"))
tr_switch_v2(1);
else
tr_switch_v2(0);
strcpy(response, "ok");


causes that after modifying the transmission activation sequence with the sBitx DE hardware, "tr_switch_v2" is always executed and not "tr_switch_DE". This causes the sBitx DE device to not transmit after the modification.

The correct code should be:


else if (!strcmp(cmd, "tx")){
if (!strcmp(value, "on"))
tr_switch(1);
// tr_switch_v2(1);
else
tr_switch(0);
// tr_switch_v2(0);
strcpy(response, ok");-

@MikeJohnshoy
Copy link

There is this code in sbitx.c that decides (based on what hardware has been detected and setting sbitx_version) whether to call tr_switch_de or tr_switch_v2.

void tr_switch(int tx_on){
	if (sbitx_version == SBITX_DE)
		tr_switch_de(tx_on);
	else
		tr_switch_v2(tx_on);
}

It seems that with this code in place, no other code should call tr_switch_de or tr_switch_v2 . They should just call tr_switch and know that it will go down the right path. The code might have been scrubbed to replace all calls to tr_switch_de or tr_switch_v2 with a call to the new tr_switch.

The developers might have overlooked the code you are pointing at. Only people with DE hardware will be able to see the problem. If this analysis is right, then the change to the code at line #1398 is a fix

else if (!strcmp(cmd, "tx")){
	if (!strcmp(value, "on"))
		tr_switch(1);
	else
		tr_switch(0);
	strcpy(response, "ok");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants