2023-05-07 22:17:50 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <hamlib/rig.h>
|
|
|
|
|
|
|
|
#define TEST
|
|
|
|
#ifdef TEST
|
2023-10-12 04:22:42 +00:00
|
|
|
int main(int argc, const char *argv[])
|
2023-05-07 22:17:50 +00:00
|
|
|
{
|
|
|
|
RIG *rig;
|
|
|
|
rig_model_t myrig_model;
|
2023-05-08 04:23:01 +00:00
|
|
|
rig_set_debug_level(RIG_DEBUG_WARN);
|
2023-05-07 22:17:50 +00:00
|
|
|
|
|
|
|
if (argc > 1) { myrig_model = atoi(argv[1]); }
|
|
|
|
else
|
|
|
|
{
|
|
|
|
myrig_model = 1035;
|
|
|
|
}
|
|
|
|
|
|
|
|
rig = rig_init(myrig_model);
|
|
|
|
|
|
|
|
if (rig == NULL)
|
|
|
|
{
|
2023-05-08 12:37:13 +00:00
|
|
|
printf("Error in rig_init\n");
|
|
|
|
return 1;
|
2023-05-07 22:17:50 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-05-08 04:23:01 +00:00
|
|
|
#ifdef _WIN32
|
2024-03-01 01:58:51 +00:00
|
|
|
strncpy(RIGPORT(rig)->pathname, "COM37", HAMLIB_FILPATHLEN - 1);
|
2023-05-08 04:23:01 +00:00
|
|
|
#else
|
2024-03-01 01:58:51 +00:00
|
|
|
strncpy(RIGPORT(rig)->pathname, "/dev/ttyUSB0", HAMLIB_FILPATHLEN - 1);
|
2023-05-08 04:23:01 +00:00
|
|
|
#endif
|
2024-03-01 01:58:51 +00:00
|
|
|
RIGPORT(rig)->parm.serial.rate = 38400;
|
2023-05-07 22:17:50 +00:00
|
|
|
rig_open(rig);
|
2023-09-20 17:17:10 +00:00
|
|
|
// disabled until we change this to the other multicast capability
|
|
|
|
#if 0
|
2023-05-31 12:27:34 +00:00
|
|
|
multicast_init(rig, "224.0.0.1", 4532);
|
2024-07-11 16:44:30 +00:00
|
|
|
printf("threadid=%lld\n", (long long)STATE(rig)->multicast->threadid);
|
|
|
|
pthread_join(STATE(rig)->multicast->threadid, NULL);
|
2023-05-07 22:17:50 +00:00
|
|
|
pthread_exit(NULL);
|
2023-09-20 17:17:10 +00:00
|
|
|
#endif
|
2023-05-07 22:17:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|