kopia lustrzana https://github.com/Hamlib/Hamlib
updated code snippet example
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@147 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.0
rodzic
3d9a2ab231
commit
b7a058d814
|
@ -4,6 +4,8 @@ Take a look at http://sourceforge.net/projects/hamlib/
|
||||||
Here you will find a mail list, and the latest CVS releases.
|
Here you will find a mail list, and the latest CVS releases.
|
||||||
|
|
||||||
|
|
||||||
|
See README for frontend/backend outline.
|
||||||
|
|
||||||
General Guidelines.
|
General Guidelines.
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
@ -109,7 +111,7 @@ General Guidelines.
|
||||||
make runtest > RESULT.example
|
make runtest > RESULT.example
|
||||||
|
|
||||||
9. Your header file (eg ft747.h, ft847.h etc) documents
|
9. Your header file (eg ft747.h, ft847.h etc) documents
|
||||||
your API, so please describe it so others can understand.
|
your backend API, so please describe it so others can understand.
|
||||||
If this cannot be done, I may consider an "API.xxx" that
|
If this cannot be done, I may consider an "API.xxx" that
|
||||||
decsribes the API (eg: API.ft847 )
|
decsribes the API (eg: API.ft847 )
|
||||||
|
|
||||||
|
@ -118,23 +120,42 @@ General Guidelines.
|
||||||
look like this..
|
look like this..
|
||||||
|
|
||||||
A C code snippet to connect to a FT847 and set
|
A C code snippet to connect to a FT847 and set
|
||||||
the frequnecy of the main VFO to 439,700,000 Hz ,
|
the frequency of the main VFO to 439,700,000 Hz ,
|
||||||
using FM as the required mode, would look something
|
using FM as the required mode, would look something
|
||||||
like this.
|
like this. The error checking is removed for simplicity.
|
||||||
|
|
||||||
|
See testrig.c for an example.
|
||||||
|
|
||||||
<snip>
|
<snip>
|
||||||
|
|
||||||
int fd;
|
#define SERIAL_PORT "/dev/ttyS1"
|
||||||
|
...
|
||||||
fd = rig_open(SERIAL_PORT);
|
|
||||||
printf("port %s opened ok \n",SERIAL_PORT);
|
my_rig = rig_init(RIG_MODEL_FT847);
|
||||||
|
strncpy(my_rig->state.rig_path,SERIAL_PORT,FILPATHLEN);
|
||||||
cmd_set_cat_on(fd); /* cat on */
|
|
||||||
cmd_set_freq_main_vfo_hz(fd,439700000,MODE_FM);
|
/*
|
||||||
cmd_set_cat_off(fd); /* cat off */
|
* Example of setting rig Main VFO to 439.700 Mhz FM -- FS
|
||||||
|
* and some error checking on the return code.
|
||||||
rig_close(fd);
|
*/
|
||||||
printf("port %s closed ok \n",SERIAL_PORT);
|
|
||||||
|
retcode = rig_set_vfo(my_rig, RIG_VFO_MAIN);
|
||||||
|
|
||||||
|
if (retcode != RIG_OK ) {
|
||||||
|
printf("rig_set_vfo: error = %i \n", retcode);
|
||||||
|
}
|
||||||
|
|
||||||
|
rig_set_freq(my_rig, 439700000); /* cq de vk3fcs */
|
||||||
|
|
||||||
|
if (retcode != RIG_OK ) {
|
||||||
|
printf("rig_set_freq: error = %i \n", retcode);
|
||||||
|
}
|
||||||
|
|
||||||
|
rig_set_mode(my_rig, RIG_MODE_FM);
|
||||||
|
|
||||||
|
if (retcode != RIG_OK ) {
|
||||||
|
printf("rig_get_mode: error = %i \n", retcode);
|
||||||
|
}
|
||||||
|
|
||||||
<snip>
|
<snip>
|
||||||
|
|
||||||
|
@ -151,5 +172,8 @@ like this.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Frank Singleton vk3fcs/km5ws
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue