File: rig_tests.c

package info (click to toggle)
hamlib 4.6.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,984 kB
  • sloc: ansic: 262,996; sh: 6,135; cpp: 1,578; perl: 876; makefile: 855; python: 148; awk: 58; xml: 26
file content (33 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <hamlib/rig.h>
#include <misc.h>


// cppcheck-suppress unusedFunction
int rig_test_cw(RIG *rig)
{
    char *s = "SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS SOS";
    //char *s = "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST";
    int i;
    ELAPSED1;
    ENTERFUNC;

    for (i = 0; i < strlen(s); ++i)
    {
        char cw[2];
        cw[0] = s[i];
        cw[1] = '\0';

        int retval = rig_send_morse(rig, RIG_VFO_CURR, cw);
        hl_usleep(100 * 1000);

        if (retval != RIG_OK)
        {
            rig_debug(RIG_DEBUG_ERR, "%s: rig_send_morse error: %s\n", __func__,
                      rigerror(retval));
        }
    }

    ELAPSED2;
    RETURNFUNC(RIG_OK);
}