File: rigtestmcast.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 (44 lines) | stat: -rw-r--r-- 966 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
34
35
36
37
38
39
40
41
42
43
44
#include <stdlib.h>
#include <hamlib/rig.h>

#define TEST
#ifdef TEST
int main(int argc, const char *argv[])
{
    RIG *rig;
    rig_model_t myrig_model;
    rig_set_debug_level(RIG_DEBUG_WARN);

    if (argc > 1) { myrig_model = atoi(argv[1]); }
    else
    {
        myrig_model = 1035;
    }

    rig = rig_init(myrig_model);

    if (rig == NULL)
    {
        printf("Error in rig_init\n");
        return 1;

    }

#ifdef _WIN32
    strncpy(RIGPORT(rig)->pathname, "COM37", HAMLIB_FILPATHLEN - 1);
#else
    strncpy(RIGPORT(rig)->pathname, "/dev/ttyUSB0", HAMLIB_FILPATHLEN - 1);
#endif
    RIGPORT(rig)->parm.serial.rate = 38400;
    rig_open(rig);
    // disabled until we change this to the other multicast capability
#if 0
    multicast_init(rig, "224.0.0.1", 4532);
    printf("threadid=%lld\n", (long long)STATE(rig)->multicast->threadid);
    pthread_join(STATE(rig)->multicast->threadid, NULL);
    pthread_exit(NULL);
#endif
    return 0;
}
#endif