hamlib/tests/rigtestmcast.c
George Baltz N3GB 29c4ec4778 Finish adding #include's for things moving out of rig.h
Clean compile & execution with both NO_OLD_INCLUDES and NO_OLD_STRUCTS
  defined.
2026-02-23 11:12:15 -05:00

45 lines
991 B
C

#include <stdlib.h>
#include "hamlib/rig.h"
#include "hamlib/port.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