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

Add send/get raw command #968

Closed
PianetaRadio opened this issue Feb 18, 2022 · 5 comments
Closed

Add send/get raw command #968

PianetaRadio opened this issue Feb 18, 2022 · 5 comments
Labels
enhancement needs test Patches have been submitted but need testing to close issue
Milestone

Comments

@PianetaRadio
Copy link
Contributor

Add in the library functions to send/get raw command to the connected radio, something like the -w -W command in rigctl utility.
It will be useful for debug, specific commands or user's macro.

@mdblack98
Copy link
Contributor

Already there -- the w will time out but the W command takes a length argument which works for fixed length commands
Could also make W accept a terminator char instead of a length if needed. Some commands are variable length responses.
Rig command: W ID; 6
Reply: ID900;

Can also do hexadecimal

Rig command: W \0x49\0x44\0x3b 6
Reply: ID900;

@mdblack98 mdblack98 added this to the 4.5 milestone Feb 19, 2022
@mdblack98
Copy link
Contributor

I guess you mean adding a function in rig.h to do this.
Sounds reasonable
Proposed call
int rig_send_raw(rig, unsigned char *send, int send_len, unsigned char *reply, int reply_len, unsigned char term);
send contains the raw command data
send_len is the # of bytes to send
If reply is NULL no answer is expected
reply should be as long as need for any reply
term is the command termination char -- could be semicolon, CR, or 0xfd for Icom rigs

@PianetaRadio
Copy link
Contributor Author

Yes, I mean into rig.h
Your proposal is good.

@mdblack98 mdblack98 modified the milestones: 4.5, 4.6 Feb 28, 2022
@PianetaRadio
Copy link
Contributor Author

PianetaRadio commented Jun 1, 2022

I'm studying the code to help you in adding this function, but I'm not able to know enough the rig.h and rig.c to write a working code. Sorry.

I theorized the logic flow:

fout = port from rig caps
returnLen = fprintf (fout, send)
if returnLen != send_len return ERROR else return RIG_OK
if (reply != NULL) read(fout, reply)
...

@mdblack98 mdblack98 modified the milestones: 4.6, 4.5 Jun 1, 2022
mdblack98 added a commit that referenced this issue Jun 1, 2022
…Icom or ';' for many others

Function will not return values on rigs that have binary protocols but inconsistent end-of-reponse terminators
#968
@mdblack98 mdblack98 added the needs test Patches have been submitted but need testing to close issue label Jun 1, 2022
@mdblack98
Copy link
Contributor

mdblack98 commented Jun 1, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs test Patches have been submitted but need testing to close issue
Projects
None yet
Development

No branches or pull requests

2 participants