mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 02:17:21 +00:00
astyle files
This commit is contained in:
parent
e1b3ac2a95
commit
e267c62764
@ -103,8 +103,9 @@ int gemini_transaction(AMP *amp, const char *cmd, char *response,
|
||||
if (response) // if response expected get it
|
||||
{
|
||||
response[0] = 0;
|
||||
int len = read_string(&rs->ampport, (unsigned char *) response, response_len, "\n",
|
||||
1, 0, 1);
|
||||
int len = read_string(&rs->ampport, (unsigned char *) response, response_len,
|
||||
"\n",
|
||||
1, 0, 1);
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
|
1287
lib/cJSON.c
1287
lib/cJSON.c
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
// precise_time.cxx
|
||||
//
|
||||
// Copyright (C) 2023
|
||||
// Dave Freese, W1HKJ
|
||||
// Dave Freese, W1HKJ
|
||||
//
|
||||
// This file is part of flrig
|
||||
//
|
||||
@ -28,9 +28,9 @@
|
||||
// return current tick time in seconds
|
||||
double monotonic_seconds()
|
||||
{
|
||||
static struct timeval t1;
|
||||
gettimeofday(&t1, NULL);
|
||||
return t1.tv_sec + t1.tv_usec / 1e6;
|
||||
static struct timeval t1;
|
||||
gettimeofday(&t1, NULL);
|
||||
return t1.tv_sec + t1.tv_usec / 1e6;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -49,118 +49,132 @@ double monotonic_seconds()
|
||||
static int showme = 0;
|
||||
|
||||
#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
|
||||
// If we have it, use clock_gettime and CLOCK_MONOTONIC.
|
||||
// If we have it, use clock_gettime and CLOCK_MONOTONIC.
|
||||
|
||||
#include <time.h>
|
||||
#include <time.h>
|
||||
|
||||
double monotonic_seconds() {
|
||||
if (showme) {
|
||||
showme = 0;
|
||||
}
|
||||
struct timespec time;
|
||||
// Note: Make sure to link with -lrt to define clock_gettime.
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
return ((double) time.tv_sec) + ((double) time.tv_nsec / (NANOS_PER_SECF));
|
||||
}
|
||||
double monotonic_seconds()
|
||||
{
|
||||
if (showme)
|
||||
{
|
||||
showme = 0;
|
||||
}
|
||||
|
||||
struct timespec time;
|
||||
|
||||
// Note: Make sure to link with -lrt to define clock_gettime.
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
|
||||
return ((double) time.tv_sec) + ((double) time.tv_nsec / (NANOS_PER_SECF));
|
||||
}
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
// If we don't have CLOCK_MONOTONIC, we might be on a Mac. There we instead
|
||||
// use mach_absolute_time().
|
||||
// If we don't have CLOCK_MONOTONIC, we might be on a Mac. There we instead
|
||||
// use mach_absolute_time().
|
||||
|
||||
#include <mach/mach_time.h>
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
static mach_timebase_info_data_t info;
|
||||
static void __attribute__((constructor)) init_info() {
|
||||
mach_timebase_info(&info);
|
||||
}
|
||||
static mach_timebase_info_data_t info;
|
||||
static void __attribute__((constructor)) init_info()
|
||||
{
|
||||
mach_timebase_info(&info);
|
||||
}
|
||||
|
||||
double monotonic_seconds() {
|
||||
uint64_t time = mach_absolute_time();
|
||||
double dtime = (double) time;
|
||||
dtime *= (double) info.numer;
|
||||
dtime /= (double) info.denom;
|
||||
return dtime / NANOS_PER_SECF;
|
||||
}
|
||||
double monotonic_seconds()
|
||||
{
|
||||
uint64_t time = mach_absolute_time();
|
||||
double dtime = (double) time;
|
||||
dtime *= (double) info.numer;
|
||||
dtime /= (double) info.denom;
|
||||
return dtime / NANOS_PER_SECF;
|
||||
}
|
||||
|
||||
#elif defined(__WIN32__)
|
||||
// On Windows, use QueryPerformanceCounter and QueryPerformanceFrequency.
|
||||
// On Windows, use QueryPerformanceCounter and QueryPerformanceFrequency.
|
||||
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
static double PCFreq = 0.0;
|
||||
static double PCFreq = 0.0;
|
||||
|
||||
// According to http://stackoverflow.com/q/1113409/447288, this will
|
||||
// make this function a constructor.
|
||||
// TODO(awreece) Actually attempt to compile on windows.
|
||||
// w1hkj - builds OK on mingw32
|
||||
// According to http://stackoverflow.com/q/1113409/447288, this will
|
||||
// make this function a constructor.
|
||||
// TODO(awreece) Actually attempt to compile on windows.
|
||||
// w1hkj - builds OK on mingw32
|
||||
|
||||
static void __cdecl init_pcfreq();
|
||||
__declspec(allocate(".CRT$XCU")) void (__cdecl*init_pcfreq_)() = init_pcfreq;
|
||||
static void __cdecl init_pcfreq() {
|
||||
// Accoring to http://stackoverflow.com/a/1739265/447288, this will
|
||||
// properly initialize the QueryPerformanceCounter.
|
||||
LARGE_INTEGER li;
|
||||
int has_qpc = QueryPerformanceFrequency(&li);
|
||||
assert(has_qpc);
|
||||
static void __cdecl init_pcfreq();
|
||||
__declspec(allocate(".CRT$XCU")) void (__cdecl *init_pcfreq_)() = init_pcfreq;
|
||||
static void __cdecl init_pcfreq()
|
||||
{
|
||||
// Accoring to http://stackoverflow.com/a/1739265/447288, this will
|
||||
// properly initialize the QueryPerformanceCounter.
|
||||
LARGE_INTEGER li;
|
||||
int has_qpc = QueryPerformanceFrequency(&li);
|
||||
assert(has_qpc);
|
||||
|
||||
PCFreq = ((double) li.QuadPart) / 1000.0;
|
||||
}
|
||||
PCFreq = ((double) li.QuadPart) / 1000.0;
|
||||
}
|
||||
|
||||
double monotonic_seconds() {
|
||||
LARGE_INTEGER li;
|
||||
QueryPerformanceCounter(&li);
|
||||
return ((double) li.QuadPart) / PCFreq;
|
||||
}
|
||||
double monotonic_seconds()
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
QueryPerformanceCounter(&li);
|
||||
return ((double) li.QuadPart) / PCFreq;
|
||||
}
|
||||
|
||||
#else
|
||||
// Fall back to rdtsc. The reason we don't use clock() is this scary message
|
||||
// from the man page:
|
||||
// "On several other implementations, the value returned by clock() also
|
||||
// includes the times of any children whose status has been collected via
|
||||
// wait(2) (or another wait-type call)."
|
||||
//
|
||||
// Also, clock() only has microsecond accuracy.
|
||||
//
|
||||
// This whitepaper offered excellent advice on how to use rdtscp for
|
||||
// profiling: http://download.intel.com/embedded/software/IA/324264.pdf
|
||||
//
|
||||
// Unfortunately, we can't follow its advice exactly with our semantics,
|
||||
// so we're just going to use rdtscp with cpuid.
|
||||
//
|
||||
// Note that rdtscp will only be available on new processors.
|
||||
// Fall back to rdtsc. The reason we don't use clock() is this scary message
|
||||
// from the man page:
|
||||
// "On several other implementations, the value returned by clock() also
|
||||
// includes the times of any children whose status has been collected via
|
||||
// wait(2) (or another wait-type call)."
|
||||
//
|
||||
// Also, clock() only has microsecond accuracy.
|
||||
//
|
||||
// This whitepaper offered excellent advice on how to use rdtscp for
|
||||
// profiling: http://download.intel.com/embedded/software/IA/324264.pdf
|
||||
//
|
||||
// Unfortunately, we can't follow its advice exactly with our semantics,
|
||||
// so we're just going to use rdtscp with cpuid.
|
||||
//
|
||||
// Note that rdtscp will only be available on new processors.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static inline uint64_t rdtsc() {
|
||||
uint32_t hi, lo;
|
||||
uint64_t hi64, lo64;
|
||||
asm volatile("rdtscp\n"
|
||||
"movl %%edx, %0\n"
|
||||
"movl %%eax, %1\n"
|
||||
"cpuid"
|
||||
: "=r" (hi), "=r" (lo) : : "%rax", "%rbx", "%rcx", "%rdx");
|
||||
hi64 = hi;
|
||||
lo64 = lo;
|
||||
return (hi64 << 32) | lo64;
|
||||
}
|
||||
static inline uint64_t rdtsc()
|
||||
{
|
||||
uint32_t hi, lo;
|
||||
uint64_t hi64, lo64;
|
||||
asm volatile("rdtscp\n"
|
||||
"movl %%edx, %0\n"
|
||||
"movl %%eax, %1\n"
|
||||
"cpuid"
|
||||
: "=r"(hi), "=r"(lo) : : "%rax", "%rbx", "%rcx", "%rdx");
|
||||
hi64 = hi;
|
||||
lo64 = lo;
|
||||
return (hi64 << 32) | lo64;
|
||||
}
|
||||
|
||||
static uint64_t rdtsc_per_sec = 0;
|
||||
static void __attribute__((constructor)) init_rdtsc_per_sec() {
|
||||
uint64_t before, after;
|
||||
static uint64_t rdtsc_per_sec = 0;
|
||||
static void __attribute__((constructor)) init_rdtsc_per_sec()
|
||||
{
|
||||
uint64_t before, after;
|
||||
|
||||
before = rdtsc();
|
||||
usleep(USECS_PER_SEC);
|
||||
after = rdtsc();
|
||||
before = rdtsc();
|
||||
usleep(USECS_PER_SEC);
|
||||
after = rdtsc();
|
||||
|
||||
rdtsc_per_sec = after - before;
|
||||
}
|
||||
rdtsc_per_sec = after - before;
|
||||
}
|
||||
|
||||
double monotonic_seconds() {
|
||||
if (showme) {
|
||||
showme = false;
|
||||
}
|
||||
return (double) rdtsc() / (double) rdtsc_per_sec;
|
||||
}
|
||||
double monotonic_seconds()
|
||||
{
|
||||
if (showme)
|
||||
{
|
||||
showme = false;
|
||||
}
|
||||
|
||||
return (double) rdtsc() / (double) rdtsc_per_sec;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1312,8 +1312,8 @@ int adat_priv_set_cmd(RIG *pRig, char *pcCmd, int nCmdKind)
|
||||
{
|
||||
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
|
||||
|
||||
memset( pPriv->acCmd, 0, ADAT_PRIV_DATA_CMD_LENGTH + 1 );
|
||||
snprintf(pPriv->acCmd,ADAT_PRIV_DATA_CMD_LENGTH+1,"%s",pcCmd );
|
||||
memset(pPriv->acCmd, 0, ADAT_PRIV_DATA_CMD_LENGTH + 1);
|
||||
snprintf(pPriv->acCmd, ADAT_PRIV_DATA_CMD_LENGTH + 1, "%s", pcCmd);
|
||||
pPriv->nCmdKind = nCmdKind;
|
||||
}
|
||||
|
||||
@ -1351,8 +1351,8 @@ int adat_priv_set_result(RIG *pRig, char *pcResult)
|
||||
{
|
||||
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
|
||||
|
||||
memset( pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1 );
|
||||
snprintf(pPriv->acResult,ADAT_PRIV_DATA_RESULT_LENGTH+1,"%s",pcResult );
|
||||
memset(pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1);
|
||||
snprintf(pPriv->acResult, ADAT_PRIV_DATA_RESULT_LENGTH + 1, "%s", pcResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acResult = \"%s\"\n",
|
||||
@ -1392,7 +1392,7 @@ int adat_priv_clear_result(RIG *pRig)
|
||||
else
|
||||
{
|
||||
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
|
||||
memset( pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1 );
|
||||
memset(pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1);
|
||||
}
|
||||
|
||||
// Done !
|
||||
@ -1631,8 +1631,9 @@ int adat_cmd_fn_get_callsign(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acCallsign, 0, ADAT_PRIV_DATA_CALLSIGN_LENGTH + 1 );
|
||||
snprintf(pPriv->acCallsign,ADAT_PRIV_DATA_CALLSIGN_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acCallsign, 0, ADAT_PRIV_DATA_CALLSIGN_LENGTH + 1);
|
||||
snprintf(pPriv->acCallsign, ADAT_PRIV_DATA_CALLSIGN_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acCallsign = \"%s\"\n",
|
||||
@ -1684,8 +1685,9 @@ int adat_cmd_fn_get_serial_nr(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acSerialNr, 0, ADAT_PRIV_DATA_SERIALNR_LENGTH + 1 );
|
||||
snprintf(pPriv->acSerialNr,ADAT_PRIV_DATA_SERIALNR_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acSerialNr, 0, ADAT_PRIV_DATA_SERIALNR_LENGTH + 1);
|
||||
snprintf(pPriv->acSerialNr, ADAT_PRIV_DATA_SERIALNR_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acSerialNr = \"%s\"\n",
|
||||
@ -1737,8 +1739,9 @@ int adat_cmd_fn_get_fw_version(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acFWVersion, 0, ADAT_PRIV_DATA_FWVERSION_LENGTH + 1 );
|
||||
snprintf(pPriv->acFWVersion,ADAT_PRIV_DATA_FWVERSION_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acFWVersion, 0, ADAT_PRIV_DATA_FWVERSION_LENGTH + 1);
|
||||
snprintf(pPriv->acFWVersion, ADAT_PRIV_DATA_FWVERSION_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acFWVersion = \"%s\"\n",
|
||||
@ -1791,8 +1794,9 @@ int adat_cmd_fn_get_hw_version(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acHWVersion, 0, ADAT_PRIV_DATA_HWVERSION_LENGTH + 1 );
|
||||
snprintf(pPriv->acHWVersion,ADAT_PRIV_DATA_HWVERSION_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acHWVersion, 0, ADAT_PRIV_DATA_HWVERSION_LENGTH + 1);
|
||||
snprintf(pPriv->acHWVersion, ADAT_PRIV_DATA_HWVERSION_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acHWVersion = \"%s\"\n",
|
||||
@ -1844,8 +1848,9 @@ int adat_cmd_fn_get_gui_fw_version(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acGUIFWVersion, 0, ADAT_PRIV_DATA_GUIFWVERSION_LENGTH + 1 );
|
||||
snprintf(pPriv->acGUIFWVersion,ADAT_PRIV_DATA_GUIFWVERSION_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acGUIFWVersion, 0, ADAT_PRIV_DATA_GUIFWVERSION_LENGTH + 1);
|
||||
snprintf(pPriv->acGUIFWVersion, ADAT_PRIV_DATA_GUIFWVERSION_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acGUIFWVersion = \"%s\"\n",
|
||||
@ -1898,8 +1903,9 @@ int adat_cmd_fn_get_id_code(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acIDCode, 0, ADAT_PRIV_DATA_IDCODE_LENGTH + 1 );
|
||||
snprintf(pPriv->acIDCode,ADAT_PRIV_DATA_IDCODE_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acIDCode, 0, ADAT_PRIV_DATA_IDCODE_LENGTH + 1);
|
||||
snprintf(pPriv->acIDCode, ADAT_PRIV_DATA_IDCODE_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acIDCode = \"%s\"\n",
|
||||
@ -1951,8 +1957,9 @@ int adat_cmd_fn_get_options(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset( pPriv->acOptions, 0, ADAT_PRIV_DATA_OPTIONS_LENGTH + 1 );
|
||||
snprintf(pPriv->acOptions,ADAT_PRIV_DATA_OPTIONS_LENGTH+1,"%s",pPriv->acResult );
|
||||
memset(pPriv->acOptions, 0, ADAT_PRIV_DATA_OPTIONS_LENGTH + 1);
|
||||
snprintf(pPriv->acOptions, ADAT_PRIV_DATA_OPTIONS_LENGTH + 1, "%s",
|
||||
pPriv->acResult);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pPriv->acOptions = \"%s\"\n",
|
||||
@ -2056,7 +2063,7 @@ int adat_cmd_fn_set_mode(RIG *pRig)
|
||||
|
||||
memset(acBuf, 0, ADAT_BUFSZ + 1);
|
||||
|
||||
snprintf(acBuf,sizeof(acBuf),"%s%02d%s",
|
||||
snprintf(acBuf, sizeof(acBuf), "%s%02d%s",
|
||||
ADAT_CMD_DEF_STRING_SET_MODE,
|
||||
(int) pPriv->nADATMode,
|
||||
ADAT_EOM);
|
||||
@ -2173,7 +2180,7 @@ int adat_cmd_fn_set_freq(RIG *pRig)
|
||||
|
||||
memset(acBuf, 0, ADAT_BUFSZ + 1);
|
||||
|
||||
snprintf(acBuf,sizeof(acBuf),"%s%d%s",
|
||||
snprintf(acBuf, sizeof(acBuf), "%s%d%s",
|
||||
ADAT_CMD_DEF_STRING_SET_FREQ,
|
||||
(int) pPriv->nFreq,
|
||||
ADAT_EOM);
|
||||
@ -2229,7 +2236,7 @@ int adat_cmd_fn_set_vfo(RIG *pRig)
|
||||
|
||||
memset(acBuf, 0, ADAT_BUFSZ + 1);
|
||||
|
||||
snprintf(acBuf,sizeof(acBuf), ADAT_CMD_DEF_STRING_SWITCH_ON_VFO,
|
||||
snprintf(acBuf, sizeof(acBuf), ADAT_CMD_DEF_STRING_SWITCH_ON_VFO,
|
||||
(int) pPriv->nCurrentVFO,
|
||||
ADAT_EOM);
|
||||
|
||||
@ -2242,7 +2249,7 @@ int adat_cmd_fn_set_vfo(RIG *pRig)
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
memset(acBuf, 0, ADAT_BUFSZ + 1);
|
||||
snprintf(acBuf,sizeof(acBuf),
|
||||
snprintf(acBuf, sizeof(acBuf),
|
||||
ADAT_CMD_DEF_STRING_SET_VFO_AS_MAIN_VFO,
|
||||
(int) pPriv->nCurrentVFO,
|
||||
ADAT_EOM);
|
||||
@ -2375,7 +2382,7 @@ int adat_cmd_fn_set_ptt(RIG *pRig)
|
||||
{
|
||||
char acBuf[ ADAT_BUFSZ + 1 ];
|
||||
memset(acBuf, 0, ADAT_BUFSZ + 1);
|
||||
snprintf(acBuf,sizeof(acBuf),ADAT_CMD_DEF_STRING_SET_PTT,
|
||||
snprintf(acBuf, sizeof(acBuf), ADAT_CMD_DEF_STRING_SET_PTT,
|
||||
pcPTTStr,
|
||||
ADAT_EOM);
|
||||
|
||||
@ -2490,8 +2497,8 @@ int adat_transaction(RIG *pRig,
|
||||
nRC = adat_receive(pRig, acBuf);
|
||||
}
|
||||
|
||||
memset( pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1 );
|
||||
snprintf(pPriv->acResult,ADAT_PRIV_DATA_RESULT_LENGTH+1,"%s",acBuf);
|
||||
memset(pPriv->acResult, 0, ADAT_PRIV_DATA_RESULT_LENGTH + 1);
|
||||
snprintf(pPriv->acResult, ADAT_PRIV_DATA_RESULT_LENGTH + 1, "%s", acBuf);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2546,8 +2553,8 @@ int adat_init(RIG *pRig)
|
||||
{
|
||||
// Set Rig Priv data
|
||||
|
||||
memset( &gsADATPrivData, 0, sizeof( adat_priv_data_t ));
|
||||
pRig->state.priv = &gsADATPrivData;
|
||||
memset(&gsADATPrivData, 0, sizeof(adat_priv_data_t));
|
||||
pRig->state.priv = &gsADATPrivData;
|
||||
}
|
||||
|
||||
// Done !
|
||||
@ -2685,10 +2692,10 @@ const char *adat_get_info(RIG *pRig)
|
||||
|
||||
if (nRC == RIG_OK)
|
||||
{
|
||||
// cppcheck-suppress constVariablePointer
|
||||
// cppcheck-suppress constVariablePointer
|
||||
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
|
||||
|
||||
snprintf(acBuf,2048,
|
||||
snprintf(acBuf, 2048,
|
||||
"ADAT ADT-200A, Callsign: %s, S/N: %s, ID Code: %s, Options: %s, FW: %s, GUI FW: %s, HW: %s",
|
||||
pPriv->acCallsign,
|
||||
pPriv->acSerialNr,
|
||||
@ -3271,7 +3278,8 @@ int adat_set_conf(RIG *pRig, token_t token, const char *val)
|
||||
{
|
||||
case TOKEN_ADAT_PRODUCT_NAME:
|
||||
|
||||
snprintf(pPriv->acProductName,ADAT_PRIV_DATA_PRODUCTNAME_LENGTH+1,"%s",val );
|
||||
snprintf(pPriv->acProductName, ADAT_PRIV_DATA_PRODUCTNAME_LENGTH + 1, "%s",
|
||||
val);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -3316,10 +3324,15 @@ int adat_get_conf(RIG *pRig, token_t token, char *val)
|
||||
switch (token)
|
||||
{
|
||||
case TOKEN_ADAT_PRODUCT_NAME:
|
||||
if (strlen(pPriv->acProductName) > 0)
|
||||
strcpy(val, pPriv->acProductName);
|
||||
else
|
||||
strcpy(val,"Unknown product");
|
||||
if (strlen(pPriv->acProductName) > 0)
|
||||
{
|
||||
strcpy(val, pPriv->acProductName);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(val, "Unknown product");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -46,7 +46,8 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "anytone.h"
|
||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len, unsigned char *reply, int reply_len, int expected_len);
|
||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
||||
unsigned char *reply, int reply_len, int expected_len);
|
||||
|
||||
DECLARE_INITRIG_BACKEND(anytone)
|
||||
{
|
||||
@ -116,7 +117,7 @@ void *anytone_thread(void *vrig)
|
||||
|
||||
write_block(&rig->state.rigport, (unsigned char *)c, strlen(c));
|
||||
char buf[32];
|
||||
read_block(&rig->state.rigport, (unsigned char*)buf, 22);
|
||||
read_block(&rig->state.rigport, (unsigned char *)buf, 22);
|
||||
|
||||
if (rig_need_debug(RIG_DEBUG_CACHE) == 0)
|
||||
{
|
||||
@ -176,7 +177,8 @@ int anytone_receive(RIG *rig, unsigned char *buf, int buf_len, int expected)
|
||||
// ---------------------------------------------------------------------------
|
||||
// anytone_transaction
|
||||
// ---------------------------------------------------------------------------
|
||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len, unsigned char *reply, int reply_len, int expected_len)
|
||||
int anytone_transaction(RIG *rig, unsigned char *cmd, int cmd_len,
|
||||
unsigned char *reply, int reply_len, int expected_len)
|
||||
{
|
||||
int retval = RIG_OK;
|
||||
//anytone_priv_data_t *p = rig->state.priv;
|
||||
@ -258,7 +260,7 @@ int anytone_open(RIG *rig)
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
unsigned char cmd[] = { 0x2B,0x41,0x44,0x41,0x54,0x41,0x3A,0x30,0x30,0x2C,0x30,0x30,0x31,0x0d,0x0a,'a',0x0d,0x0a };
|
||||
unsigned char cmd[] = { 0x2B, 0x41, 0x44, 0x41, 0x54, 0x41, 0x3A, 0x30, 0x30, 0x2C, 0x30, 0x30, 0x31, 0x0d, 0x0a, 'a', 0x0d, 0x0a };
|
||||
write_block(&rig->state.rigport, cmd, sizeof(cmd));
|
||||
hl_usleep(500 * 1000);
|
||||
char cmd2[64];
|
||||
@ -266,7 +268,8 @@ int anytone_open(RIG *rig)
|
||||
write_block(&rig->state.rigport, (unsigned char *)cmd2, strlen(cmd2));
|
||||
SNPRINTF(cmd2, sizeof(cmd2), "+ADATA:00,000\r\n");
|
||||
unsigned char reply[512];
|
||||
anytone_transaction(rig, (unsigned char*)cmd2, strlen(cmd2), reply, sizeof(reply), strlen(cmd2));
|
||||
anytone_transaction(rig, (unsigned char *)cmd2, strlen(cmd2), reply,
|
||||
sizeof(reply), strlen(cmd2));
|
||||
|
||||
pthread_t id;
|
||||
// will start the keep alive
|
||||
@ -291,7 +294,7 @@ int anytone_close(RIG *rig)
|
||||
|
||||
ENTERFUNC;
|
||||
char *cmd = "+ADATA:00,000\r\n";
|
||||
anytone_transaction(rig, (unsigned char*)cmd, strlen(cmd), NULL, 0, 0);
|
||||
anytone_transaction(rig, (unsigned char *)cmd, strlen(cmd), NULL, 0, 0);
|
||||
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
@ -309,10 +312,11 @@ int anytone_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
|
||||
const anytone_priv_data_ptr p = (anytone_priv_data_ptr) rig->state.priv;
|
||||
unsigned char reply[512];
|
||||
unsigned char cmd[] = { 0x2b,0x41,0x44,0x41,0x54,0x41,0x3a,0x30,0x30,0x2c,0x30,0x30,0x36,0x0d,0x0a,0x04,0x05,0x00,0x00,0x00,0x00,0x0d,0x0a };
|
||||
unsigned char cmd[] = { 0x2b, 0x41, 0x44, 0x41, 0x54, 0x41, 0x3a, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x36, 0x0d, 0x0a, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a };
|
||||
anytone_transaction(rig, cmd, sizeof(cmd), reply, sizeof(reply), 114);
|
||||
if (reply[113] == 0x9b) *vfo = RIG_VFO_A;
|
||||
else if (reply[113] == 0x9c) *vfo = RIG_VFO_B;
|
||||
|
||||
if (reply[113] == 0x9b) { *vfo = RIG_VFO_A; }
|
||||
else if (reply[113] == 0x9c) { *vfo = RIG_VFO_B; }
|
||||
else
|
||||
{
|
||||
*vfo = RIG_VFO_A; // default to VFOA
|
||||
@ -357,10 +361,11 @@ int anytone_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
ENTERFUNC;
|
||||
|
||||
//char buf[8] = { 0x41, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x06 };
|
||||
unsigned char ptton[] = { 0x2B,0x41,0x44,0x41,0x54,0x41,0x3A,0x30,0x30,0x2C,0x30,0x30,0x31,0x0d,0x0a,0x61,0x0d,0x0a };
|
||||
unsigned char pttoff[] = { 0x2B,0x41,0x44,0x41,0x54,0x41,0x3A,0x30,0x30,0x2C,0x30,0x32,0x33,0x0d,0x0a,0x56,0x0d,0x0a };
|
||||
unsigned char ptton[] = { 0x2B, 0x41, 0x44, 0x41, 0x54, 0x41, 0x3A, 0x30, 0x30, 0x2C, 0x30, 0x30, 0x31, 0x0d, 0x0a, 0x61, 0x0d, 0x0a };
|
||||
unsigned char pttoff[] = { 0x2B, 0x41, 0x44, 0x41, 0x54, 0x41, 0x3A, 0x30, 0x30, 0x2C, 0x30, 0x32, 0x33, 0x0d, 0x0a, 0x56, 0x0d, 0x0a };
|
||||
void *pttcmd = ptton;
|
||||
if (!ptt) pttcmd = pttoff;
|
||||
|
||||
if (!ptt) { pttcmd = pttoff; }
|
||||
|
||||
//if (!ptt) { cmd = " (unsigned char*)+ADATA:00,023\r\nV\r\n"; }
|
||||
|
||||
@ -409,6 +414,7 @@ int anytone_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
}
|
||||
}
|
||||
while (retval != 138 && --retry > 0);
|
||||
|
||||
MUTEX_UNLOCK(p->priv.mutex);
|
||||
|
||||
return RIG_OK;
|
||||
@ -417,19 +423,25 @@ int anytone_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
int anytone_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
char cmd[64];
|
||||
|
||||
if (vfo == RIG_VFO_A)
|
||||
snprintf(cmd, sizeof(cmd), "ADATA:00,005\r\n%c%c%c%c\r\n", 2, 0, 0, 0);
|
||||
{
|
||||
snprintf(cmd, sizeof(cmd), "ADATA:00,005\r\n%c%c%c%c\r\n", 2, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd), "ADATA:00,005\r\n%c%c%c%c\r\n", 1, 0, 0, 0);
|
||||
{
|
||||
snprintf(cmd, sizeof(cmd), "ADATA:00,005\r\n%c%c%c%c\r\n", 1, 0, 0, 0);
|
||||
}
|
||||
|
||||
MUTEX_LOCK(p->priv.mutex);
|
||||
rig_flush(&rig->state.rigport);
|
||||
write_block(&rig->state.rigport, (unsigned char*) cmd, 20);
|
||||
write_block(&rig->state.rigport, (unsigned char *) cmd, 20);
|
||||
unsigned char backend[] = { 0x2f, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0x15, 0x50, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x09, 0x00, 0x00, 0x0d, 0x0a};
|
||||
snprintf(cmd, sizeof(cmd), "ADATA:00,023\r\n");
|
||||
int bytes = strlen(cmd) + sizeof(backend);
|
||||
memcpy(&cmd[15], backend, sizeof(backend));
|
||||
hl_usleep(10*1000);
|
||||
write_block(&rig->state.rigport, (unsigned char*)cmd, bytes);
|
||||
hl_usleep(10 * 1000);
|
||||
write_block(&rig->state.rigport, (unsigned char *)cmd, bytes);
|
||||
MUTEX_UNLOCK(p->priv.mutex);
|
||||
|
||||
return -RIG_ENIMPL;
|
||||
|
@ -356,7 +356,8 @@ int ar3030_set_vfo(RIG *rig, vfo_t vfo)
|
||||
|
||||
int ar3030_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
const struct ar3030_priv_data *priv = (struct ar3030_priv_data *)rig->state.priv;
|
||||
const struct ar3030_priv_data *priv = (struct ar3030_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
*vfo = priv->curr_vfo;
|
||||
|
||||
|
@ -190,7 +190,8 @@ static void Execute_Routine_2_1(RIG *rig, char mp, char ad, int numSteps)
|
||||
}
|
||||
#endif
|
||||
// Routine 3 Set passband Setup all IF parameters from filter, pbsval and bfoval bytes.
|
||||
static void Execute_Routine_3_1(RIG *rig, char mp, char ad, unsigned int numSteps)
|
||||
static void Execute_Routine_3_1(RIG *rig, char mp, char ad,
|
||||
unsigned int numSteps)
|
||||
{
|
||||
setLock(rig, 1); //Set Lock Level
|
||||
setMemPtr(rig, mp, ad); //page, address
|
||||
|
@ -333,7 +333,7 @@ static int ar7030p_cleanup(RIG *rig)
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (priv == NULL) return RIG_OK;
|
||||
if (priv == NULL) { return RIG_OK; }
|
||||
|
||||
for (i = 0; i < NB_CHAN; i++)
|
||||
{
|
||||
@ -1264,7 +1264,8 @@ static int ar7030p_set_vfo(RIG *rig, vfo_t vfo)
|
||||
static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
struct ar7030p_priv_data const *priv = (struct ar7030p_priv_data *) rig->state.priv;
|
||||
struct ar7030p_priv_data const *priv = (struct ar7030p_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
assert(NULL != vfo);
|
||||
|
||||
@ -1348,7 +1349,8 @@ static int ar7030p_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
|
||||
struct ar7030p_priv_data const *priv = (struct ar7030p_priv_data *) rig->state.priv;
|
||||
struct ar7030p_priv_data const *priv = (struct ar7030p_priv_data *)
|
||||
rig->state.priv;
|
||||
const channel_t *curr = priv->curr;
|
||||
|
||||
assert(NULL != ch);
|
||||
@ -1648,7 +1650,8 @@ static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
|
||||
unsigned int f;
|
||||
unsigned char *p = NULL;
|
||||
int ch;
|
||||
const struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv;
|
||||
const struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)
|
||||
rig->state.priv;
|
||||
const channel_t *curr = priv->curr;
|
||||
|
||||
assert(NULL != chan);
|
||||
|
@ -164,7 +164,9 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
for (i = 0; i < 10; ++i)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Mhz=%lg, lo=%lg, hi=%lg\n", __func__, freq_MHz, chan_map[i].lo, chan_map[i].hi);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Mhz=%lg, lo=%lg, hi=%lg\n", __func__,
|
||||
freq_MHz, chan_map[i].lo, chan_map[i].hi);
|
||||
|
||||
if (freq_MHz >= chan_map[i].lo && freq_MHz <= chan_map[i].hi)
|
||||
{
|
||||
int channel_base = priv->channel_base;
|
||||
|
@ -683,11 +683,13 @@ int barrett_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_AGC:
|
||||
sprintf(cmd_buf,"EG%c%s", val.i==0?'N':'H' , EOM);
|
||||
break;
|
||||
default: return -RIG_ENIMPL;
|
||||
case RIG_LEVEL_AGC:
|
||||
sprintf(cmd_buf, "EG%c%s", val.i == 0 ? 'N' : 'H', EOM);
|
||||
break;
|
||||
|
||||
default: return -RIG_ENIMPL;
|
||||
}
|
||||
|
||||
rig_flush(&rs->rigport);
|
||||
retval = write_block(&rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf));
|
||||
|
||||
@ -695,6 +697,7 @@ int barrett_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ static int aclog_transaction(RIG *rig, char *cmd, char *value,
|
||||
|
||||
ENTERFUNC;
|
||||
ELAPSED1;
|
||||
strcpy(xml,"UNKNOWN");
|
||||
strcpy(xml, "UNKNOWN");
|
||||
|
||||
set_transaction_active(rig);
|
||||
|
||||
@ -710,10 +710,12 @@ static int aclog_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SNPRINTF(cmd, sizeof(cmd),
|
||||
|
@ -143,7 +143,7 @@ Also a way to display faults (there are commands)
|
||||
static int dummy_amp_get_freq(AMP *amp, freq_t *freq)
|
||||
{
|
||||
const struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
|
||||
amp->state.priv;
|
||||
amp->state.priv;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
*freq = priv->freq;
|
||||
return RIG_OK;
|
||||
@ -267,7 +267,7 @@ static int dummy_amp_set_powerstat(AMP *amp, powerstat_t status)
|
||||
static int dummy_amp_get_powerstat(AMP *amp, powerstat_t *status)
|
||||
{
|
||||
const struct dummy_amp_priv_data *priv = (struct dummy_amp_priv_data *)
|
||||
amp->state.priv;
|
||||
amp->state.priv;
|
||||
|
||||
*status = priv->powerstat;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
@ -423,7 +423,9 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL!!!\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv = (struct dummy_priv_data *)rig->state.priv;
|
||||
|
||||
if (priv == NULL)
|
||||
{
|
||||
RETURNFUNC(-RIG_EINTERNAL);
|
||||
@ -1533,9 +1535,10 @@ static int dummy_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
{
|
||||
SNPRINTF(pstr, sizeof(pstr), "%f", val.f);
|
||||
}
|
||||
|
||||
if (RIG_PARM_IS_STRING(parm))
|
||||
{
|
||||
strcpy(pstr,val.cs);
|
||||
strcpy(pstr, val.cs);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2302,10 +2305,10 @@ struct rig_caps dummy_caps =
|
||||
.has_get_parm = DUMMY_PARM,
|
||||
.has_set_parm = RIG_PARM_SET(DUMMY_PARM),
|
||||
.level_gran = {
|
||||
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05f }, .max = { .f = 1 }, .step = { .f = 1.0f/511.0f } },
|
||||
[LVL_RFPOWER_METER] = { .min = { .f = .0f }, .max = { .f = 1 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_RFPOWER_METER_WATTS] = { .min = { .f = .0f }, .max = { .f = 100 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05f }, .max = { .f = 1 }, .step = { .f = 1.0f / 511.0f } },
|
||||
[LVL_RFPOWER_METER] = { .min = { .f = .0f }, .max = { .f = 1 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_RFPOWER_METER_WATTS] = { .min = { .f = .0f }, .max = { .f = 100 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_CWPITCH] = { .step = { .i = 10 } },
|
||||
[LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}},
|
||||
[LVL_SPECTRUM_REF] = {.min = {.f = -30.0f}, .max = {.f = 10.0f}, .step = {.f = 0.5f}},
|
||||
|
@ -896,7 +896,8 @@ static int flrig_open(RIG *rig)
|
||||
retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value));
|
||||
int dummy;
|
||||
|
||||
if (retval == RIG_ENAVAIL || value[0] == 0 || sscanf(value,"%d",&dummy)==0) // must not have it
|
||||
if (retval == RIG_ENAVAIL || value[0] == 0
|
||||
|| sscanf(value, "%d", &dummy) == 0) // must not have it
|
||||
{
|
||||
priv->has_get_bwA = 0;
|
||||
priv->has_get_bwB = 0; // if we don't have A then surely we don't have B either
|
||||
@ -1757,14 +1758,15 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
/* so we may not be 100% accurate if op is twiddling knobs */
|
||||
cmdp = "rig.get_bwA";
|
||||
retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value));
|
||||
if (retval == RIG_OK && strstr(value,"NONE"))
|
||||
|
||||
if (retval == RIG_OK && strstr(value, "NONE"))
|
||||
{
|
||||
priv->has_get_bwA = priv->has_get_bwB = 0;
|
||||
*width = 0;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwA/B\n", __func__);
|
||||
}
|
||||
|
||||
if (retval != RIG_OK || strstr(value,"NONE"))
|
||||
if (retval != RIG_OK || strstr(value, "NONE"))
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
@ -1774,7 +1776,8 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
cmdp = "rig.get_bwB";
|
||||
retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value));
|
||||
if (retval == RIG_OK && strlen(value)==0)
|
||||
|
||||
if (retval == RIG_OK && strlen(value) == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwB\n", __func__);
|
||||
priv->has_get_bwB = 0;
|
||||
@ -2523,7 +2526,7 @@ HAMLIB_EXPORT(int) flrig_cat_string(RIG *rig, const char *arg)
|
||||
}
|
||||
|
||||
int flrig_set_func(RIG *rig, vfo_t vfo, setting_t func,
|
||||
int status)
|
||||
int status)
|
||||
{
|
||||
int retval;
|
||||
char cmd_arg[MAXARGLEN];
|
||||
|
@ -861,6 +861,7 @@ static int netrigctl_open(RIG *rig)
|
||||
else if (strcmp(setting, "parm_gran") == 0)
|
||||
{
|
||||
char *p = strtok(value, ";");
|
||||
|
||||
for (i = 0; p != NULL && i < RIG_SETTING_MAX; ++i)
|
||||
{
|
||||
int level;
|
||||
@ -882,6 +883,7 @@ static int netrigctl_open(RIG *rig)
|
||||
rig->caps->parm_gran[i].max.i = rs->parm_gran[i].max.i = max;
|
||||
rig->caps->parm_gran[i].step.i = rs->parm_gran[i].step.i = step;
|
||||
}
|
||||
|
||||
p = strtok(NULL, ";");
|
||||
}
|
||||
}
|
||||
@ -2577,7 +2579,7 @@ static int netrigctl_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
static int netrigctl_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||
{
|
||||
int ret, len;
|
||||
char *cmdp;
|
||||
char *cmdp;
|
||||
const char cmd[] = "\\send_morse ";
|
||||
char buf[BUF_MAX];
|
||||
|
||||
|
@ -199,8 +199,10 @@ static int quisk_cleanup(RIG *rig)
|
||||
}
|
||||
|
||||
// these are in netrigctl.c
|
||||
extern int parse_array_int(const char *s, const char *delim, int *array, int array_len);
|
||||
extern int parse_array_double(const char *s, const char *delim, double *array, int array_len);
|
||||
extern int parse_array_int(const char *s, const char *delim, int *array,
|
||||
int array_len);
|
||||
extern int parse_array_double(const char *s, const char *delim, double *array,
|
||||
int array_len);
|
||||
|
||||
static int quisk_open(RIG *rig)
|
||||
{
|
||||
@ -554,6 +556,7 @@ static int quisk_open(RIG *rig)
|
||||
{
|
||||
RETURNFUNC((ret < 0) ? ret : -RIG_EPROTO);
|
||||
}
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
rig->caps->has_set_parm = rs->has_set_parm = strtoll(buf, NULL, 0);
|
||||
@ -564,6 +567,7 @@ static int quisk_open(RIG *rig)
|
||||
rs->mode_list |= rs->rx_range_list[i].modes;
|
||||
rs->vfo_list |= rs->rx_range_list[i].vfo;
|
||||
}
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
for (i = 0; i < HAMLIB_FRQRANGESIZ
|
||||
@ -572,6 +576,7 @@ static int quisk_open(RIG *rig)
|
||||
rs->mode_list |= rs->tx_range_list[i].modes;
|
||||
rs->vfo_list |= rs->tx_range_list[i].vfo;
|
||||
}
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
if (rs->vfo_list == 0)
|
||||
@ -580,10 +585,12 @@ static int quisk_open(RIG *rig)
|
||||
__func__);
|
||||
rs->vfo_list = RIG_VFO_A | RIG_VFO_B;
|
||||
}
|
||||
|
||||
HAMLIB_TRACE;
|
||||
#endif
|
||||
|
||||
if (prot_ver == 0) { RETURNFUNC(RIG_OK); }
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
// otherwise we continue reading protocol 1 fields
|
||||
@ -805,6 +812,7 @@ static int quisk_open(RIG *rig)
|
||||
else if (strcmp(setting, "parm_gran") == 0)
|
||||
{
|
||||
char *p = strtok(value, ";");
|
||||
|
||||
for (i = 0; p != NULL && i < RIG_SETTING_MAX; ++i)
|
||||
{
|
||||
int level;
|
||||
@ -826,6 +834,7 @@ static int quisk_open(RIG *rig)
|
||||
rig->caps->parm_gran[i].max.i = rs->parm_gran[i].max.i = max;
|
||||
rig->caps->parm_gran[i].step.i = rs->parm_gran[i].step.i = step;
|
||||
}
|
||||
|
||||
p = strtok(NULL, ";");
|
||||
}
|
||||
}
|
||||
@ -961,7 +970,7 @@ static int quisk_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
|
||||
|
||||
static int quisk_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
||||
pbwidth_t width)
|
||||
pbwidth_t width)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -991,7 +1000,7 @@ static int quisk_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
||||
|
||||
|
||||
static int quisk_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
pbwidth_t *width)
|
||||
pbwidth_t *width)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1186,7 +1195,7 @@ static int quisk_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
|
||||
|
||||
static int quisk_set_rptr_shift(RIG *rig, vfo_t vfo,
|
||||
rptr_shift_t rptr_shift)
|
||||
rptr_shift_t rptr_shift)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1215,7 +1224,7 @@ static int quisk_set_rptr_shift(RIG *rig, vfo_t vfo,
|
||||
|
||||
|
||||
static int quisk_get_rptr_shift(RIG *rig, vfo_t vfo,
|
||||
rptr_shift_t *rptr_shift)
|
||||
rptr_shift_t *rptr_shift)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1581,7 +1590,7 @@ static int quisk_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
}
|
||||
|
||||
static int quisk_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tx_width)
|
||||
pbwidth_t tx_width)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1610,7 +1619,7 @@ static int quisk_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
}
|
||||
|
||||
static int quisk_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
pbwidth_t *tx_width)
|
||||
pbwidth_t *tx_width)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1650,7 +1659,7 @@ static int quisk_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
|
||||
}
|
||||
|
||||
static int quisk_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
|
||||
vfo_t tx_vfo)
|
||||
vfo_t tx_vfo)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1680,7 +1689,7 @@ static int quisk_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
|
||||
|
||||
|
||||
static int quisk_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
|
||||
vfo_t *tx_vfo)
|
||||
vfo_t *tx_vfo)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1952,7 +1961,7 @@ static int quisk_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
|
||||
|
||||
static int quisk_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
||||
value_t val)
|
||||
value_t val)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -1993,7 +2002,7 @@ static int quisk_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
||||
|
||||
|
||||
static int quisk_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
||||
value_t *val)
|
||||
value_t *val)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -2208,7 +2217,7 @@ static int quisk_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
||||
|
||||
|
||||
static int quisk_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
int ret;
|
||||
char cmd[CMD_MAX];
|
||||
@ -2645,7 +2654,7 @@ static int quisk_get_trn(RIG *rig, int *trn)
|
||||
#endif
|
||||
|
||||
static int quisk_mW2power(RIG *rig, float *power, unsigned int mwpower,
|
||||
freq_t freq, rmode_t mode)
|
||||
freq_t freq, rmode_t mode)
|
||||
{
|
||||
char cmdbuf[32];
|
||||
char buf[BUF_MAX];
|
||||
@ -2669,7 +2678,7 @@ static int quisk_mW2power(RIG *rig, float *power, unsigned int mwpower,
|
||||
|
||||
|
||||
static int quisk_power2mW(RIG *rig, unsigned int *mwpower, float power,
|
||||
freq_t freq, rmode_t mode)
|
||||
freq_t freq, rmode_t mode)
|
||||
{
|
||||
char cmdbuf[64];
|
||||
char buf[BUF_MAX];
|
||||
|
@ -354,7 +354,7 @@ static void dummy_rot_simulate_rotation(ROT *rot)
|
||||
static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
||||
{
|
||||
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
@ -416,7 +416,7 @@ static int dummy_rot_reset(ROT *rot, rot_reset_t reset)
|
||||
static int dummy_rot_move(ROT *rot, int direction, int speed)
|
||||
{
|
||||
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__,
|
||||
@ -474,7 +474,7 @@ static int dummy_set_func(ROT *rot, setting_t func, int status)
|
||||
static int dummy_get_func(ROT *rot, setting_t func, int *status)
|
||||
{
|
||||
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
*status = (priv->funcs & func) ? 1 : 0;
|
||||
|
||||
@ -904,7 +904,7 @@ static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val)
|
||||
static int dummy_rot_get_status(ROT *rot, rot_status_t *status)
|
||||
{
|
||||
const struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
if (simulating)
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ static int sdrsharp_transaction(RIG *rig, char *cmd, char *value,
|
||||
if (value)
|
||||
{
|
||||
read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK
|
||||
strncpy(value, xml, value_len);
|
||||
strncpy(value, xml, value_len);
|
||||
}
|
||||
|
||||
}
|
||||
@ -486,10 +486,12 @@ static int sdrsharp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = rig->state.current_vfo;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SNPRINTF(cmd, sizeof(cmd), "F %.0lf\n", freq);
|
||||
|
@ -477,7 +477,7 @@ static int trxmanager_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
char response[MAXCMDLEN] = "";
|
||||
struct rig_state *rs = &rig->state;
|
||||
const struct trxmanager_priv_data *priv = (struct trxmanager_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s freq=%.1f\n", __func__,
|
||||
@ -1215,7 +1215,7 @@ static int trxmanager_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq,
|
||||
static const char *trxmanager_get_info(RIG *rig)
|
||||
{
|
||||
const struct trxmanager_priv_data *priv = (struct trxmanager_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
return priv->info;
|
||||
|
@ -915,6 +915,7 @@ int elad_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
retval = elad_get_split_vfo_if(rig, vfo, &tsplit, &tvfo);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
@ -983,10 +984,12 @@ int elad_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
||||
}
|
||||
|
||||
retval = elad_set_split(rig, vfo, split, txvfo);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Remember whether split is on, for elad_set_vfo */
|
||||
priv->split = split;
|
||||
|
||||
|
@ -83,7 +83,8 @@ static int gomx_set(RIG *rig, int table, char *varname, char *varvalue);
|
||||
/**
|
||||
* Get variable from the GS100 configuration table
|
||||
*/
|
||||
static int gomx_get(RIG *rig, int table, char *varname, const char *varvalue, int varvalue_len);
|
||||
static int gomx_get(RIG *rig, int table, char *varname, const char *varvalue,
|
||||
int varvalue_len);
|
||||
|
||||
/**
|
||||
* Sends a message to the GS100 and parses response lines
|
||||
@ -217,8 +218,9 @@ static int gs100_get_conf(RIG *rig, token_t token, char *val)
|
||||
static int gs100_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
#ifdef _LOCAL_SIMULATION_
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv = (struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv =
|
||||
(struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
#endif
|
||||
char fstr[20], value[20];
|
||||
int retval;
|
||||
@ -251,8 +253,9 @@ static int gs100_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int gs100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
#ifdef _LOCAL_SIMULATION_
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv = (struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv =
|
||||
(struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
#endif
|
||||
char resp[20];
|
||||
int retval;
|
||||
@ -287,8 +290,9 @@ static int gs100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
static int gs100_set_tx_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
#ifdef _LOCAL_SIMULATION_
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv = (struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv =
|
||||
(struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
#endif
|
||||
char fstr[20], value[20];
|
||||
int retval;
|
||||
@ -321,8 +325,9 @@ static int gs100_set_tx_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static int gs100_get_tx_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
#ifdef _LOCAL_SIMULATION_
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv = (struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
__attribute__((unused)) const struct gs100_priv_data *priv =
|
||||
(struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
#endif
|
||||
char resp[20];
|
||||
int retval;
|
||||
@ -470,7 +475,8 @@ static int gomx_set(RIG *rig, int table, char *varname, char *varvalue)
|
||||
|
||||
|
||||
/* Get variable from the GS100 configuration table */
|
||||
static int gomx_get(RIG *rig, int table, char *varname, const char *varvalue, int varvalue_len)
|
||||
static int gomx_get(RIG *rig, int table, char *varname, const char *varvalue,
|
||||
int varvalue_len)
|
||||
{
|
||||
__attribute__((unused)) struct gs100_priv_data *priv = (struct gs100_priv_data
|
||||
*)rig->state.priv;
|
||||
@ -504,6 +510,7 @@ static int gomx_get(RIG *rig, int table, char *varname, const char *varvalue, in
|
||||
if ((c = strchr(resp, '=')) == NULL) { return (-RIG_EPROTO); }
|
||||
|
||||
snprintf(fmt, sizeof(fmt), "%%%ds", varvalue_len);
|
||||
|
||||
if (sscanf(c + 1, fmt, varvalue_len) != 1) { return (-RIG_EPROTO); }
|
||||
|
||||
return (RIG_OK);
|
||||
|
@ -261,7 +261,7 @@ collision_retry:
|
||||
|
||||
// first 2 bytes of everyting are 0xfe so we won't test those
|
||||
// this allows some corruptin of the 0xfe bytes which has been seen in the wild
|
||||
if (memcmp(&buf[2], &sendbuf[2], frm_len-2) != 0)
|
||||
if (memcmp(&buf[2], &sendbuf[2], frm_len - 2) != 0)
|
||||
{
|
||||
/* Frames are different? */
|
||||
/* Problem on ci-v bus? */
|
||||
@ -290,8 +290,11 @@ read_another_frame:
|
||||
*/
|
||||
buf[0] = 0;
|
||||
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
|
||||
|
||||
if (frm_len > 4 && memcmp(buf, sendbuf, frm_len) == 0)
|
||||
{
|
||||
priv->serial_USB_echo_off = 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@ -587,7 +590,8 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
||||
unsigned char icmode;
|
||||
signed char icmode_ext;
|
||||
pbwidth_t width_tmp = width;
|
||||
const struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv;
|
||||
const struct icom_priv_data *priv_data = (struct icom_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode,
|
||||
|
@ -281,10 +281,12 @@ int ic7100_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x21;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -293,10 +295,12 @@ int ic7100_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x23;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
|
@ -756,8 +756,8 @@ struct rig_caps ic7300_caps =
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
@ -978,7 +978,7 @@ struct rig_caps ic9700_caps =
|
||||
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
|
||||
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
|
||||
},
|
||||
},
|
||||
.ext_tokens = ic9700_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
@ -999,8 +999,8 @@ struct rig_caps ic9700_caps =
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
@ -1300,7 +1300,7 @@ struct rig_caps ic705_caps =
|
||||
[PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDWFM,BANDAIR,BAND70CM,BAND33CM,BANDGEN"}},
|
||||
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
|
||||
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
},
|
||||
},
|
||||
.ext_tokens = ic705_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
@ -1321,8 +1321,8 @@ struct rig_caps ic705_caps =
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
@ -1574,7 +1574,7 @@ struct rig_caps ic905_caps =
|
||||
[PARM_BEEP] = {.min = {.i = 0}, .max = {.i = 1}},
|
||||
[PARM_SCREENSAVER] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}},
|
||||
[PARM_KEYERTYPE] = {.step = {.s = "STRAIGHT, BUG, PADDLE"}},
|
||||
},
|
||||
},
|
||||
.ext_tokens = ic705_ext_tokens,
|
||||
.extlevels = icom_ext_levels,
|
||||
.ctcss_list = full_ctcss_list,
|
||||
@ -1595,8 +1595,8 @@ struct rig_caps ic905_caps =
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
{ 1, 8, RIG_MTYPE_VOICE },
|
||||
{ 1, 8, RIG_MTYPE_MORSE },
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
@ -1897,6 +1897,7 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val)
|
||||
switch (parm)
|
||||
{
|
||||
#if 0
|
||||
|
||||
case RIG_PARM_ANN:
|
||||
return -RIG_ENIMPL; // How can we implement this?
|
||||
#endif
|
||||
@ -1929,6 +1930,7 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val)
|
||||
{
|
||||
|
||||
#if 0
|
||||
|
||||
case RIG_PARM_ANN:
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: not implemented\n", __func__);
|
||||
return -RIG_ENIMPL;
|
||||
@ -2023,10 +2025,12 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x95;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -2035,10 +2039,12 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x96;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
@ -2131,10 +2137,12 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x80;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -2143,10 +2151,12 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x84;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
@ -2168,16 +2178,18 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo)
|
||||
int ack_len = sizeof(ackbuf), retval = -RIG_EINTERNAL;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
if (rig->state.cache.satmode)
|
||||
{
|
||||
if (vfo == RIG_VFO_A) vfo = RIG_VFO_MAIN;
|
||||
else if (vfo == RIG_VFO_B) vfo = RIG_VFO_SUB;
|
||||
if (vfo == RIG_VFO_A) { vfo = RIG_VFO_MAIN; }
|
||||
else if (vfo == RIG_VFO_B) { vfo = RIG_VFO_SUB; }
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo %s\n", __func__, rig_strvfo(vfo));
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_A)
|
||||
{
|
||||
retval = icom_transaction(rig, 0x07, 0x00, NULL, 0, ackbuf, &ack_len);
|
||||
@ -2189,14 +2201,16 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo)
|
||||
else if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
|
||||
{
|
||||
retval = icom_transaction(rig, 0x07, 0xd0, NULL, 0, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
|
||||
return -retval;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_MAIN_A || vfo == RIG_VFO_MAIN_B)
|
||||
{
|
||||
int subcmd = vfo == RIG_VFO_MAIN_A ? 0x00: 0x01;
|
||||
int subcmd = vfo == RIG_VFO_MAIN_A ? 0x00 : 0x01;
|
||||
retval = icom_transaction(rig, 0x07, subcmd, NULL, 0, ackbuf, &ack_len);
|
||||
}
|
||||
}
|
||||
@ -2204,21 +2218,25 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
if (rig->state.cache.satmode)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__);
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n",
|
||||
__func__);
|
||||
// we return RIG_OK anyways as this should just be a bad request
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
// first switch to sub
|
||||
retval = icom_transaction(rig, 0x07, 0xd1, NULL, 0, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
|
||||
return -retval;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_SUB_A || vfo == RIG_VFO_SUB_B)
|
||||
{
|
||||
HAMLIB_TRACE;
|
||||
int subcmd = vfo == RIG_VFO_SUB_A ? 0x00: 0x01;
|
||||
int subcmd = vfo == RIG_VFO_SUB_A ? 0x00 : 0x01;
|
||||
retval = icom_transaction(rig, 0x07, subcmd, NULL, 0, ackbuf, &ack_len);
|
||||
}
|
||||
}
|
||||
|
@ -242,10 +242,12 @@ int ic7600_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x54;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -254,10 +256,12 @@ int ic7600_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x56;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
|
@ -144,7 +144,7 @@ struct cmdparams ic7610_extcmds[] =
|
||||
int ic7610_ext_tokens[] =
|
||||
{
|
||||
TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL,
|
||||
TOK_SCOPE_MSS, TOK_SCOPE_SDS, TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_SCOPE_RBW, TOK_SCOPE_MKP,TOK_IPP_FUNC,TOK_TX_INHIBIT_FUNC,TOK_DPP_FUNC,TOK_ICPW2_FUNC,
|
||||
TOK_SCOPE_MSS, TOK_SCOPE_SDS, TOK_SCOPE_STX, TOK_SCOPE_CFQ, TOK_SCOPE_EDG, TOK_SCOPE_VBW, TOK_SCOPE_RBW, TOK_SCOPE_MKP, TOK_IPP_FUNC, TOK_TX_INHIBIT_FUNC, TOK_DPP_FUNC, TOK_ICPW2_FUNC,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
@ -324,10 +324,12 @@ int ic7610_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -336,10 +338,12 @@ int ic7610_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
|
@ -223,10 +223,12 @@ int ic7700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -235,10 +237,12 @@ int ic7700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x61;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
|
@ -34,8 +34,10 @@
|
||||
#include "bandplan.h"
|
||||
#include "ic7300.h"
|
||||
|
||||
int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
|
||||
int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
|
||||
int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
||||
int sec, double msec, int utc_offset);
|
||||
int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset);
|
||||
|
||||
#define IC7800_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM|RIG_MODE_PKTFM)
|
||||
#define IC7800_1HZ_TS_MODES IC7800_ALL_RX_MODES
|
||||
@ -492,10 +494,12 @@ int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x60;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
@ -504,10 +508,12 @@ int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
|
@ -99,15 +99,19 @@ static int icf8101_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
int modebuf_len;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = icom_transaction(rig, 0x1A, 0x34, NULL, 0, modebuf, &modebuf_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
dump_hex(modebuf, modebuf_len);
|
||||
|
||||
switch (modebuf[1])
|
||||
|
182
rigs/icom/icom.c
182
rigs/icom/icom.c
@ -958,7 +958,9 @@ static vfo_t icom_current_vfo(RIG *rig)
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: currVFO=%s\n", __func__, rig_strvfo(currVFO));
|
||||
if (rig->state.current_vfo != RIG_VFO_NONE) currVFO = rig->state.current_vfo;
|
||||
|
||||
if (rig->state.current_vfo != RIG_VFO_NONE) { currVFO = rig->state.current_vfo; }
|
||||
|
||||
return currVFO;
|
||||
}
|
||||
|
||||
@ -1030,10 +1032,12 @@ retry_open:
|
||||
rs->dual_watch = 0;
|
||||
retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, &value);
|
||||
|
||||
if (retval == RIG_OK) {
|
||||
if (retval == RIG_OK)
|
||||
{
|
||||
rs->dual_watch = value;
|
||||
}
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: dual_watch=%d\n", __func__, rs->dual_watch);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: dual_watch=%d\n", __func__, rs->dual_watch);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: echo status known, getting frequency\n",
|
||||
__func__);
|
||||
rs->rigport.retry = 0;
|
||||
@ -1389,18 +1393,23 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
HAMLIB_TRACE;
|
||||
subcmd = 0x01; // get unselected VFO
|
||||
}
|
||||
|
||||
if (RIG_IS_IC7600 || RIG_IS_IC9700)
|
||||
{ // the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
{
|
||||
// the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
subcmd = 0;
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd = 1;
|
||||
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) { subcmd = 1; }
|
||||
}
|
||||
|
||||
cmd = 0x25;
|
||||
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
|
||||
&ack_len);
|
||||
|
||||
if (retval == -RIG_ERJCTED && vfo == RIG_VFO_MEM)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Rig is in MEM mode and MEM channel is empty\n", __func__);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Rig is in MEM mode and MEM channel is empty\n",
|
||||
__func__);
|
||||
return -RIG_ECONF;
|
||||
}
|
||||
}
|
||||
@ -1410,7 +1419,9 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
subcmd = -1;
|
||||
|
||||
#if 0
|
||||
if (rig->state.cache.ptt && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51))
|
||||
|
||||
if (rig->state.cache.ptt && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31
|
||||
|| ICOM_IS_ID51))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s(%d): ID55100 0x00\n", __func__, __LINE__);
|
||||
// for these rigs 0x00 is setting the freq and 0x03 is just for reading
|
||||
@ -1418,11 +1429,14 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
// temporary fix for ID5100 not giving ACK/NAK on 0x00 freq on E8 firmware
|
||||
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, NULL,
|
||||
NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: set_freq failed: %s\n", __func__, rigerror(retval));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: set_freq failed: %s\n", __func__,
|
||||
rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
else
|
||||
@ -1558,7 +1572,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *) rs->priv;
|
||||
if (priv->serial_USB_echo_off == -1) icom_get_usb_echo_off(rig);
|
||||
|
||||
if (priv->serial_USB_echo_off == -1) { icom_get_usb_echo_off(rig); }
|
||||
|
||||
cmd = C_RD_FREQ;
|
||||
subcmd = -1;
|
||||
@ -1696,20 +1711,29 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
// Rigs like IC-7600 new firmware has 0x25 and 0x26
|
||||
// So if this succeeds we'll assume all such rigs are targetable freq & mode
|
||||
int targetable_vfo_save = rig->caps->targetable_vfo;
|
||||
|
||||
if ((RIG_IS_IC7600 || RIG_IS_IC7610) && priv->x25cmdfails <= 0)
|
||||
{ // the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
{
|
||||
// the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
subcmd2 = 0;
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd2 = 1;
|
||||
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) { subcmd2 = 1; }
|
||||
|
||||
if (priv->x25cmdfails < 0)
|
||||
{ // we'll test this once to support the newer firmware
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: TARGETABLE_FREQ and TARGETABLE_MODE enabled for testing\n", __func__);
|
||||
rig->caps->targetable_vfo = rig->state.targetable_vfo |= RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE;
|
||||
{
|
||||
// we'll test this once to support the newer firmware
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: TARGETABLE_FREQ and TARGETABLE_MODE enabled for testing\n", __func__);
|
||||
rig->caps->targetable_vfo = rig->state.targetable_vfo |= RIG_TARGETABLE_FREQ |
|
||||
RIG_TARGETABLE_MODE;
|
||||
}
|
||||
}
|
||||
|
||||
if (RIG_IS_IC9700)
|
||||
{
|
||||
subcmd2 = 0;
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd2 = 1;
|
||||
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) { subcmd2 = 1; }
|
||||
}
|
||||
|
||||
retval = icom_transaction(rig, cmd2, subcmd2, NULL, 0, freqbuf, &freq_len);
|
||||
@ -1723,10 +1747,13 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
if (priv->x25cmdfails < 0)
|
||||
{
|
||||
priv->x25cmdfails = 1;
|
||||
|
||||
if (RIG_IS_IC7600 || RIG_IS_IC7610)
|
||||
{
|
||||
rig->caps->targetable_vfo = targetable_vfo_save;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: TARGETABLE_FREQ and TARGETABLE_MODE disabled -- older firmare likely\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: TARGETABLE_FREQ and TARGETABLE_MODE disabled -- older firmare likely\n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1806,10 +1833,12 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
__func__, freq_len);
|
||||
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
if (freq_len == 1 && vfo == RIG_VFO_MEM)
|
||||
{
|
||||
*freq = 0;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Rig is in MEM mode and MEM channel is empty\n", __func__);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Rig is in MEM mode and MEM channel is empty\n",
|
||||
__func__);
|
||||
return -RIG_ETRUNC;
|
||||
}
|
||||
|
||||
@ -2221,10 +2250,13 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, int datamode,
|
||||
{
|
||||
subcmd2 = 0x01; // get unselected VFO
|
||||
}
|
||||
|
||||
if (RIG_IS_IC7600 || RIG_IS_IC7610)
|
||||
{ // the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
{
|
||||
// the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
subcmd2 = 0;
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd2 = 1;
|
||||
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) { subcmd2 = 1; }
|
||||
}
|
||||
|
||||
buf[0] = mode;
|
||||
@ -2727,7 +2759,8 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
if (mode_len == 2) { priv_data->filter = modebuf[2]; }
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s(%d): modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, __LINE__, modebuf[0],
|
||||
"%s(%d): modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__,
|
||||
__LINE__, modebuf[0],
|
||||
modebuf[1], mode_len);
|
||||
}
|
||||
|
||||
@ -2796,11 +2829,13 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
// G90 does have dsp_flt command
|
||||
|
||||
// G90 does have dsp_flt command
|
||||
if (rig->caps->rig_model != RIG_MODEL_G90)
|
||||
{
|
||||
retval = icom_get_dsp_flt(rig, *mode);
|
||||
}
|
||||
|
||||
*width = retval;
|
||||
|
||||
if (retval == 0)
|
||||
@ -2829,6 +2864,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
retval = icom_get_dsp_flt(rig, *mode);
|
||||
}
|
||||
|
||||
*width = retval;
|
||||
|
||||
if (*width == 0) { *width = rig->state.cache.widthMainA; } // we'll use VFOA's width
|
||||
@ -3650,7 +3686,8 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
int found = 0;
|
||||
|
||||
for (i = 0;
|
||||
i <= HAMLIB_MAX_AGC_LEVELS && priv_caps->agc_levels[i].level != RIG_AGC_LAST; i++)
|
||||
i <= HAMLIB_MAX_AGC_LEVELS
|
||||
&& priv_caps->agc_levels[i].level != RIG_AGC_LAST; i++)
|
||||
{
|
||||
if (priv_caps->agc_levels[i].level == val.i)
|
||||
{
|
||||
@ -5871,11 +5908,15 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
// when transmitting in split mode the split VFO is active
|
||||
subcmd = (rig->state.cache.split
|
||||
&& rig->state.cache.ptt) ? 0x00 : 0x01; // get the unselected vfo
|
||||
|
||||
if (RIG_IS_IC7600 || RIG_IS_IC7610)
|
||||
{ // the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
{
|
||||
// the 7600/7610 do it different 0=Main, 1=Sub -- maybe other Icoms will start doing this too
|
||||
subcmd = 0;
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) subcmd = 1;
|
||||
|
||||
if (vfo & RIG_VFO_B || vfo & RIG_VFO_SUB) { subcmd = 1; }
|
||||
}
|
||||
|
||||
retval = icom_transaction(rig, cmd, subcmd, NULL, 0, ackbuf,
|
||||
&ack_len);
|
||||
|
||||
@ -7495,8 +7536,8 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
||||
|
||||
case RIG_FUNC_DUAL_WATCH:
|
||||
if ((RIG_IS_IC9100) ||
|
||||
(RIG_IS_IC9700) ||
|
||||
(RIG_IS_ID5100))
|
||||
(RIG_IS_IC9700) ||
|
||||
(RIG_IS_ID5100))
|
||||
{
|
||||
fct_cn = C_CTL_FUNC;
|
||||
fct_sc = S_MEM_DUALMODE;
|
||||
@ -7640,10 +7681,10 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
const char * icom_get_band(RIG *rig, int band)
|
||||
const char *icom_get_band(RIG *rig, int band)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
||||
const char *s = rig_get_band_str(rig, band, 1);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: %d=%s\n", __func__, band, s);
|
||||
@ -7674,11 +7715,13 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val)
|
||||
if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm)
|
||||
{
|
||||
int retval = icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val);
|
||||
|
||||
if (parm == RIG_PARM_BANDSELECT)
|
||||
{
|
||||
char *s = (char*)icom_get_band(rig, val->i);
|
||||
char *s = (char *)icom_get_band(rig, val->i);
|
||||
val->s = s;
|
||||
}
|
||||
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
}
|
||||
@ -8153,29 +8196,36 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
|
||||
switch (status)
|
||||
{
|
||||
case RIG_POWER_ON:
|
||||
|
||||
// ic7300 manual says ~150 for 115,200
|
||||
// we'll just send a few more to be sure for all speeds
|
||||
switch(rs->rigport.parm.serial.rate)
|
||||
switch (rs->rigport.parm.serial.rate)
|
||||
{
|
||||
case 4800:
|
||||
fe_max = 7;
|
||||
break;
|
||||
case 9600:
|
||||
fe_max = 13;
|
||||
break;
|
||||
case 19200:
|
||||
fe_max = 25;
|
||||
break;
|
||||
case 38400:
|
||||
fe_max = 50;
|
||||
break;
|
||||
case 57600:
|
||||
fe_max = 75;
|
||||
break;
|
||||
case 115200:
|
||||
default:
|
||||
fe_max = 150;
|
||||
case 4800:
|
||||
fe_max = 7;
|
||||
break;
|
||||
|
||||
case 9600:
|
||||
fe_max = 13;
|
||||
break;
|
||||
|
||||
case 19200:
|
||||
fe_max = 25;
|
||||
break;
|
||||
|
||||
case 38400:
|
||||
fe_max = 50;
|
||||
break;
|
||||
|
||||
case 57600:
|
||||
fe_max = 75;
|
||||
break;
|
||||
|
||||
case 115200:
|
||||
default:
|
||||
fe_max = 150;
|
||||
}
|
||||
|
||||
memset(fe_buf, 0xfe, fe_max);
|
||||
// sending more than enough 0xfe's to wake up the rs232
|
||||
write_block(&rs->rigport, fe_buf, fe_max);
|
||||
@ -8189,11 +8239,15 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
|
||||
retval =
|
||||
icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len);
|
||||
|
||||
float sec_wait = 5.5; // 5.5 worked for IC-9700 -- we default to worst-case-found
|
||||
if (RIG_IS_IC7300) sec_wait = 3.8;
|
||||
float sec_wait =
|
||||
5.5; // 5.5 worked for IC-9700 -- we default to worst-case-found
|
||||
|
||||
if (RIG_IS_IC7300) { sec_wait = 3.8; }
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting %g seconds for rig to wake up\n",
|
||||
__func__, sec_wait);
|
||||
hl_usleep(sec_wait * 1000 * 1000); // some are slow to start up -- may need to add more rigs
|
||||
hl_usleep(sec_wait * 1000 *
|
||||
1000); // some are slow to start up -- may need to add more rigs
|
||||
|
||||
// poweron == 0 means never powered -- == 2 means CAT turned off
|
||||
if (priv->poweron == 0 || priv->poweron == 2)
|
||||
@ -8202,13 +8256,14 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
|
||||
|
||||
for (i = 0; i < 10 && echo_status < 0; ++i)
|
||||
{
|
||||
echo_status = icom_get_usb_echo_off(rig);
|
||||
echo_status = icom_get_usb_echo_off(rig);
|
||||
|
||||
if (echo_status < 0)
|
||||
{
|
||||
hl_usleep(500*1000);
|
||||
hl_usleep(500 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (echo_status >= 0)
|
||||
{
|
||||
priv->poweron = 1;
|
||||
@ -8333,6 +8388,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
}
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
if (RIG_IS_IC2730
|
||||
|| RIG_IS_IC705
|
||||
|| RIG_IS_IC7100
|
||||
@ -8348,7 +8404,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
freq_t freq;
|
||||
short retry_save = rig->state.rigport.retry;
|
||||
short timeout_retry_save = rig->state.rigport.timeout_retry;
|
||||
HAMLIB_TRACE;
|
||||
HAMLIB_TRACE;
|
||||
|
||||
rig->state.rigport.retry = 0;
|
||||
rig->state.rigport.timeout_retry = 0;
|
||||
@ -8356,13 +8412,16 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
retval = rig_get_freq(rig, RIG_VFO_A, &freq);
|
||||
|
||||
if (retval == -RIG_ETIMEOUT)
|
||||
{ // then rig must be turned off
|
||||
HAMLIB_TRACE;
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: get freq failed...assuming power is off\n", __func__);
|
||||
{
|
||||
// then rig must be turned off
|
||||
HAMLIB_TRACE;
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: get freq failed...assuming power is off\n",
|
||||
__func__);
|
||||
rig->state.powerstat = RIG_POWER_OFF;
|
||||
return RIG_OK; // returning RIG_OK here makes the rig->state reflect POWER_OFF
|
||||
}
|
||||
HAMLIB_TRACE;
|
||||
|
||||
HAMLIB_TRACE;
|
||||
|
||||
rig->state.rigport.retry = retry_save;
|
||||
rig->state.rigport.timeout_retry = timeout_retry_save;
|
||||
@ -8377,11 +8436,14 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
ackbuf, &ack_len);
|
||||
|
||||
if (retval == -RIG_ETIMEOUT)
|
||||
{ // then rig must be turned off
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: get powerstat failed...assuming power is off\n", __func__);
|
||||
{
|
||||
// then rig must be turned off
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: get powerstat failed...assuming power is off\n",
|
||||
__func__);
|
||||
rig->state.powerstat = RIG_POWER_OFF;
|
||||
return RIG_OK; // returning RIG_OK here makes the rig->state reflect POWER_OFF
|
||||
}
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(retval);
|
||||
|
@ -246,7 +246,8 @@ int id5100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Sub on left\n", __func__, __LINE__);
|
||||
|
||||
if ((currvfo == RIG_VFO_B || currvfo == RIG_VFO_SUB) && (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB))
|
||||
if ((currvfo == RIG_VFO_B || currvfo == RIG_VFO_SUB) && (vfo == RIG_VFO_B
|
||||
|| vfo == RIG_VFO_SUB))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Method#3\n", __func__);
|
||||
id5100_set_vfo(rig, RIG_VFO_MAIN);
|
||||
|
@ -321,6 +321,7 @@ int elecraft_open(RIG *rig)
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVM failed\n", __func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVD", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
|
||||
@ -331,27 +332,29 @@ int elecraft_open(RIG *rig)
|
||||
|
||||
if (priv->is_k3)
|
||||
{
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVA", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVA", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVA failed\n", __func__);
|
||||
}
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVR", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVA failed\n", __func__);
|
||||
}
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVR failed\n", __func__);
|
||||
}
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVF", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVR", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVF failed\n", __func__);
|
||||
}
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVR failed\n", __func__);
|
||||
}
|
||||
|
||||
err = elecraft_get_firmware_revision_level(rig, "RVF", priv->fw_rev,
|
||||
(sizeof(k3_fw_rev) / sizeof(k3_fw_rev[0])));
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Firmware RVF failed\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@ -515,14 +518,20 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd,
|
||||
char buf[KENWOOD_MAX_BUF_LEN];
|
||||
char rvp = cmd[3];
|
||||
char *rv = "UNK";
|
||||
switch(rvp)
|
||||
|
||||
switch (rvp)
|
||||
{
|
||||
case 'M': rv = "MCU";break;
|
||||
case 'D': rv = "DSP";break;
|
||||
case 'A': rv = "AUX";break;
|
||||
case 'R': rv = "DVR";break;
|
||||
case 'F': rv = "FPF";break;
|
||||
default: rv = "???";break;
|
||||
case 'M': rv = "MCU"; break;
|
||||
|
||||
case 'D': rv = "DSP"; break;
|
||||
|
||||
case 'A': rv = "AUX"; break;
|
||||
|
||||
case 'R': rv = "DVR"; break;
|
||||
|
||||
case 'F': rv = "FPF"; break;
|
||||
|
||||
default: rv = "???"; break;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
@ -557,7 +566,8 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd,
|
||||
/* Copy out */
|
||||
strncpy(fw_rev, bufptr, fw_rev_sz - 1);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Elecraft %s firmware revision is %s\n", __func__,
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Elecraft %s firmware revision is %s\n",
|
||||
__func__,
|
||||
rv, fw_rev);
|
||||
|
||||
return RIG_OK;
|
||||
|
@ -839,21 +839,28 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_SWR:
|
||||
{
|
||||
struct kenwood_priv_caps *priv = kenwood_caps(rig);
|
||||
ptt_t ptt = 0;
|
||||
rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
||||
if (ptt == RIG_PTT_OFF) { val->f = priv->swr; return RIG_OK;}
|
||||
cmd = "ZZRM8"; // get SWR
|
||||
len = 5;
|
||||
ans = 8;
|
||||
retval = kenwood_transaction(rig, cmd, lvlbuf, sizeof(lvlbuf));
|
||||
if (retval != RIG_OK) { val->f = priv->swr; return RIG_OK;};
|
||||
sscanf(lvlbuf,"ZZRM8%lg", &priv->swr);
|
||||
val->f = priv->swr;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d) swr=%.1f\n", __func__, __LINE__, val->f);
|
||||
return RIG_OK;
|
||||
}
|
||||
{
|
||||
struct kenwood_priv_caps *priv = kenwood_caps(rig);
|
||||
ptt_t ptt = 0;
|
||||
rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
||||
|
||||
if (ptt == RIG_PTT_OFF) { val->f = priv->swr; return RIG_OK;}
|
||||
|
||||
cmd = "ZZRM8"; // get SWR
|
||||
len = 5;
|
||||
ans = 8;
|
||||
retval = kenwood_transaction(rig, cmd, lvlbuf, sizeof(lvlbuf));
|
||||
|
||||
if (retval != RIG_OK) { val->f = priv->swr; return RIG_OK;};
|
||||
|
||||
sscanf(lvlbuf, "ZZRM8%lg", &priv->swr);
|
||||
|
||||
val->f = priv->swr;
|
||||
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d) swr=%.1f\n", __func__, __LINE__, val->f);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
default:
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
@ -939,28 +946,30 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
case RIG_LEVEL_RFPOWER_METER:
|
||||
case RIG_LEVEL_RFPOWER_METER_WATTS:
|
||||
{
|
||||
// if not ptt then no power is going out so return 0W
|
||||
ptt_t ptt;
|
||||
rig_get_ptt(rig, RIG_VFO_TX, &ptt);
|
||||
if (!ptt) { val->f = 0; return RIG_OK; }
|
||||
n = sscanf(lvlbuf, "ZZRM5%f", &val->f);
|
||||
{
|
||||
// if not ptt then no power is going out so return 0W
|
||||
ptt_t ptt;
|
||||
rig_get_ptt(rig, RIG_VFO_TX, &ptt);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n",
|
||||
if (!ptt) { val->f = 0; return RIG_OK; }
|
||||
|
||||
n = sscanf(lvlbuf, "ZZRM5%f", &val->f);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n",
|
||||
__func__, lvlbuf);
|
||||
val->f = 0;
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
val->f = 0;
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
}
|
||||
|
||||
if (level != RIG_LEVEL_RFPOWER_METER_WATTS)
|
||||
{
|
||||
val->f /= 100;
|
||||
}
|
||||
if (level != RIG_LEVEL_RFPOWER_METER_WATTS)
|
||||
{
|
||||
val->f /= 100;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_RF:
|
||||
n = sscanf(lvlbuf + len, "%d", &val->i);
|
||||
@ -1137,20 +1146,23 @@ int powersdr_set_parm(RIG *rig, setting_t parm, value_t val)
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: val=%s\n", __func__, val.s);
|
||||
|
||||
switch(parm)
|
||||
switch (parm)
|
||||
{
|
||||
case RIG_PARM_BANDSELECT:
|
||||
if (strcmp(val.s,"BANDWWV")!=0)
|
||||
case RIG_PARM_BANDSELECT:
|
||||
if (strcmp(val.s, "BANDWWV") != 0)
|
||||
{
|
||||
int n = sscanf(val.s, "BAND%d", &band);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
int n = sscanf(val.s, "BAND%d", &band);
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%s\n", __func__, val.s);
|
||||
}
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%s\n", __func__, val.s);
|
||||
}
|
||||
SNPRINTF(cmd,sizeof(cmd),"ZZBS%03d;", band);
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
}
|
||||
|
||||
SNPRINTF(cmd, sizeof(cmd), "ZZBS%03d;", band);
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
}
|
||||
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
@ -1159,47 +1171,66 @@ int powersdr_get_parm(RIG *rig, setting_t parm, value_t *val)
|
||||
char cmd[KENWOOD_MAX_BUF_LEN];
|
||||
char buf[KENWOOD_MAX_BUF_LEN];
|
||||
int retval;
|
||||
int len,ans;
|
||||
int len, ans;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
switch(parm)
|
||||
switch (parm)
|
||||
{
|
||||
case RIG_PARM_BANDSELECT:
|
||||
case RIG_PARM_BANDSELECT:
|
||||
len = 4;
|
||||
ans = 3;
|
||||
SNPRINTF(cmd,sizeof(cmd),"%s","ZZBS;");
|
||||
SNPRINTF(cmd, sizeof(cmd), "%s", "ZZBS;");
|
||||
break;
|
||||
default:
|
||||
|
||||
default:
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
retval = kenwood_safe_transaction(rig, cmd, buf, 10, len + ans);
|
||||
if (retval != RIG_OK) RETURNFUNC(retval);
|
||||
|
||||
if (retval != RIG_OK) { RETURNFUNC(retval); }
|
||||
|
||||
int band;
|
||||
int n = sscanf(buf,"ZZBS%3d", &band);
|
||||
if (n != 1)
|
||||
int n = sscanf(buf, "ZZBS%3d", &band);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%s\n", __func__, buf);
|
||||
return (-RIG_EPROTO);
|
||||
}
|
||||
switch(band)
|
||||
|
||||
switch (band)
|
||||
{
|
||||
case 160: val->cs = "BAND160M";break;
|
||||
case 80: val->cs = "BAND80M";break;
|
||||
case 60: val->cs = "BAND60M";break;
|
||||
case 40: val->cs = "BAND40M";break;
|
||||
case 30: val->cs = "BAND30M";break;
|
||||
case 20: val->cs = "BAND20M";break;
|
||||
case 17: val->cs = "BAND17M";break;
|
||||
case 15: val->cs = "BAND15M";break;
|
||||
case 12: val->cs = "BAND12M";break;
|
||||
case 10: val->cs = "BAND10M";break;
|
||||
case 6: val->cs = "BAND6M";break;
|
||||
case 999: val->cs = "BANDWWV";break;
|
||||
default:
|
||||
case 160: val->cs = "BAND160M"; break;
|
||||
|
||||
case 80: val->cs = "BAND80M"; break;
|
||||
|
||||
case 60: val->cs = "BAND60M"; break;
|
||||
|
||||
case 40: val->cs = "BAND40M"; break;
|
||||
|
||||
case 30: val->cs = "BAND30M"; break;
|
||||
|
||||
case 20: val->cs = "BAND20M"; break;
|
||||
|
||||
case 17: val->cs = "BAND17M"; break;
|
||||
|
||||
case 15: val->cs = "BAND15M"; break;
|
||||
|
||||
case 12: val->cs = "BAND12M"; break;
|
||||
|
||||
case 10: val->cs = "BAND10M"; break;
|
||||
|
||||
case 6: val->cs = "BAND6M"; break;
|
||||
|
||||
case 999: val->cs = "BANDWWV"; break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%d\n", __func__, band);
|
||||
val->cs = "BAND???";
|
||||
val->cs = "BAND???";
|
||||
}
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
@ -1233,9 +1264,9 @@ struct rig_caps f6k_caps =
|
||||
.has_get_parm = RIG_PARM_NONE,
|
||||
.has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
|
||||
.level_gran = {
|
||||
[LVL_KEYSPD] = { .min = { .i = 5 }, .max = { .i = 60 }, .step = { .i = 1 } },
|
||||
[LVL_SLOPE_LOW] = { .min = { .i = 10}, .max = { .i = 1000}, .step = { .i = 50} },
|
||||
[LVL_SLOPE_HIGH] = { .min = { .i = 1000}, .max = { .i = 5000}, .step = { .i = 10} },
|
||||
[LVL_KEYSPD] = { .min = { .i = 5 }, .max = { .i = 60 }, .step = { .i = 1 } },
|
||||
[LVL_SLOPE_LOW] = { .min = { .i = 10}, .max = { .i = 1000}, .step = { .i = 50} },
|
||||
[LVL_SLOPE_HIGH] = { .min = { .i = 1000}, .max = { .i = 5000}, .step = { .i = 10} },
|
||||
}, /* FIXME: granularity */
|
||||
.parm_gran = {},
|
||||
//.extlevels = elecraft_ext_levels,
|
||||
@ -1373,7 +1404,7 @@ struct rig_caps powersdr_caps =
|
||||
.has_get_level = POWERSDR_LEVEL_ALL,
|
||||
.has_set_level = POWERSDR_LEVEL_SET,
|
||||
.has_get_parm = RIG_PARM_BANDSELECT,
|
||||
.has_set_parm = RIG_PARM_BANDSELECT,
|
||||
.has_set_parm = RIG_PARM_BANDSELECT,
|
||||
.level_gran = {
|
||||
#include "level_gran_kenwood.h"
|
||||
[LVL_KEYSPD] = { .min = { .i = 5 }, .max = { .i = 60 }, .step = { .i = 1 } },
|
||||
@ -1381,7 +1412,7 @@ struct rig_caps powersdr_caps =
|
||||
.parm_gran = {
|
||||
// there are V00 thru V13 but we don't cover them as of yet -- what rig?
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BAND2M,BANDWWV,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
//.extlevels = elecraft_ext_levels,
|
||||
//.extparms = kenwood_cfg_params,
|
||||
|
@ -81,6 +81,7 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: cmd==NULL?\n", __func__);
|
||||
return -RIG_EARG;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: called cmd='%s', len=%d, data=%p, data_len=%p\n", __func__, cmd, cmd_len,
|
||||
data, data_len);
|
||||
@ -151,7 +152,8 @@ transaction:
|
||||
*/
|
||||
static int get_ic10_if(RIG *rig, char *data)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
int i, data_len, retval = RIG_EINVAL;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
@ -167,7 +169,7 @@ static int get_ic10_if(RIG *rig, char *data)
|
||||
}
|
||||
|
||||
if (data_len < priv->if_len ||
|
||||
data[0] != 'I' || data[1] != 'F')
|
||||
data[0] != 'I' || data[1] != 'F')
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: unexpected answer %s, len=%d\n",
|
||||
__func__, data, data_len);
|
||||
@ -221,7 +223,8 @@ int ic10_set_vfo(RIG *rig, vfo_t vfo)
|
||||
*/
|
||||
int ic10_get_vfo(RIG *rig, vfo_t *vfo)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char vfobuf[50];
|
||||
unsigned char c;
|
||||
int retval, iflen;
|
||||
@ -288,7 +291,8 @@ int ic10_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
||||
|
||||
int ic10_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *txvfo)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char infobuf[50];
|
||||
int retval, iflen;
|
||||
|
||||
@ -317,7 +321,8 @@ int ic10_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *txvfo)
|
||||
*/
|
||||
int ic10_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char modebuf[50];
|
||||
unsigned char c;
|
||||
int retval, iflen;
|
||||
@ -531,7 +536,8 @@ int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
*/
|
||||
int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char infobuf[50];
|
||||
int retval, iflen, offset;
|
||||
|
||||
@ -600,7 +606,8 @@ int ic10_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
*/
|
||||
int ic10_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char membuf[50];
|
||||
int retval, iflen;
|
||||
|
||||
@ -1155,7 +1162,8 @@ const char *ic10_get_info(RIG *rig)
|
||||
*/
|
||||
int ic10_decode_event(RIG *rig)
|
||||
{
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
|
||||
const struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)
|
||||
rig->caps->priv;
|
||||
char asyncbuf[128], c;
|
||||
int retval, async_len = 128, iflen;
|
||||
vfo_t vfo;
|
||||
|
@ -2867,15 +2867,20 @@ int k3_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
if (ch < 1 || ch > 4)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1<=ch<=4, got %d\n", __func__, ch);
|
||||
return(-RIG_EINVAL);
|
||||
return (-RIG_EINVAL);
|
||||
}
|
||||
switch(ch)
|
||||
|
||||
switch (ch)
|
||||
{
|
||||
case 1: cmd = "SWT21;";break;
|
||||
case 2: cmd = "SWT31;";break;
|
||||
case 3: cmd = "SWT35;";break;
|
||||
case 4: cmd = "SWT39;";break;
|
||||
case 1: cmd = "SWT21;"; break;
|
||||
|
||||
case 2: cmd = "SWT31;"; break;
|
||||
|
||||
case 3: cmd = "SWT35;"; break;
|
||||
|
||||
case 4: cmd = "SWT39;"; break;
|
||||
}
|
||||
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
return retval;
|
||||
}
|
||||
@ -2895,8 +2900,9 @@ int k4_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
if (ch < 1 || ch > 8)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1<=ch<=8, got %d\n", __func__, ch);
|
||||
return(-RIG_EINVAL);
|
||||
return (-RIG_EINVAL);
|
||||
}
|
||||
|
||||
sprintf(cmd, "DAMP%d00000;", ch);
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
return retval;
|
||||
@ -2920,7 +2926,7 @@ int k3_stop_morse(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
int retval;
|
||||
char cmd[32];
|
||||
SNPRINTF(cmd,sizeof(cmd),"KY %c;", 0x04);
|
||||
SNPRINTF(cmd, sizeof(cmd), "KY %c;", 0x04);
|
||||
retval = kenwood_transaction(rig, cmd, NULL, 0);
|
||||
return retval;
|
||||
}
|
||||
|
@ -246,15 +246,17 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
|
||||
struct kenwood_priv_caps *caps = kenwood_caps(rig);
|
||||
struct rig_state *rs;
|
||||
|
||||
if (datasize > 0 && datasize < (cmdstr ? strlen(cmdstr) : 0)) {
|
||||
rig_debug(RIG_DEBUG_WARN, "%s called cmd=%s datasize=%d, datasize < cmd length?\n", __func__,
|
||||
cmdstr ? cmdstr : "(NULL)",
|
||||
(int)datasize);
|
||||
}
|
||||
if (datasize > 0 && datasize < (cmdstr ? strlen(cmdstr) : 0))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s called cmd=%s datasize=%d, datasize < cmd length?\n", __func__,
|
||||
cmdstr ? cmdstr : "(NULL)",
|
||||
(int)datasize);
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called cmd=%s\n", __func__,
|
||||
cmdstr ? cmdstr : "(NULL)");
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called cmd=%s\n", __func__,
|
||||
cmdstr ? cmdstr : "(NULL)");
|
||||
}
|
||||
|
||||
if ((!cmdstr && !datasize) || (datasize && !data))
|
||||
@ -358,8 +360,11 @@ transaction_write:
|
||||
if (skip)
|
||||
{
|
||||
// most command we give them a little time -- but not KY
|
||||
if (strncmp(cmdstr, "KY ", 3)!= 0)
|
||||
hl_usleep(200 * 1000); // give little settle time for these commands
|
||||
if (strncmp(cmdstr, "KY ", 3) != 0)
|
||||
{
|
||||
hl_usleep(200 * 1000); // give little settle time for these commands
|
||||
}
|
||||
|
||||
goto transaction_quit;
|
||||
}
|
||||
}
|
||||
@ -367,7 +372,7 @@ transaction_write:
|
||||
// Malachite SDR cannot send ID after FA
|
||||
if (!datasize && priv->no_id) { RETURNFUNC2(RIG_OK); }
|
||||
|
||||
if (!datasize && strncmp(cmdstr, "KY",2)!=0)
|
||||
if (!datasize && strncmp(cmdstr, "KY", 2) != 0)
|
||||
{
|
||||
rig->state.transaction_active = 0;
|
||||
|
||||
@ -720,13 +725,18 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
|
||||
occasionally send short results */
|
||||
{
|
||||
// QRPLABS can't seem top decide if they give 37 or 38 bytes for IF command
|
||||
if (strncmp(cmd,"IF",2)==0 && rig->caps->rig_model == RIG_MODEL_QRPLABS) break;
|
||||
if (strncmp(cmd, "IF", 2) == 0 && rig->caps->rig_model == RIG_MODEL_QRPLABS) { break; }
|
||||
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: wrong answer; len for cmd %s: expected = %d, got %d\n",
|
||||
__func__, cmd, (int)expected, (int)length);
|
||||
|
||||
err = -RIG_EPROTO;
|
||||
|
||||
elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_INVALIDATE);
|
||||
|
||||
hl_usleep(50 * 1000); // let's do a short wait
|
||||
}
|
||||
}
|
||||
@ -1160,7 +1170,7 @@ int kenwood_get_if(RIG *rig)
|
||||
int post_write_delay_save = 0;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
|
||||
// Malachite has a 400ms delay but some get commands can work with no delay
|
||||
if (RIG_IS_MALACHITE)
|
||||
{
|
||||
@ -1169,12 +1179,13 @@ int kenwood_get_if(RIG *rig)
|
||||
}
|
||||
|
||||
retval = kenwood_safe_transaction(rig, "IF", priv->info,
|
||||
KENWOOD_MAX_BUF_LEN, caps->if_len);
|
||||
KENWOOD_MAX_BUF_LEN, caps->if_len);
|
||||
|
||||
if (RIG_IS_MALACHITE)
|
||||
{
|
||||
rig->state.post_write_delay = post_write_delay_save;
|
||||
}
|
||||
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
||||
@ -1862,9 +1873,9 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
}
|
||||
|
||||
// Malchite is so slow we don't do the get_freq
|
||||
// And when we have detected Doppler operations we just set the freq all the time
|
||||
// And when we have detected Doppler operations we just set the freq all the time
|
||||
// This should provide stable timing for set_ptt operation so relay delays are consistent
|
||||
if (!RIG_IS_MALACHITE && rig->state.doppler == 0)
|
||||
if (!RIG_IS_MALACHITE && rig->state.doppler == 0)
|
||||
{
|
||||
rig_get_freq(rig, tvfo, &tfreq);
|
||||
|
||||
@ -2461,6 +2472,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
SNPRINTF(buf, sizeof(buf), "MD%c", c);
|
||||
err = kenwood_transaction(rig, buf, NULL, 0);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: MD cmd failed: %s\n", __func__, rigerror(err));
|
||||
@ -3150,6 +3162,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
|
||||
/* Check input parameter against level_gran limits */
|
||||
result = check_level_param(rig, level, val, &level_info);
|
||||
|
||||
if (result != RIG_OK) { RETURNFUNC(result); }
|
||||
|
||||
if (RIG_LEVEL_IS_FLOAT(level))
|
||||
@ -3534,7 +3547,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
}
|
||||
|
||||
level_info = &rig->caps->level_gran[rig_setting2idx(level)];
|
||||
|
||||
|
||||
switch (level)
|
||||
{
|
||||
int power_now, power_min, power_max;
|
||||
@ -3882,6 +3895,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__);
|
||||
RETURNFUNC(ret);
|
||||
}
|
||||
|
||||
vali = val->i;
|
||||
val->f = (vali - priv->micgain_min) / (float)(priv->micgain_max -
|
||||
priv->micgain_min);
|
||||
@ -5001,7 +5015,8 @@ int kenwood_set_trn(RIG *rig, int trn)
|
||||
|
||||
switch (rig->caps->rig_model)
|
||||
{
|
||||
char buf[5];
|
||||
char buf[5];
|
||||
|
||||
case RIG_MODEL_POWERSDR: // powersdr doesn't have AI command
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
|
||||
@ -5209,6 +5224,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status)
|
||||
rig_flush(&rig->state.rigport);
|
||||
|
||||
result = kenwood_safe_transaction(rig, "PS", pwrbuf, 6, 3);
|
||||
|
||||
if (result != RIG_OK)
|
||||
{
|
||||
RETURNFUNC(result);
|
||||
@ -5314,7 +5330,7 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
||||
|
||||
if (!strncmp(m2, "KY2", 3)) { break; }
|
||||
|
||||
if (!strncmp(m2, "KY1", 3)) { hl_usleep(50*1000); }
|
||||
if (!strncmp(m2, "KY1", 3)) { hl_usleep(50 * 1000); }
|
||||
else { RETURNFUNC(-RIG_EINVAL); }
|
||||
}
|
||||
|
||||
@ -5386,25 +5402,28 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank)
|
||||
SNPRINTF(cmd, sizeof(cmd), "PB01");
|
||||
kenwood_transaction(rig, cmd, NULL, 0);
|
||||
#endif
|
||||
|
||||
if ((bank < 1 || bank > 3) &&
|
||||
(rig->caps->rig_model == RIG_MODEL_TS2000
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS480))
|
||||
(rig->caps->rig_model == RIG_MODEL_TS2000
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS480))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: TS2000/TS480 channel is from 1 to 3\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
// some rigs have 5 channels -- newew ones have 10 channels
|
||||
if ((bank < 1 || bank > 5)
|
||||
&& (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S))
|
||||
&& (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: TS590S/SG channel is from 1 to 5\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS2000
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS480
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S)))
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS480
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S)))
|
||||
{
|
||||
SNPRINTF(cmd, sizeof(cmd), "PB%d", bank);
|
||||
}
|
||||
@ -5412,6 +5431,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank)
|
||||
{
|
||||
SNPRINTF(cmd, sizeof(cmd), "PB1%d1", bank);
|
||||
}
|
||||
|
||||
priv->voice_bank = bank;
|
||||
RETURNFUNC(kenwood_transaction(rig, cmd, NULL, 0));
|
||||
}
|
||||
@ -5421,10 +5441,11 @@ int kenwood_stop_voice_mem(RIG *rig, vfo_t vfo)
|
||||
char cmd[16];
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
ENTERFUNC;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS2000
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS480
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S)))
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS480
|
||||
|| (rig->caps->rig_model == RIG_MODEL_TS590SG
|
||||
|| rig->caps->rig_model == RIG_MODEL_TS590S)))
|
||||
{
|
||||
SNPRINTF(cmd, sizeof(cmd), "PB0");
|
||||
}
|
||||
@ -5432,6 +5453,7 @@ int kenwood_stop_voice_mem(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
SNPRINTF(cmd, sizeof(cmd), "PB1%d0", priv->voice_bank);
|
||||
}
|
||||
|
||||
RETURNFUNC(kenwood_transaction(rig, cmd, NULL, 0));
|
||||
}
|
||||
|
||||
|
@ -832,7 +832,9 @@ int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
else if (kenwood_val == RIG_AGC_SLOW) { kenwood_val = 20; }
|
||||
else if (kenwood_val != RIG_AGC_OFF)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown AGC level, expect OFF,SLOW,MEDIUM,FAST,SUPERFAST, got %d\n", __func__, kenwood_val);
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: unknown AGC level, expect OFF,SLOW,MEDIUM,FAST,SUPERFAST, got %d\n",
|
||||
__func__, kenwood_val);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ th_decode_event(RIG *rig)
|
||||
|
||||
retval = num_sscanf(asyncbuf,
|
||||
"BUF %u,%"SCNfreq",%X,%d,%d,%d,%d,,%d,,%d,%"SCNfreq",%d",
|
||||
&vfo, &freq, (unsigned int*)&step, &shift, &rev, &tone,
|
||||
&vfo, &freq, (unsigned int *)&step, &shift, &rev, &tone,
|
||||
&ctcss, &tonefq, &ctcssfq, &offset, &mode);
|
||||
|
||||
if (retval != 11)
|
||||
@ -268,7 +268,7 @@ th_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = num_sscanf(buf, "FQ %"SCNfreq",%x", freq, (unsigned*)&step);
|
||||
retval = num_sscanf(buf, "FQ %"SCNfreq",%x", freq, (unsigned *)&step);
|
||||
|
||||
if (retval != 2)
|
||||
{
|
||||
|
@ -1282,11 +1282,13 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
|
||||
else { data = buf + 7; }
|
||||
|
||||
n = sscanf(data, "%"SCNfreq, &chan->freq);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error scanning %s\n", __func__, data);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
c = data[46]; // mode
|
||||
|
||||
if (c >= '0' && c <= '2')
|
||||
@ -1310,16 +1312,19 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
|
||||
}
|
||||
|
||||
n = sscanf(data + 37, "%ld", &chan->rptr_offs);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error scanning data[37]%s\n", __func__, data);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
c = data[17]; // Tone status
|
||||
|
||||
if (c != '0')
|
||||
{
|
||||
n = sscanf(data + 25, "%d", &tmp);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error scanning data[25]%s\n", __func__, data);
|
||||
@ -1341,6 +1346,7 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
|
||||
if (c != '0')
|
||||
{
|
||||
n = sscanf(data + 28, "%d", &tmp);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error scanning data[28]%s\n", __func__, data);
|
||||
@ -1362,11 +1368,13 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
|
||||
if (c != '0')
|
||||
{
|
||||
n = sscanf(data + 31, "%d", &tmp);
|
||||
|
||||
if (n != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: error scanning data[31]%s\n", __func__, data);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
chan->dcs_code = tmp;
|
||||
}
|
||||
else
|
||||
|
@ -815,10 +815,10 @@ static int tmd710_scan_me(char *buf, tmd710_me *me_struct)
|
||||
|
||||
retval = num_sscanf(buf,
|
||||
"ME %x,%"SCNfreq",%x,%x,%x,%x,%x,%x,%d,%d,%d,%d,%d,%"SCNfreq",%d,%d",
|
||||
(unsigned int*)&me_struct->channel, &me_struct->freq,
|
||||
(unsigned int*)&me_struct->step, (unsigned int*)&me_struct->shift,
|
||||
(unsigned int*)&me_struct->reverse, (unsigned int*)&me_struct->tone,
|
||||
(unsigned int*)&me_struct->ct, (unsigned int*)&me_struct->dcs,
|
||||
(unsigned int *)&me_struct->channel, &me_struct->freq,
|
||||
(unsigned int *)&me_struct->step, (unsigned int *)&me_struct->shift,
|
||||
(unsigned int *)&me_struct->reverse, (unsigned int *)&me_struct->tone,
|
||||
(unsigned int *)&me_struct->ct, (unsigned int *)&me_struct->dcs,
|
||||
&me_struct->tone_freq, &me_struct->ct_freq,
|
||||
&me_struct->dcs_val, &me_struct->offset,
|
||||
&me_struct->mode, &me_struct->tx_freq,
|
||||
@ -963,10 +963,10 @@ int tmd710_pull_fo(RIG *rig, vfo_t vfo, tmd710_fo *fo_struct)
|
||||
}
|
||||
|
||||
retval = num_sscanf(buf, "FO %x,%"SCNfreq",%x,%x,%x,%x,%x,%x,%d,%d,%d,%d,%d",
|
||||
(unsigned int*)&fo_struct->vfo, &fo_struct->freq,
|
||||
(unsigned int*)&fo_struct->step, (unsigned int*)&fo_struct->shift,
|
||||
(unsigned int*)&fo_struct->reverse, (unsigned int*)&fo_struct->tone,
|
||||
(unsigned int*)&fo_struct->ct, (unsigned int*)&fo_struct->dcs,
|
||||
(unsigned int *)&fo_struct->vfo, &fo_struct->freq,
|
||||
(unsigned int *)&fo_struct->step, (unsigned int *)&fo_struct->shift,
|
||||
(unsigned int *)&fo_struct->reverse, (unsigned int *)&fo_struct->tone,
|
||||
(unsigned int *)&fo_struct->ct, (unsigned int *)&fo_struct->dcs,
|
||||
&fo_struct->tone_freq, &fo_struct->ct_freq,
|
||||
&fo_struct->dcs_val, &fo_struct->offset,
|
||||
&fo_struct->mode);
|
||||
@ -1006,10 +1006,10 @@ int tmd710_push_fo(RIG *rig, vfo_t vfo, tmd710_fo *fo_struct)
|
||||
}
|
||||
|
||||
retval = num_sscanf(buf, "FO %x,%"SCNfreq",%x,%x,%x,%x,%x,%x,%d,%d,%d,%d,%d",
|
||||
(unsigned int*)&fo_struct->vfo, &fo_struct->freq,
|
||||
(unsigned int*)&fo_struct->step, (unsigned int*)&fo_struct->shift,
|
||||
(unsigned int*)&fo_struct->reverse, (unsigned int*)&fo_struct->tone,
|
||||
(unsigned int*)&fo_struct->ct, (unsigned int*)&fo_struct->dcs,
|
||||
(unsigned int *)&fo_struct->vfo, &fo_struct->freq,
|
||||
(unsigned int *)&fo_struct->step, (unsigned int *)&fo_struct->shift,
|
||||
(unsigned int *)&fo_struct->reverse, (unsigned int *)&fo_struct->tone,
|
||||
(unsigned int *)&fo_struct->ct, (unsigned int *)&fo_struct->dcs,
|
||||
&fo_struct->tone_freq, &fo_struct->ct_freq,
|
||||
&fo_struct->dcs_val, &fo_struct->offset,
|
||||
&fo_struct->mode);
|
||||
@ -1061,12 +1061,12 @@ int tmd710_scan_mu(char *buf, tmd710_mu *mu_struct)
|
||||
&mu_struct->brightness_level,
|
||||
&mu_struct->auto_brightness,
|
||||
&mu_struct->backlight_color,
|
||||
(unsigned int*)&mu_struct->pf1_key,
|
||||
(unsigned int*)&mu_struct->pf2_key,
|
||||
(unsigned int*)&mu_struct->mic_pf1_key,
|
||||
(unsigned int*)&mu_struct->mic_pf2_key,
|
||||
(unsigned int*)&mu_struct->mic_pf3_key,
|
||||
(unsigned int*)&mu_struct->mic_pf4_key,
|
||||
(unsigned int *)&mu_struct->pf1_key,
|
||||
(unsigned int *)&mu_struct->pf2_key,
|
||||
(unsigned int *)&mu_struct->mic_pf1_key,
|
||||
(unsigned int *)&mu_struct->mic_pf2_key,
|
||||
(unsigned int *)&mu_struct->mic_pf3_key,
|
||||
(unsigned int *)&mu_struct->mic_pf4_key,
|
||||
&mu_struct->mic_key_lock,
|
||||
&mu_struct->scan_resume,
|
||||
&mu_struct->auto_power_off,
|
||||
@ -2491,7 +2491,7 @@ int tmd710_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = sscanf(ackbuf, "SQ %X", (unsigned int*)&l);
|
||||
retval = sscanf(ackbuf, "SQ %X", (unsigned int *)&l);
|
||||
|
||||
if (retval != 1 || l < TMD710_SQL_MIN || l > TMD710_SQL_MAX)
|
||||
{
|
||||
|
@ -261,6 +261,7 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
if (vfo == RIG_VFO_TX || vfo == RIG_VFO_RX) { vfo = vfo_fixup(rig, vfo, rig->state.cache.split); }
|
||||
|
||||
retval = RIG_OK;
|
||||
|
||||
if (!sf_fails)
|
||||
{
|
||||
SNPRINTF(cmd, sizeof(cmd), "SF%d", vfo == RIG_VFO_A ? 0 : 1);
|
||||
@ -284,11 +285,14 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
// now let's get our widths
|
||||
SNPRINTF(cmd, sizeof(cmd), "SH");
|
||||
retval = kenwood_safe_transaction(rig, cmd, ackbuf, sizeof(ackbuf), 4);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: SH command failed: %s\n", __func__, rigerror(retval));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: SH command failed: %s\n", __func__,
|
||||
rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
int hwidth;
|
||||
sscanf(cmd, "SH%d", &hwidth);
|
||||
int lwidth;
|
||||
@ -296,9 +300,11 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
SNPRINTF(cmd, sizeof(cmd), "SL");
|
||||
sscanf(cmd, "SH%d", &lwidth);
|
||||
retval = kenwood_safe_transaction(rig, cmd, ackbuf, sizeof(ackbuf), 4);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: SL command failed: %s\n", __func__, rigerror(retval));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: SL command failed: %s\n", __func__,
|
||||
rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -463,14 +469,18 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
case RIG_LEVEL_USB_AF:
|
||||
kenwood_val = val.f * 9;
|
||||
cmd = 65; // TS-590S
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) cmd=72;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) { cmd = 72; }
|
||||
|
||||
SNPRINTF(levelbuf, sizeof(levelbuf), "EX%03d0000%d", cmd, kenwood_val);
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_USB_AF_INPUT:
|
||||
kenwood_val = val.f * 9;
|
||||
cmd = 64; // TS-590S
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) cmd=71;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) { cmd = 71; }
|
||||
|
||||
SNPRINTF(levelbuf, sizeof(levelbuf), "EX%03d0000%d", cmd, kenwood_val);
|
||||
break;
|
||||
|
||||
@ -649,14 +659,18 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
case RIG_LEVEL_USB_AF:
|
||||
cmd = 65; // TS-590S
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) cmd=72;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) { cmd = 72; }
|
||||
|
||||
retval = ts590_get_ex_menu(rig, cmd, 1, &levelint);
|
||||
val->f = levelint / 9.0;
|
||||
return retval;
|
||||
|
||||
case RIG_LEVEL_USB_AF_INPUT:
|
||||
cmd = 65; // TS-590S
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) cmd=71;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS590SG) { cmd = 71; }
|
||||
|
||||
retval = ts590_get_ex_menu(rig, cmd, 1, &levelint);
|
||||
val->f = levelint / 9.0;
|
||||
return retval;
|
||||
@ -914,8 +928,12 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
sscanf(ackbuf, "SM0%d", &raw_value);
|
||||
|
||||
val->f = (float) raw_value / 30.0f;
|
||||
|
||||
if (level == RIG_LEVEL_RFPOWER_METER_WATTS)
|
||||
{
|
||||
val->f *= 100;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -565,7 +565,7 @@ struct rig_caps ts870s_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_kenwood.h"
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
},
|
||||
.parm_gran = {},
|
||||
.ctcss_list = kenwood38_ctcss_list,
|
||||
|
@ -50,11 +50,12 @@ int kenwood_ts890_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
|
||||
retval = check_level_param(rig, level, val, &level_info);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_AGC:
|
||||
@ -62,20 +63,22 @@ int kenwood_ts890_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
/* possible values for TS890 0(=off), 1(=slow), 2(=mid), 3(=fast), 4(=off/Last) */
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s TS890S RIG_LEVEL_AGC\n", __func__);
|
||||
|
||||
kenwood_val = -1; /* Flag invalid value */
|
||||
for (int j = 0; j < rig->caps->agc_level_count; j++)
|
||||
{
|
||||
if (val.i == rig->caps->agc_levels[j])
|
||||
{
|
||||
kenwood_val = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( kenwood_val < 0)
|
||||
{
|
||||
kenwood_val = -1; /* Flag invalid value */
|
||||
|
||||
for (int j = 0; j < rig->caps->agc_level_count; j++)
|
||||
{
|
||||
if (val.i == rig->caps->agc_levels[j])
|
||||
{
|
||||
kenwood_val = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (kenwood_val < 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value:%d\n", __func__, val.i);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
SNPRINTF(levelbuf, sizeof(levelbuf), "GC%d", kenwood_val);
|
||||
return kenwood_transaction(rig, levelbuf, NULL, 0); /* Odd man out */
|
||||
@ -189,16 +192,17 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
return retval;
|
||||
}
|
||||
|
||||
levelint = ackbuf[2] - '0'; /* atoi */
|
||||
if (levelint >= 0 && levelint < rig->caps->agc_level_count)
|
||||
{
|
||||
val->i = rig->caps->agc_levels[levelint];
|
||||
}
|
||||
else
|
||||
{
|
||||
levelint = ackbuf[2] - '0'; /* atoi */
|
||||
|
||||
if (levelint >= 0 && levelint < rig->caps->agc_level_count)
|
||||
{
|
||||
val->i = rig->caps->agc_levels[levelint];
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown agc value: %s\n", __func__, ackbuf);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
|
||||
@ -344,13 +348,17 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
case RIG_LEVEL_USB_AF:
|
||||
case RIG_LEVEL_USB_AF_INPUT:
|
||||
if ( level == RIG_LEVEL_USB_AF )
|
||||
{ command_string = "EX00708"; }
|
||||
if (level == RIG_LEVEL_USB_AF)
|
||||
{ command_string = "EX00708"; }
|
||||
else
|
||||
{ command_string = "EX00706"; }
|
||||
{ command_string = "EX00706"; }
|
||||
|
||||
len = strlen(command_string);
|
||||
retval = kenwood_safe_transaction(rig, command_string, ackbuf, sizeof(ackbuf), len + 4);
|
||||
retval = kenwood_safe_transaction(rig, command_string, ackbuf, sizeof(ackbuf),
|
||||
len + 4);
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
sscanf(&ackbuf[len + 1], "%3d", &levelint); /* Skip the extra space */
|
||||
val->f = levelint * level_info->step.f;
|
||||
return RIG_OK;
|
||||
@ -542,8 +550,8 @@ struct rig_caps ts890s_caps =
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1100 }, .step = { .i = 5 } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0 / 255.0 } },
|
||||
[LVL_USB_AF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0/100.0 } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0/100.0 } },
|
||||
[LVL_USB_AF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0 / 100.0 } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0 / 100.0 } },
|
||||
},
|
||||
.has_get_func = TS890_FUNC_ALL,
|
||||
.has_set_func = TS890_FUNC_ALL,
|
||||
|
@ -80,7 +80,7 @@ struct rig_caps ts930_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_kenwood.h"
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
},
|
||||
.parm_gran = {},
|
||||
.preamp = { RIG_DBLST_END, }, /* FIXME: preamp list */
|
||||
|
@ -162,7 +162,7 @@ struct rig_caps ts990s_caps =
|
||||
#include "level_gran_kenwood.h"
|
||||
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 18 }, .step = { .i = 6 } },
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1100 }, .step = { .i = 10 } },
|
||||
[LVL_COMP] = { .min = { .f = 0.0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_COMP] = { .min = { .f = 0.0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
},
|
||||
.parm_gran = {},
|
||||
.vfo_ops = TS990S_VFO_OP,
|
||||
@ -648,13 +648,14 @@ int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
|
||||
case RIG_LEVEL_SWR:
|
||||
retval = get_kenwood_meter_reading(rig, '2', &lvl);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
val->f = rig_raw2val_float(lvl, &rig->caps->swr_cal);
|
||||
val->f = round(val->f*10)/10.0; // 1 decimal place precision
|
||||
val->f = round(val->f * 10) / 10.0; // 1 decimal place precision
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_METER:
|
||||
@ -739,7 +740,7 @@ int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_level %s", __func__,
|
||||
rig_strlevel(level));
|
||||
|
@ -1120,7 +1120,7 @@ int elektor507_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
int elektor507_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
const struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
int ret = 0;
|
||||
|
||||
switch (level)
|
||||
@ -1197,7 +1197,7 @@ int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
const struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
|
||||
*ant_curr = priv->ant;
|
||||
|
||||
@ -1211,7 +1211,7 @@ int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
static int cy_update_pll(RIG *rig, unsigned char IICadr)
|
||||
{
|
||||
const struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
int P0, R40, R41, R42;
|
||||
unsigned char Div1N;
|
||||
unsigned char Clk3_src;
|
||||
|
@ -424,7 +424,8 @@ const char *fifisdr_get_info(RIG *rig)
|
||||
|
||||
int fifisdr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct fifisdr_priv_instance_data *priv = (struct fifisdr_priv_instance_data *)
|
||||
const struct fifisdr_priv_instance_data *priv = (struct
|
||||
fifisdr_priv_instance_data *)
|
||||
rig->state.priv;
|
||||
int ret;
|
||||
double mhz;
|
||||
@ -450,7 +451,8 @@ int fifisdr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
int fifisdr_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct fifisdr_priv_instance_data *priv = (struct fifisdr_priv_instance_data *)
|
||||
const struct fifisdr_priv_instance_data *priv = (struct
|
||||
fifisdr_priv_instance_data *)
|
||||
rig->state.priv;
|
||||
int ret;
|
||||
uint32_t freq1121;
|
||||
|
@ -447,7 +447,8 @@ int funcube_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
int get_freq_v0(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct funcube_priv_data *priv = (struct funcube_priv_data *)rig->state.priv;
|
||||
const struct funcube_priv_data *priv = (struct funcube_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: frequency is not read from the device, the value shown is the last successfully set.\n",
|
||||
|
@ -188,7 +188,8 @@ struct rig_caps hiqsdr_caps =
|
||||
|
||||
static int send_command(RIG *rig)
|
||||
{
|
||||
const struct hiqsdr_priv_data *priv = (struct hiqsdr_priv_data *)rig->state.priv;
|
||||
const struct hiqsdr_priv_data *priv = (struct hiqsdr_priv_data *)
|
||||
rig->state.priv;
|
||||
int ret;
|
||||
|
||||
ret = write_block(&rig->state.rigport, (unsigned char *) priv->control_frame,
|
||||
|
@ -241,7 +241,8 @@ static int rshfiq_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
static int rshfiq_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
// cppcheck-suppress syntaxError
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called. level type =%"PRIll"\n", __func__, level);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called. level type =%"PRIll"\n", __func__,
|
||||
level);
|
||||
|
||||
char cmdstr[15];
|
||||
char stopset[2];
|
||||
|
@ -1112,7 +1112,7 @@ static const int HS_DIV_MAP[] = {4, 5, 6, 7, -1, 9, -1, 11};
|
||||
static int calcDividers(RIG *rig, double f, struct solution *solution)
|
||||
{
|
||||
const struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
struct solution sols[8];
|
||||
int i;
|
||||
int imin;
|
||||
@ -1194,7 +1194,7 @@ static int calcDividers(RIG *rig, double f, struct solution *solution)
|
||||
int si570xxxusb_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
libusb_device_handle *udh = rig->state.rigport.handle;
|
||||
int ret;
|
||||
unsigned char buffer[6];
|
||||
@ -1260,7 +1260,7 @@ int si570xxxusb_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
int si570xxxusb_set_freq_by_value(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
const struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
libusb_device_handle *udh = rig->state.rigport.handle;
|
||||
int ret;
|
||||
|
||||
@ -1299,7 +1299,7 @@ int si570xxxusb_set_freq_by_value(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
static double calculateFrequency(RIG *rig, const unsigned char *buffer)
|
||||
{
|
||||
const struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
|
||||
int RFREQ_int = ((buffer[2] & 0xf0) >> 4) + ((buffer[1] & 0x3f) * 16);
|
||||
int RFREQ_frac = (256 * 256 * 256 * (buffer[2] & 0xf)) +
|
||||
@ -1362,7 +1362,7 @@ int si570xxxusb_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
int si570xxxusb_get_freq_by_value(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct si570xxxusb_priv_data *priv = (struct si570xxxusb_priv_data *)
|
||||
rig->state.priv;
|
||||
rig->state.priv;
|
||||
libusb_device_handle *udh = rig->state.rigport.handle;
|
||||
int ret;
|
||||
unsigned char buffer[4];
|
||||
|
@ -563,10 +563,13 @@ int mds_open(RIG *rig)
|
||||
ENTERFUNC;
|
||||
mds_get_info(rig);
|
||||
retval = mds_transaction(rig, "MODEM NONE", 0, &response);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: MODEM cmd failed: %s\n", __func__, rigerror(retval));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: MODEM cmd failed: %s\n", __func__,
|
||||
rigerror(retval));
|
||||
}
|
||||
else retval = mds_transaction(rig, "PTT 0", 0, &response);
|
||||
else { retval = mds_transaction(rig, "PTT 0", 0, &response); }
|
||||
|
||||
RETURNFUNC(retval);
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ pcr_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
*freq = rcvr->last_freq;
|
||||
|
||||
@ -1169,7 +1169,7 @@ pcr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
int err;
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
// rig_debug(RIG_DEBUG_TRACE, "%s: level = %d\n", __func__, level);
|
||||
|
||||
@ -1243,7 +1243,7 @@ pcr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||
{
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: status = %d, func = %s\n", __func__,
|
||||
status, rig_strfunc(func));
|
||||
@ -1777,7 +1777,7 @@ int pcr_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
|
||||
{
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
*tone = rcvr->last_ctcss_sql;
|
||||
return RIG_OK;
|
||||
@ -1827,7 +1827,7 @@ int pcr_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *tone)
|
||||
{
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
*tone = rcvr->last_dcs_sql;
|
||||
return RIG_OK;
|
||||
@ -1956,7 +1956,7 @@ int pcr_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
{
|
||||
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
|
||||
const struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
|
||||
|
||||
if (priv->auto_update == 0)
|
||||
{
|
||||
|
@ -68,7 +68,8 @@ const struct confparams ra37xx_cfg_params[] =
|
||||
static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data,
|
||||
int *data_len)
|
||||
{
|
||||
const struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)rig->state.priv;
|
||||
const struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)
|
||||
rig->state.priv;
|
||||
struct rig_state *rs = &rig->state;
|
||||
char cmdbuf[BUFSZ];
|
||||
char respbuf[BUFSZ];
|
||||
@ -289,7 +290,8 @@ int ra37xx_set_conf(RIG *rig, token_t token, const char *val)
|
||||
*/
|
||||
int ra37xx_get_conf2(RIG *rig, token_t token, char *val, int val_len)
|
||||
{
|
||||
const struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)rig->state.priv;
|
||||
const struct ra37xx_priv_data *priv = (struct ra37xx_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
switch (token)
|
||||
{
|
||||
|
@ -262,7 +262,8 @@ int tentec_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
*/
|
||||
int tentec_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)rig->state.priv;
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
*freq = priv->freq;
|
||||
|
||||
@ -382,7 +383,8 @@ int tentec_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
*/
|
||||
int tentec_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
{
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)rig->state.priv;
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
*mode = priv->mode;
|
||||
*width = priv->width;
|
||||
@ -467,7 +469,8 @@ int tentec_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
*/
|
||||
int tentec_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)rig->state.priv;
|
||||
const struct tentec_priv_data *priv = (struct tentec_priv_data *)
|
||||
rig->state.priv;
|
||||
int retval, lvl_len;
|
||||
unsigned char lvlbuf[32];
|
||||
|
||||
|
@ -692,7 +692,8 @@ int uniden_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
|
||||
}
|
||||
|
||||
/* PM089T08511625 */
|
||||
SNPRINTF(cmdbuf, sizeof(cmdbuf), "PM%03d%c%08u" EOM, chan->channel_num, ' ', (unsigned)(chan->freq / 100));
|
||||
SNPRINTF(cmdbuf, sizeof(cmdbuf), "PM%03d%c%08u" EOM, chan->channel_num, ' ',
|
||||
(unsigned)(chan->freq / 100));
|
||||
|
||||
ret = uniden_transaction(rig, cmdbuf, strlen(cmdbuf), NULL, membuf, &mem_len);
|
||||
|
||||
@ -790,7 +791,8 @@ DECLARE_PROBERIG_BACKEND(uniden)
|
||||
int rates[] = { 9600, 19200, 0 }; /* possible baud rates */
|
||||
int rates_idx;
|
||||
|
||||
memset(idbuf,0,IDBUFSZ);
|
||||
memset(idbuf, 0, IDBUFSZ);
|
||||
|
||||
if (!port)
|
||||
{
|
||||
return RIG_MODEL_NONE;
|
||||
|
@ -174,13 +174,13 @@ struct rig_caps ftdx1200_caps =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -159,12 +159,12 @@ struct rig_caps ft2000_caps =
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDRGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -270,13 +270,13 @@ struct rig_caps ftdx3000_caps =
|
||||
.level_gran = {
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -67,12 +67,12 @@ struct rig_caps ft450_caps =
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_CWPITCH] = { .min = { .i = 400 }, .max = { .i = 800 }, .step = { .i = 100 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/11.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 11.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -165,12 +165,12 @@ struct rig_caps ftdx5000_caps =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -145,14 +145,14 @@ struct rig_caps ft710_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BAND4M"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -495,6 +495,7 @@ int ft767_close(RIG *rig)
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -640,7 +640,8 @@ static int ft817_close(RIG *rig)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
static inline long timediff(const struct timeval *tv1, const struct timeval *tv2)
|
||||
static inline long timediff(const struct timeval *tv1,
|
||||
const struct timeval *tv2)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
|
@ -431,7 +431,8 @@ int ft857_close(RIG *rig)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
static inline long timediff(const struct timeval *tv1, const struct timeval *tv2)
|
||||
static inline long timediff(const struct timeval *tv1,
|
||||
const struct timeval *tv2)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
@ -673,7 +674,8 @@ int ft857_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
return -RIG_OK;
|
||||
}
|
||||
|
||||
static void get_mode(RIG *rig, const struct ft857_priv_data *priv, rmode_t *mode,
|
||||
static void get_mode(RIG *rig, const struct ft857_priv_data *priv,
|
||||
rmode_t *mode,
|
||||
pbwidth_t *width)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
|
||||
|
@ -156,15 +156,15 @@ struct rig_caps ft891_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f/30.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f / 30.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDRGEN,BANDMW"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -583,7 +583,8 @@ int ft897_close(RIG *rig)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
static inline long timediff(const struct timeval *tv1, const struct timeval *tv2)
|
||||
static inline long timediff(const struct timeval *tv1,
|
||||
const struct timeval *tv2)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
|
@ -74,8 +74,8 @@ struct rig_caps ft9000_caps =
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
@ -250,8 +250,8 @@ struct rig_caps ft9000Old_caps =
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
|
||||
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 255.0f } },
|
||||
},
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -2296,7 +2296,8 @@ static int ft920_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
hl_usleep(200*1000); // give the rig some time before we try set_freq
|
||||
|
||||
hl_usleep(200 * 1000); // give the rig some time before we try set_freq
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -111,11 +111,11 @@ struct rig_caps ft950_caps =
|
||||
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
|
||||
[LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } },
|
||||
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -755,7 +755,7 @@ int ft980_open(RIG *rig)
|
||||
|
||||
write_block(&rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
|
||||
read_block(&rig->state.rigport, (unsigned char *) &priv->update_data,
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
}
|
||||
while (!priv->update_data.ext_ctl_flag
|
||||
&& retry_count1++ < rig->state.rigport.retry);
|
||||
@ -801,7 +801,7 @@ int ft980_close(RIG *rig)
|
||||
|
||||
write_block(&rig->state.rigport, cmd_OK, YAESU_CMD_LENGTH);
|
||||
read_block(&rig->state.rigport, (unsigned char *) &priv->update_data,
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
FT980_ALL_STATUS_LENGTH);
|
||||
}
|
||||
while (priv->update_data.ext_ctl_flag
|
||||
&& retry_count1++ < rig->state.rigport.retry);
|
||||
|
@ -200,14 +200,14 @@ struct rig_caps ft991_caps =
|
||||
.has_set_parm = RIG_PARM_BANDSELECT,
|
||||
.level_gran = {
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDAIR,BAND70CM,BAND33CM"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = common_dcs_list,
|
||||
|
@ -161,14 +161,14 @@ struct rig_caps ftdx10_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -120,7 +120,7 @@ const struct confparams ftdx101d_ext_levels[] =
|
||||
RIG_CONF_NUMERIC,
|
||||
{ .n = { .min = 1, .max = 11, .step = 1 } },
|
||||
},
|
||||
{
|
||||
{
|
||||
TOK_MAXPOWER_HF,
|
||||
"MAXPOWER_HF",
|
||||
"Maxpower HF",
|
||||
@ -199,16 +199,16 @@ struct rig_caps ftdx101d_caps =
|
||||
.level_gran =
|
||||
{
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_USB_AF] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_USB_AF] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDUNUSED,BANDUNUSED,BANDUNUSED,BAND4M"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
@ -101,16 +101,16 @@ struct rig_caps ftdx101mp_caps =
|
||||
.has_set_parm = RIG_PARM_BANDSELECT,
|
||||
.level_gran = {
|
||||
#include "level_gran_yaesu.h"
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .025 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/200.0f } },
|
||||
[LVL_USB_AF] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
|
||||
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_RFPOWER] = { .min = { .f = .025 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 200.0f } },
|
||||
[LVL_USB_AF] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
[LVL_USB_AF_INPUT] = { .min = { .f = .0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f / 100.0f } },
|
||||
},
|
||||
.parm_gran = {
|
||||
[PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDUNUSED,BANDUNUSED,BANDUNUSED,BAND4M"}}
|
||||
},
|
||||
},
|
||||
|
||||
.ctcss_list = common_ctcss_list,
|
||||
.dcs_list = NULL,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -759,7 +759,8 @@ static const char *vx1700_get_info(RIG *rig)
|
||||
|
||||
static int vx1700_set_vfo(RIG *rig, vfo_t vfo)
|
||||
{
|
||||
const struct vx1700_priv_data *priv = (struct vx1700_priv_data *)rig->state.priv;
|
||||
const struct vx1700_priv_data *priv = (struct vx1700_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s, vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
@ -1178,7 +1179,8 @@ static int vx1700_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
||||
|
||||
static int vx1700_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
||||
{
|
||||
const struct vx1700_priv_data *priv = (struct vx1700_priv_data *)rig->state.priv;
|
||||
const struct vx1700_priv_data *priv = (struct vx1700_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
(void) rig;
|
||||
(void) vfo;
|
||||
|
@ -73,7 +73,7 @@ DECLARE_INITRIG_BACKEND(yaesu)
|
||||
ft450d_caps.rig_model = RIG_MODEL_FT450D;
|
||||
ft450d_caps.model_name = "FT-450D";
|
||||
ft450d_caps.level_gran[LVL_RFPOWER].min.f = .05;
|
||||
ft450d_caps.level_gran[LVL_RFPOWER].step.f = 1.0f/100.0f;
|
||||
ft450d_caps.level_gran[LVL_RFPOWER].step.f = 1.0f / 100.0f;
|
||||
rig_register(&ft100_caps);
|
||||
rig_register(&ft450_caps);
|
||||
rig_register(&ft450d_caps);
|
||||
|
@ -93,6 +93,7 @@ static int flir_request(ROT *rot, char *request, char *response,
|
||||
{
|
||||
int retry_read = 0;
|
||||
int read_char;
|
||||
|
||||
while (retry_read < rot->state.rotport.retry)
|
||||
{
|
||||
memset(response, 0, (size_t)resp_size);
|
||||
@ -185,6 +186,7 @@ static int flir_open(ROT *rot)
|
||||
|
||||
// Disable ECHO
|
||||
return_value = flir_request(rot, "ED\n", NULL, MAXBUF);
|
||||
|
||||
if (return_value != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: ED: %s\n", __func__, rigerror(return_value));
|
||||
@ -193,6 +195,7 @@ static int flir_open(ROT *rot)
|
||||
|
||||
// Disable Verbose Mode
|
||||
return_value = flir_request(rot, "FT\n", return_str, MAXBUF);
|
||||
|
||||
if (return_value != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: FT: %s\n", __func__, rigerror(return_value));
|
||||
@ -323,18 +326,22 @@ static int flir_stop(ROT *rot)
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
return_value = flir_request(rot, "H\n", NULL, MAXBUF);
|
||||
|
||||
if (return_value != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: H: %s\n", __func__, rigerror(return_value));
|
||||
return return_value;
|
||||
}
|
||||
|
||||
// Wait 2s until rotor has stopped (Needs to be refactored)
|
||||
hl_usleep(2000000);
|
||||
|
||||
return_value = flir_get_position(rot, &az, &el);
|
||||
|
||||
if (return_value != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_position: %s\n", __func__, rigerror(return_value));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_position: %s\n", __func__,
|
||||
rigerror(return_value));
|
||||
return return_value;
|
||||
}
|
||||
|
||||
@ -495,7 +502,7 @@ static int flir_get_ext_parm(ROT *rot, token_t token, value_t *val)
|
||||
static int flir_get_status(ROT *rot, rot_status_t *status)
|
||||
{
|
||||
const struct flir_priv_data *priv = (struct flir_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
*status = priv->status;
|
||||
|
||||
return RIG_OK;
|
||||
|
@ -52,7 +52,8 @@ static int setDirection(hamlib_port_t *port, unsigned char outputvalue,
|
||||
unsigned char outputstatus;
|
||||
|
||||
retval = par_lock(port);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
@ -60,7 +61,8 @@ static int setDirection(hamlib_port_t *port, unsigned char outputvalue,
|
||||
|
||||
// set the data bits
|
||||
retval = par_write_data(port, outputvalue);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
@ -77,11 +79,13 @@ static int setDirection(hamlib_port_t *port, unsigned char outputvalue,
|
||||
}
|
||||
|
||||
retval = par_write_control(port, outputstatus ^ CP_ACTIVE_LOW_BITS);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
// and now the strobe impulse
|
||||
hl_usleep(1);
|
||||
|
||||
@ -95,11 +99,13 @@ static int setDirection(hamlib_port_t *port, unsigned char outputvalue,
|
||||
}
|
||||
|
||||
retval = par_write_control(port, outputstatus ^ CP_ACTIVE_LOW_BITS);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
hl_usleep(1);
|
||||
|
||||
if (direction)
|
||||
@ -112,14 +118,16 @@ static int setDirection(hamlib_port_t *port, unsigned char outputvalue,
|
||||
}
|
||||
|
||||
retval = par_write_control(port, outputstatus ^ CP_ACTIVE_LOW_BITS);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = par_unlock(port);
|
||||
if (retval != RIG_OK)
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\n", __func__, __LINE__, rigerror(retval));
|
||||
return retval;
|
||||
|
@ -294,7 +294,8 @@ static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val)
|
||||
|
||||
switch (level)
|
||||
{
|
||||
int retval;
|
||||
int retval;
|
||||
|
||||
case ROT_LEVEL_SPEED:
|
||||
{
|
||||
int speed = val.i;
|
||||
|
@ -84,8 +84,9 @@ ioptron_transaction(ROT *rot, const char *cmdstr, char *data, size_t resp_len)
|
||||
}
|
||||
|
||||
/** the answer */
|
||||
memset(data, 0, resp_len+1);
|
||||
memset(data, 0, resp_len + 1);
|
||||
retval = read_block(&rs->rotport, (unsigned char *) data, resp_len);
|
||||
|
||||
/** if expected number of bytes received, return OK status */
|
||||
if (retval == resp_len)
|
||||
{
|
||||
@ -93,8 +94,9 @@ ioptron_transaction(ROT *rot, const char *cmdstr, char *data, size_t resp_len)
|
||||
}
|
||||
}
|
||||
|
||||
/** if got here, retry loop failed */
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unexpected response, len %d: '%s'\n", __func__, retval, data);
|
||||
/** if got here, retry loop failed */
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unexpected response, len %d: '%s'\n", __func__,
|
||||
retval, data);
|
||||
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
@ -129,10 +131,11 @@ ioptron_open(ROT *rot)
|
||||
const char *info;
|
||||
int retval;
|
||||
char retbuf[10];
|
||||
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
info = ioptron_get_info(rot);
|
||||
|
||||
/* ioptron_get_info returns "MountInfo xxxx", check model number from string */
|
||||
/* string of 4 numeric digits is likely model number */
|
||||
if ((strlen(&info[10]) != 4) || (strspn(&info[10], "1234567890") != 4))
|
||||
@ -156,7 +159,7 @@ ioptron_open(ROT *rot)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
@ -246,7 +249,7 @@ ioptron_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
||||
elevation_t curr_el;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el);
|
||||
|
||||
|
||||
/* units .01 arc sec */
|
||||
faz = az * 360000;
|
||||
fel = el * 360000;
|
||||
@ -269,13 +272,15 @@ ioptron_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
||||
{
|
||||
/* make sure stopped */
|
||||
retval = ioptron_stop(rot);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
|
||||
/* get current position */
|
||||
retval = ioptron_get_position(rot, &curr_az, &curr_el);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
@ -290,7 +295,7 @@ ioptron_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
||||
faz = 129599999; /* needs double precision float */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* set azmiuth, returns '1" if OK */
|
||||
SNPRINTF(cmdstr, sizeof(cmdstr), ":Sz%09.0f#", faz);
|
||||
retval = ioptron_transaction(rot, cmdstr, retbuf, 1);
|
||||
|
@ -39,12 +39,14 @@ struct spid_rot2prog_priv_data
|
||||
int el_resolution;
|
||||
};
|
||||
|
||||
enum spid_rot2prog_framemagic {
|
||||
enum spid_rot2prog_framemagic
|
||||
{
|
||||
ROT2PROG_FRAME_START_BYTE = 'W',
|
||||
ROT2PROG_FRAME_END_BYTE = ' ',
|
||||
};
|
||||
|
||||
enum r2p_frame_parser_state {
|
||||
enum r2p_frame_parser_state
|
||||
{
|
||||
ROT2PROG_PARSER_EXPECT_FRAME_START,
|
||||
ROT2PROG_PARSER_EXPECT_CR,
|
||||
ROT2PROG_PARSER_EXPECT_LF,
|
||||
@ -52,7 +54,7 @@ enum r2p_frame_parser_state {
|
||||
};
|
||||
|
||||
static int read_r2p_frame(hamlib_port_t *port, unsigned char *rxbuffer,
|
||||
size_t count)
|
||||
size_t count)
|
||||
{
|
||||
// Some MD-01 firmware can apparently print debug messages to the same
|
||||
// serial port that is used for the control protocol. This awkwardly
|
||||
@ -108,31 +110,36 @@ static int read_r2p_frame(hamlib_port_t *port, unsigned char *rxbuffer,
|
||||
{
|
||||
case ROT2PROG_PARSER_EXPECT_FRAME_START:
|
||||
res = read_block(port, &peek, 1);
|
||||
if (res < 0) return res;
|
||||
|
||||
if (res < 0) { return res; }
|
||||
|
||||
switch (peek)
|
||||
{
|
||||
case ROT2PROG_FRAME_START_BYTE:
|
||||
rxbuffer[0] = peek;
|
||||
pstate = ROT2PROG_PARSER_EXPECT_FRAME_END;
|
||||
break;
|
||||
case ROT2PROG_FRAME_START_BYTE:
|
||||
rxbuffer[0] = peek;
|
||||
pstate = ROT2PROG_PARSER_EXPECT_FRAME_END;
|
||||
break;
|
||||
|
||||
default:
|
||||
pstate = ROT2PROG_PARSER_EXPECT_CR;
|
||||
break;
|
||||
default:
|
||||
pstate = ROT2PROG_PARSER_EXPECT_CR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ROT2PROG_PARSER_EXPECT_CR:
|
||||
res = read_block(port, &peek, 1);
|
||||
if (res < 0) return res;
|
||||
|
||||
if (peek == '\r') pstate = ROT2PROG_PARSER_EXPECT_LF;
|
||||
if (res < 0) { return res; }
|
||||
|
||||
if (peek == '\r') { pstate = ROT2PROG_PARSER_EXPECT_LF; }
|
||||
|
||||
break;
|
||||
|
||||
case ROT2PROG_PARSER_EXPECT_LF:
|
||||
res = read_block(port, &peek, 1);
|
||||
if (res < 0) return res;
|
||||
|
||||
if (res < 0) { return res; }
|
||||
|
||||
if (peek == '\n')
|
||||
{
|
||||
@ -147,12 +154,14 @@ static int read_r2p_frame(hamlib_port_t *port, unsigned char *rxbuffer,
|
||||
// happen.
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ROT2PROG_PARSER_EXPECT_FRAME_END:
|
||||
// we already read the frame start byte
|
||||
res = read_block(port, rxbuffer + 1, count - 1);
|
||||
if (res < 0) return res;
|
||||
|
||||
if (res < 0) { return res; }
|
||||
|
||||
if (rxbuffer[count - 1] != ROT2PROG_FRAME_END_BYTE)
|
||||
{
|
||||
@ -172,7 +181,9 @@ static int spid_write(hamlib_port_t *p, const unsigned char *txbuffer,
|
||||
size_t count)
|
||||
{
|
||||
int ret = rig_flush(p);
|
||||
if (ret < 0) return ret;
|
||||
|
||||
if (ret < 0) { return ret; }
|
||||
|
||||
return write_block(p, txbuffer, count);
|
||||
}
|
||||
|
||||
@ -230,7 +241,7 @@ static int spid_rot_cleanup(ROT *rot)
|
||||
static int spid_get_conf2(ROT *rot, token_t token, char *val, int val_len)
|
||||
{
|
||||
const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called %d\n", __func__, (int)token);
|
||||
|
||||
@ -333,7 +344,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
|
||||
{
|
||||
struct rot_state *rs = &rot->state;
|
||||
const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *)
|
||||
rs->priv;
|
||||
rs->priv;
|
||||
int retval;
|
||||
int retry_read = 0;
|
||||
char cmdstr[13];
|
||||
@ -346,7 +357,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az,
|
||||
do
|
||||
{
|
||||
retval = spid_write(&rs->rotport,
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
@ -421,7 +432,7 @@ static int spid_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
||||
do
|
||||
{
|
||||
retval = spid_write(&rs->rotport,
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1F\x20", 13);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
@ -493,7 +504,7 @@ static int spid_rot_stop(ROT *rot)
|
||||
do
|
||||
{
|
||||
retval = spid_write(&rs->rotport,
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0F\x20", 13);
|
||||
(unsigned char *) "\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0F\x20", 13);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ static int ts7400_rot_reset(ROT *rot, rot_reset_t reset)
|
||||
static int ts7400_rot_move(ROT *rot, int direction, int speed)
|
||||
{
|
||||
struct ts7400_rot_priv_data const *priv = (struct ts7400_rot_priv_data *)
|
||||
rot->state.priv;
|
||||
rot->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__,
|
||||
|
@ -3,7 +3,7 @@
|
||||
char *make_digest(const unsigned char *digest, int len) /* {{{ */
|
||||
{
|
||||
int md5len = sizeof(char) * (len * 2 + 1);
|
||||
char *md5str = (char *) calloc(1, md5len);
|
||||
char *md5str = (char *) calloc(1, md5len);
|
||||
static const char hexits[17] = "0123456789abcdef";
|
||||
int i;
|
||||
|
||||
|
@ -42,6 +42,7 @@ HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
|
||||
product = pass[0];
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 1; pass[i]; ++i)
|
||||
{
|
||||
product *= pass[i];
|
||||
|
@ -342,6 +342,7 @@ int main(int argc, const char *argv[])
|
||||
else
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
if (!(f = fopen(argv[1], "rb")))
|
||||
{
|
||||
perror("fopen");
|
||||
|
@ -70,7 +70,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
@ -122,10 +122,12 @@ again:
|
||||
|
||||
case 0x88: printf("PTT OFF\n"); break;
|
||||
|
||||
case 0x07:
|
||||
printf("MODE %0xx\n", buf[0]);
|
||||
if (vfo == 0) modeA = buf[0];
|
||||
else modeB = buf[0];
|
||||
case 0x07:
|
||||
printf("MODE %0xx\n", buf[0]);
|
||||
|
||||
if (vfo == 0) { modeA = buf[0]; }
|
||||
else { modeB = buf[0]; }
|
||||
|
||||
break;
|
||||
|
||||
case 0x05: printf("CLAR ON\n"); break;
|
||||
@ -134,10 +136,10 @@ again:
|
||||
|
||||
case 0xF5: printf("FREQ\n"); break;
|
||||
|
||||
case 0x81:
|
||||
vfo = !vfo;
|
||||
printf("VFO TOGGLE, %s active\n", vfo==0?"VFOA":"VFOB");
|
||||
break;
|
||||
case 0x81:
|
||||
vfo = !vfo;
|
||||
printf("VFO TOGGLE, %s active\n", vfo == 0 ? "VFOA" : "VFOB");
|
||||
break;
|
||||
|
||||
case 0x02: printf("SPLIT ON\n"); break;
|
||||
|
||||
|
@ -63,7 +63,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
@ -63,7 +63,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
@ -139,10 +140,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (n <= 0) { perror("RM5"); }
|
||||
}
|
||||
else if (strcmp(buf,"MR118;") == 0)
|
||||
else if (strcmp(buf, "MR118;") == 0)
|
||||
{
|
||||
pbuf = "?;";
|
||||
n = write(fd, pbuf, strlen(pbuf));
|
||||
|
||||
if (n <= 0) { perror("MR118"); }
|
||||
}
|
||||
|
||||
|
@ -32,11 +32,11 @@ int na = 0;
|
||||
int ex039 = 0;
|
||||
int keyspd = 20;
|
||||
int split = 0;
|
||||
int power=50;
|
||||
int rport_gain_ssb=50;
|
||||
int rport_gain_am=50;
|
||||
int rport_gain_fm=50;
|
||||
int rport_gain_psk=50;
|
||||
int power = 50;
|
||||
int rport_gain_ssb = 50;
|
||||
int rport_gain_am = 50;
|
||||
int rport_gain_fm = 50;
|
||||
int rport_gain_psk = 50;
|
||||
|
||||
// ID 0310 == 310, Must drop leading zero
|
||||
typedef enum nc_rigid_e
|
||||
@ -72,7 +72,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
@ -332,13 +333,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (strcmp(buf, "EX010415;") == 0)
|
||||
{
|
||||
sprintf(buf,"EX010415%03d;", rport_gain_psk);
|
||||
sprintf(buf, "EX010415%03d;", rport_gain_psk);
|
||||
n = write(fd, buf, strlen(buf));
|
||||
}
|
||||
else if (strncmp(buf, "EX010415", 8) == 0)
|
||||
{
|
||||
printf("Here#1");
|
||||
sscanf(buf,"EX010415%d", &rport_gain_psk);
|
||||
sscanf(buf, "EX010415%d", &rport_gain_psk);
|
||||
}
|
||||
|
||||
else if (strlen(buf) > 0)
|
||||
|
@ -65,7 +65,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
@ -66,7 +66,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ again:
|
||||
while (read(fd, &c, 1) > 0)
|
||||
{
|
||||
buf[i++] = c;
|
||||
printf("i=%d, c=0x%02x\n",i,c);
|
||||
printf("i=%d, c=0x%02x\n", i, c);
|
||||
|
||||
if (c == 0xfd)
|
||||
{
|
||||
@ -141,7 +141,7 @@ void frameParse(int fd, unsigned char *frame, int len)
|
||||
|
||||
if (powerstat)
|
||||
{
|
||||
dump_hex(frame,11);
|
||||
dump_hex(frame, 11);
|
||||
n = write(fd, frame, 11);
|
||||
|
||||
if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
|
||||
|
@ -398,42 +398,58 @@ void frameParse(int fd, unsigned char *frame, int len)
|
||||
frame[6] = satmode;
|
||||
frame[7] = 0xfd;
|
||||
n = write(fd, frame, 8);
|
||||
|
||||
if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 0x65:
|
||||
if (frame[6] == 0xfd)
|
||||
{
|
||||
ipp = frame[6];
|
||||
}
|
||||
else
|
||||
{
|
||||
frame[6] = ipp;
|
||||
frame[7]=0xfd;
|
||||
frame[7] = 0xfd;
|
||||
n = write(fd, frame, 8);
|
||||
|
||||
if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 0x66:
|
||||
if (frame[6] == 0xfd)
|
||||
{
|
||||
tx_inhibit = frame[6];
|
||||
}
|
||||
else
|
||||
{
|
||||
frame[6] = tx_inhibit;
|
||||
frame[7]=0xfd;
|
||||
frame[7] = 0xfd;
|
||||
n = write(fd, frame, 8);
|
||||
|
||||
if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 0x67:
|
||||
if (frame[6] == 0xfd)
|
||||
{
|
||||
dpp = frame[6];
|
||||
}
|
||||
else
|
||||
{
|
||||
frame[6] = dpp;
|
||||
frame[7]=0xfd;
|
||||
frame[7] = 0xfd;
|
||||
n = write(fd, frame, 8);
|
||||
|
||||
if (n <= 0) { fprintf(stderr, "%s(%d) write error %s\n", __func__, __LINE__, strerror(errno)); }
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -780,10 +796,11 @@ int main(int argc, char **argv)
|
||||
while (1)
|
||||
{
|
||||
int len = frameGet(fd, buf);
|
||||
printf("#1 ========================================");
|
||||
printf("#1 ========================================");
|
||||
|
||||
if (len <= 0)
|
||||
{
|
||||
printf("#2 ========================================");
|
||||
printf("#2 ========================================");
|
||||
close(fd);
|
||||
fd = openPort(argv[1]);
|
||||
}
|
||||
@ -797,9 +814,9 @@ printf("#2 ========================================");
|
||||
hl_usleep(100 * 1000);
|
||||
}
|
||||
|
||||
printf("#3 ========================================");
|
||||
printf("#3 ========================================");
|
||||
rigStatus();
|
||||
printf("#3 ========================================");
|
||||
printf("#3 ========================================");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -517,6 +517,7 @@ void frameParse(int fd, unsigned char *frame, int len)
|
||||
|
||||
default: printf("cmd 0x%02x unknown\n", frame[4]);
|
||||
}
|
||||
|
||||
// don't care about the rig type yet
|
||||
}
|
||||
|
||||
|
@ -533,6 +533,7 @@ void frameParse(int fd, unsigned char *frame, int len)
|
||||
|
||||
default: printf("cmd 0x%02x unknown\n", frame[4]);
|
||||
}
|
||||
|
||||
// don't care about the rig type yet
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,8 @@ getmyline(int fd, char *buf)
|
||||
|
||||
if (c == ';') { return strlen(buf); }
|
||||
}
|
||||
if (strlen(buf)==0) hl_usleep(10*1000);
|
||||
|
||||
if (strlen(buf) == 0) { hl_usleep(10 * 1000); }
|
||||
|
||||
return strlen(buf);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user