Porównaj commity

...

7 Commity

Autor SHA1 Wiadomość Data
Mike Black W9MDB 7ee8c358cd Fix mingw 64-bit and another attempt for 32-bit
https://github.com/Hamlib/Hamlib/issues/1478
2024-02-24 12:08:26 -06:00
Mike Black W9MDB 5f92b19ef4 Revert "Sync github"
This reverts commit 5089949f10.
2024-02-24 11:10:41 -06:00
Mike Black W9MDB 5089949f10 Sync github 2024-02-24 11:09:54 -06:00
Mike Black W9MDB 83f5655a9f Fix PKTAM in kenwood.c
https://github.com/Hamlib/Hamlib/issues/1502
2024-02-24 06:51:32 -06:00
Mike Black W9MDB 1b2f6a84f7 Add USB-D1/D2/D3 LSB-D1/D2/D3 to new modes and Flrig
https://github.com/Hamlib/Hamlib/issues/1502
2024-02-23 12:27:55 -06:00
Mike Black W9MDB 9f87279b0b Update simts990.c 2024-02-22 09:23:25 -06:00
Mike Black W9MDB c1f8b091ab Update simts990.c to work with FLRig 2024-02-22 08:02:41 -06:00
7 zmienionych plików z 385 dodań i 79 usunięć

Wyświetl plik

@ -1386,12 +1386,12 @@ typedef uint64_t rmode_t;
#define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37) /*!< \c IQ mode for a couple of kit rigs */
#define RIG_MODE_ISBUSB CONSTANT_64BIT_FLAG (38) /*!< \c ISB mode monitoring USB */
#define RIG_MODE_ISBLSB CONSTANT_64BIT_FLAG (39) /*!< \c ISB mode monitoring LSB */
#define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45) /*!< \c reserved for future expansion */
#define RIG_MODE_USBD1 CONSTANT_64BIT_FLAG (40) /*!< \c USB-D1 for some rigs */
#define RIG_MODE_USBD2 CONSTANT_64BIT_FLAG (41) /*!< \c USB-D2 for some rigs */
#define RIG_MODE_USBD3 CONSTANT_64BIT_FLAG (42) /*!< \c USB-D3 for some rigs */
#define RIG_MODE_LSBD1 CONSTANT_64BIT_FLAG (43) /*!< \c LSB-D1 for some rigs */
#define RIG_MODE_LSBD2 CONSTANT_64BIT_FLAG (44) /*!< \c LSB-D1 for some rigs */
#define RIG_MODE_LSBD3 CONSTANT_64BIT_FLAG (45) /*!< \c LSB-D1 for some rigs */
#define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47) /*!< \c reserved for future expansion */
#define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48) /*!< \c reserved for future expansion */

Wyświetl plik

@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
.version = "20231216.0",
.version = "20240222.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -243,6 +243,12 @@ static struct s_modeMap modeMap[] =
{RIG_MODE_RTTYR, NULL},
{RIG_MODE_C4FM, NULL},
{RIG_MODE_DSTAR, NULL},
{RIG_MODE_USBD1, NULL},
{RIG_MODE_USBD2, NULL},
{RIG_MODE_USBD3, NULL},
{RIG_MODE_LSBD1, NULL},
{RIG_MODE_LSBD2, NULL},
{RIG_MODE_LSBD3, NULL},
{0, NULL}
};
@ -1012,9 +1018,6 @@ static int flrig_open(RIG *rig)
H3E
M11
USB-D -- doesn't appear to be read/set
USB-D1 -- doesn't appear to be read/set
USB-D2 -- doesn't appear to be read/set
USB-D3 -- doesn't appear to be read/set
USER-L -- doesn't appear to be read/set
USER-U -- doesn't appear to be read/set
*/
@ -1057,9 +1060,9 @@ static int flrig_open(RIG *rig)
else if (streq(p, "LCW")) { modeMapAdd(&modes, RIG_MODE_CWR, p); }
else if (streq(p, "LSB")) { modeMapAdd(&modes, RIG_MODE_LSB, p); }
else if (streq(p, "LSB-D")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "LSB-D1")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "LSB-D2")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "LSB-D3")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "LSB-D1")) { modeMapAdd(&modes, RIG_MODE_LSBD1, p); }
else if (streq(p, "LSB-D2")) { modeMapAdd(&modes, RIG_MODE_LSBD2, p); }
else if (streq(p, "LSB-D3")) { modeMapAdd(&modes, RIG_MODE_LSBD3, p); }
else if (streq(p, "NFM")) { modeMapAdd(&modes, RIG_MODE_FMN, p); }
else if (streq(p, "PKT")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "PKT-FM")) { modeMapAdd(&modes, RIG_MODE_PKTFM, p); }
@ -1082,9 +1085,9 @@ static int flrig_open(RIG *rig)
else if (streq(p, "SAM")) { modeMapAdd(&modes, RIG_MODE_SAM, p); }
else if (streq(p, "USB")) { modeMapAdd(&modes, RIG_MODE_USB, p); }
else if (streq(p, "USB-D")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "USB-D1")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "USB-D2")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "USB-D3")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "USB-D1")) { modeMapAdd(&modes, RIG_MODE_USBD1, p); }
else if (streq(p, "USB-D2")) { modeMapAdd(&modes, RIG_MODE_USBD2, p); }
else if (streq(p, "USB-D3")) { modeMapAdd(&modes, RIG_MODE_USBD3, p); }
else if (streq(p, "USER-U")) { modeMapAdd(&modes, RIG_MODE_PKTUSB, p); }
else if (streq(p, "USER-L")) { modeMapAdd(&modes, RIG_MODE_PKTLSB, p); }
else if (streq(p, "W-FM")) { modeMapAdd(&modes, RIG_MODE_WFM, p); }

Wyświetl plik

@ -152,8 +152,16 @@ rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX] =
[11] = RIG_MODE_PSKR,
[12] = RIG_MODE_PKTLSB,
[13] = RIG_MODE_PKTUSB,
[14] = RIG_MODE_PKTFM,
[15] = RIG_MODE_PKTAM
[14] = RIG_MODE_PKTFM, // FM-D1 not supported yet
[15] = RIG_MODE_PKTAM, // AM-D1 not supported yet
[16] = RIG_MODE_LSBD2,
[17] = RIG_MODE_USBD2,
[18] = RIG_MODE_NONE, // FM-D2 not supported yet
[19] = RIG_MODE_NONE, // AM-D2 not supported yet
[20] = RIG_MODE_LSBD3,
[21] = RIG_MODE_USBD3,
[22] = RIG_MODE_NONE, // FM-D3 not supported yet
[23] = RIG_MODE_NONE, // AM-D3 not supported yet
};
/*
@ -2405,6 +2413,12 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (RIG_MODE_PKTUSB == mode) { mode = RIG_MODE_RTTYR; }
}
if (RIG_IS_TS990S)
{
if (mode == RIG_MODE_PKTUSB) mode = RIG_MODE_USBD1;
if (mode == RIG_MODE_PKTLSB) mode = RIG_MODE_LSBD1;
}
kmode = rmode2kenwood(mode, caps->mode_table);
if (kmode < 0)
@ -2455,6 +2469,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (err2 != RIG_OK) { RETURNFUNC2(err2); }
}
return RIG_OK;
}
else
{

Wyświetl plik

@ -28,7 +28,7 @@
#include "token.h"
#include "idx_builtin.h"
#define BACKEND_VER "20231226"
#define BACKEND_VER "20240224"
#define EOM_KEN ';'
#define EOM_TH '\r'

Wyświetl plik

@ -32,7 +32,7 @@
#define TS990S_AM_MODES RIG_MODE_AM
#define TS990S_FM_MODES (RIG_MODE_FM|RIG_MODE_FMN)
#define TS990S_OTHER_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTUSB|RIG_MODE_PKTLSB)
#define TS990S_OTHER_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_USBD1|RIG_MODE_USBD2|RIG_MODE_USBD3|RIG_MODE_LSBD1|RIG_MODE_LSBD2|RIG_MODE_LSBD3)
#define TS990S_HP_MODES (TS990S_OTHER_MODES|TS990S_FM_MODES)
#define TS990S_ALL_MODES (TS990S_OTHER_MODES|TS990S_AM_MODES|TS990S_FM_MODES)
@ -103,16 +103,16 @@ static rmode_t ts990s_mode_table[KENWOOD_MODE_TABLE_MAX] =
[9] = RIG_MODE_RTTYR,
[10] = RIG_MODE_NONE, /* A */
[11] = RIG_MODE_NONE, /* B */
[12] = RIG_MODE_PKTLSB, /* C */
[13] = RIG_MODE_PKTUSB, /* D */
[12] = RIG_MODE_LSBD1, /* C */
[13] = RIG_MODE_USBD1, /* D */
[14] = RIG_MODE_PKTFM, /* E */
[15] = RIG_MODE_NONE, /* F */
[16] = RIG_MODE_PKTLSB, /* G */
[17] = RIG_MODE_PKTUSB, /* H */
[16] = RIG_MODE_LSBD2, /* G */
[17] = RIG_MODE_USBD2, /* H */
[18] = RIG_MODE_PKTFM, /* I */
[19] = RIG_MODE_NONE, /* J */
[20] = RIG_MODE_PKTLSB, /* K */
[21] = RIG_MODE_PKTUSB, /* L */
[20] = RIG_MODE_LSBD3, /* K */
[21] = RIG_MODE_USBD3, /* L */
[22] = RIG_MODE_PKTFM, /* M */
[23] = RIG_MODE_NONE, /* N */
};

Wyświetl plik

@ -21,17 +21,44 @@ struct ip_mreq
int mysleep = 20;
float freqA = 14074000;
float freqB = 14074500;
int freqA = 14074000;
int freqB = 14074500;
int filternum1 = 7;
int filternum2 = 8;
int datamode = 0;
int vfo, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune;
int operatingband;
int split;
int modeMain = 2;
int modeSub = 2;
int keyspd = 20;
int rg0 = 50;
int rg1 = 50;
int sq0 = 0;
int sq1 = 0;
int mg = 0;
int nt0 = 0;
int nt1 = 0;
int nr0 = 0;
int nr1 = 0;
int gc0 = 0;
int gc1 = 0;
int mv0 = 0;
int mv1 = 0;
int pa0 = 0;
int pa1 = 0;
int ra0 = 0;
int ra1 = 0;
int rl0 = 0;
int rl1 = 0;
int ml = 0;
int ag0 = 0;
int ag1 = 0;
int sl0 = 0;
int sl1 = 0;
int sh0 = 0;
int sh1 = 0;
int mo0 = 0;
int mo1 = 0;
int pc = 50;
#if defined(WIN32) || defined(_WIN32)
@ -106,34 +133,36 @@ int main(int argc, char *argv[])
char buf[256];
char *pbuf;
int fd = openPort(argv[1]);
int freqa = 14074000, freqb = 140735000;
int modeA = 1, modeB = 2;
char modeA = '1', modeB = '2';
while (1)
{
hl_usleep(10);
buf[0] = 0;
if (getmyline(fd, buf) > 0) { printf("Cmd:%s\n", buf); }
//if (getmyline(fd, buf) > 0) { printf("Cmd:%s\n", buf); }
getmyline(fd, buf);
// else { return 0; }
if (strncmp(buf, "RM2", 3) == 0)
if (strncmp(buf, "AC000;", 3) == 0)
{
continue;
}
else if (strncmp(buf, "RMA2", 3) == 0)
{
pbuf = "RM20020;";
write(fd, pbuf, strlen(pbuf));
}
else if (strcmp(buf, "RM5;") == 0)
else if (strcmp(buf, "RM51;") == 0)
{
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
pbuf = "RM5100000;";
pbuf = "RM5100001;";
write(fd, pbuf, strlen(pbuf));
}
else if (strcmp(buf, "AN0;") == 0)
{
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
pbuf = "AN030;";
write(fd, pbuf, strlen(pbuf));
@ -141,10 +170,9 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "IF;") == 0)
{
char ifbuf[256];
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
// pbuf = "IF000503130001000+0000000000030000000;"
sprintf(ifbuf, "IF%011d1000+0000002000000000000;", freqa);
sprintf(ifbuf, "IF%011d1000+0000002000000000000;", freqA);
//pbuf = "IF00010138698 +00000000002000000 ;
write(fd, ifbuf, strlen(ifbuf));
continue;
@ -195,7 +223,6 @@ int main(int argc, char *argv[])
{
SNPRINTF(buf, sizeof(buf), "IS+0000;");
write(fd, buf, strlen(buf));
printf("%s\n", buf);
continue;
}
else if (strncmp(buf, "IS", 2) == 0)
@ -206,16 +233,18 @@ int main(int argc, char *argv[])
{
SNPRINTF(buf, sizeof(buf), "SM0035;");
write(fd, buf, strlen(buf));
printf("%s\n", buf);
continue;
}
else if (strncmp(buf, "PC;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "PC100;");
SNPRINTF(buf, sizeof(buf), "PC%03d;", pc);
write(fd, buf, strlen(buf));
printf("%s\n", buf);
continue;
}
else if (strncmp(buf, "PC", 2) == 0)
{
sscanf(buf, "PC%d", &pc);
}
else if (strcmp(buf, "FW;") == 0)
{
//usleep(mysleep * 1000);
@ -232,7 +261,6 @@ int main(int argc, char *argv[])
}
else if (strcmp(buf, "ID;") == 0)
{
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
int id = 24;
SNPRINTF(buf, sizeof(buf), "ID%03d;", id);
@ -245,7 +273,6 @@ int main(int argc, char *argv[])
{
if (strcmp(buf, "AI;"))
{
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
n = fprintf(fp, "%s", "AI0;");
}
@ -254,7 +281,6 @@ int main(int argc, char *argv[])
#endif
else if (strcmp(buf, "VS;") == 0)
{
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
pbuf = "VS0;";
write(fd, pbuf, strlen(pbuf));
@ -264,7 +290,6 @@ int main(int argc, char *argv[])
{
static int ant = 0;
ant = (ant + 1) % 3;
printf("%s\n", buf);
hl_usleep(mysleep * 1000);
SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant);
write(fd, buf, strlen(buf));
@ -276,24 +301,24 @@ int main(int argc, char *argv[])
}
else if (strcmp(buf, "FA;") == 0)
{
SNPRINTF(buf, sizeof(buf), "FA%011d;", freqa);
SNPRINTF(buf, sizeof(buf), "FA%011d;", freqA);
write(fd, buf, strlen(buf));
continue;
}
else if (strcmp(buf, "FB;") == 0)
{
SNPRINTF(buf, sizeof(buf), "FB%011d;", freqb);
SNPRINTF(buf, sizeof(buf), "FB%011d;", freqB);
write(fd, buf, strlen(buf));
continue;
}
else if (strncmp(buf, "FA", 2) == 0)
{
sscanf(buf, "FA%d", &freqa);
sscanf(buf, "FA%d", &freqA);
continue;
}
else if (strncmp(buf, "FB", 2) == 0)
{
sscanf(buf, "FB%d", &freqb);
sscanf(buf, "FB%d", &freqB);
continue;
}
else if (strncmp(buf, "AI;", 3) == 0)
@ -316,9 +341,9 @@ int main(int argc, char *argv[])
}
else if (buf[3] == ';' && strncmp(buf, "SF", 2) == 0)
{
SNPRINTF(buf, sizeof(buf), "SF%c%011.0f%c;", buf[2],
SNPRINTF(buf, sizeof(buf), "SF%c%011d%c;", buf[2],
buf[2] == '0' ? freqA : freqB,
buf[2] == '0' ? modeA + '0' : modeB + '0');
buf[2] == '0' ? modeA : modeB);
write(fd, buf, strlen(buf));
continue;
}
@ -326,25 +351,12 @@ int main(int argc, char *argv[])
{
mode_t tmpmode = buf[14];
if (buf[2] == '0') { modeA = tmpmode - '0'; }
else { modeB = tmpmode - '0'; }
modeA = tmpmode;
printf("modeA=%c, modeB=%c\n", modeA, modeB);
continue;
}
else if (strncmp(buf, "MD;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "MD%d;",
modeA); // not worried about modeB yet for simulator
write(fd, buf, strlen(buf));
continue;
}
else if (strncmp(buf, "MD", 2) == 0)
{
sscanf(buf, "MD%d", &modeA); // not worried about modeB yet for simulator
continue;
}
else if (strncmp(buf, "FL;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "FL%03d%03d;", filternum1, filternum2);
@ -380,13 +392,11 @@ int main(int argc, char *argv[])
{
SNPRINTF(buf, sizeof(buf), "DA%d;", datamode);
write(fd, buf, strlen(buf));
printf("%s\n", buf);
continue;
}
else if (strncmp(buf, "DA", 2) == 0)
{
sscanf(buf, "DA%d", &datamode);
printf("%s\n", buf);
continue;
}
else if (strncmp(buf, "BD;", 3) == 0)
@ -447,27 +457,297 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "OM0;", 4) == 0)
{
sprintf(buf, "OM0%d;", modeMain);
sprintf(buf, "OM0%c;", modeA);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "OM0", 3) == 0)
{
sscanf(buf, "OM0%d", &modeMain);
modeA = buf[3];
}
else if (strncmp(buf, "OM1;", 4) == 0)
{
sprintf(buf, "OM1%d;", modeSub);
sprintf(buf, "OM1%c;", modeB);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "OM1", 3) == 0)
{
sscanf(buf, "OM1%d", &modeSub);
modeB = buf[3];
}
else if (strcmp(buf, "RM;") == 0)
{
sprintf(buf, "RM2%04d;", 10);
write(fd, buf, strlen(buf));
}
else if (strcmp(buf, "RG0;") == 0)
{
sprintf(buf, "RG0%03d;", rg0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RG0", 3) == 0)
{
sscanf(buf, "RG0%d", &rg0);
}
else if (strcmp(buf, "RG1;") == 0)
{
sprintf(buf, "RG1%03d;", rg1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RG1", 3) == 0)
{
sscanf(buf, "RG0%d", &rg1);
}
else if (strcmp(buf, "SQ0;") == 0)
{
sprintf(buf, "SQ0%03d;", sq0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SQ0", 3) == 0)
{
sscanf(buf, "SQ0%d", &sq0);
}
else if (strcmp(buf, "SQ1;") == 0)
{
sprintf(buf, "SQ1%03d;", sq1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SQ1", 3) == 0)
{
sscanf(buf, "SQ1%d", &sq1);
}
else if (strcmp(buf, "MG;") == 0)
{
sprintf(buf, "MG%03d;", mg);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MG", 2) == 0)
{
sscanf(buf, "MG%d", &mg);
}
else if (strcmp(buf, "ML;") == 0)
{
sprintf(buf, "ML%03d;", ml);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "ML", 2) == 0)
{
sscanf(buf, "ML%d", &ml);
}
else if (strcmp(buf, "NT0;") == 0)
{
sprintf(buf, "NT0%03d;", nt0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "NT0", 3) == 0)
{
sscanf(buf, "NT0%d", &nt0);
}
else if (strcmp(buf, "NT1;") == 0)
{
sprintf(buf, "NT1%03d;", nt1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "NT1", 3) == 0)
{
sscanf(buf, "NT1%d", &nt1);
}
else if (strcmp(buf, "NR0;") == 0)
{
sprintf(buf, "NR0%03d;", nr0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "NR0", 3) == 0)
{
sscanf(buf, "NR0%d", &nr0);
}
else if (strcmp(buf, "NR1;") == 0)
{
sprintf(buf, "NR1%03d;", nr1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "NR1", 3) == 0)
{
sscanf(buf, "NR1%d", &nr1);
}
else if (strcmp(buf, "GC0;") == 0)
{
sprintf(buf, "GC0%03d;", gc0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "GC0", 3) == 0)
{
sscanf(buf, "GC0%d", &gc0);
}
else if (strcmp(buf, "GC1;") == 0)
{
sprintf(buf, "GC1%03d;", gc1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "GC1", 3) == 0)
{
sscanf(buf, "GC1%d", &gc1);
}
else if (strcmp(buf, "MV0;") == 0)
{
sprintf(buf, "MV0%03d;", mv0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MV0", 3) == 0)
{
sscanf(buf, "MV0%d", &mv0);
}
else if (strcmp(buf, "MV1;") == 0)
{
sprintf(buf, "MV1%03d;", mv1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MV1", 3) == 0)
{
sscanf(buf, "MV1%d", &mv1);
}
else if (strcmp(buf, "PA0;") == 0)
{
sprintf(buf, "PA0%03d;", pa0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "PA0", 3) == 0)
{
sscanf(buf, "PA0%d", &pa0);
}
else if (strcmp(buf, "PA1;") == 0)
{
sprintf(buf, "PA1%03d;", pa1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "PA1", 3) == 0)
{
sscanf(buf, "PA1%d", &pa1);
}
else if (strcmp(buf, "RA0;") == 0)
{
sprintf(buf, "RA0%03d;", ra0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RA0", 3) == 0)
{
sscanf(buf, "RA0%d", &ra0);
}
else if (strcmp(buf, "RA1;") == 0)
{
sprintf(buf, "RA1%03d;", ra1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RA1", 3) == 0)
{
sscanf(buf, "RA1%d", &ra1);
}
else if (strcmp(buf, "RL10;") == 0)
{
sprintf(buf, "RL10%02d;", rl0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RL10", 3) == 0)
{
sscanf(buf, "RL10%d", &rl0);
}
else if (strcmp(buf, "RL11;") == 0)
{
sprintf(buf, "RL11%02d;", rl1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "RL1", 3) == 0)
{
sscanf(buf, "RL1%d", &rl1);
}
else if (strcmp(buf, "AG0;") == 0)
{
sprintf(buf, "AG0%03d;", ag0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "AG0", 3) == 0)
{
sscanf(buf, "AG0%d", &ag0);
}
else if (strcmp(buf, "AG1;") == 0)
{
sprintf(buf, "AG1%03d;", ag1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "AG1", 3) == 0)
{
sscanf(buf, "AG1%d", &ag1);
}
else if (strcmp(buf, "SL0;") == 0)
{
sprintf(buf, "SL0%03d;", sl0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SL0", 3) == 0)
{
sscanf(buf, "SL0%d", &sl0);
}
else if (strcmp(buf, "SL1;") == 0)
{
sprintf(buf, "SL1%03d;", sl1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SL1", 3) == 0)
{
sscanf(buf, "SL1%d", &sl1);
}
else if (strcmp(buf, "SH0;") == 0)
{
sprintf(buf, "SH0%03d;", sh0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SH0", 3) == 0)
{
sscanf(buf, "SH0%d", &sh0);
}
else if (strcmp(buf, "SH1;") == 0)
{
sprintf(buf, "SH1%03d;", sh1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "SH1", 3) == 0)
{
sscanf(buf, "SH1%d", &sh1);
}
else if (strcmp(buf, "MO0;") == 0)
{
sprintf(buf, "MO0%d;", mo0);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MO0", 3) == 0)
{
sscanf(buf, "MO0%d", &mo0);
}
else if (strcmp(buf, "MO1;") == 0)
{
sprintf(buf, "MO1%d;", mo1);
write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MO1", 3) == 0)
{
sscanf(buf, "MO1%d", &mo1);
}
else if (strncmp(buf, "CK0", 3) == 0)
{
continue; // setting clock no action
}
else if (strlen(buf) > 0)
{
fprintf(stderr, "Unknown command: %s\n", buf);

Wyświetl plik

@ -3070,14 +3070,22 @@ int rig_test_2038(RIG *rig)
int failed = 0;
#if defined(__MSVCRT_VERSION__)
__time64_t x = (__time64_t)0xffffffff;
__time64_t const x = (__time64_t)0xF0000000;
char s[64];
_ctime64_s(s, sizeof(s), &x);
struct tm mytm;
int timeerr = _localtime64_s(&mytm, &x);
if (timeerr)
{
rig_debug(RIG_DEBUG_ERR, "%s: _localtime64_s: %s\n", __func__, strerror(errno));
}
strftime(s, sizeof(s), "%a %b %d %H:%M:%S %Y\n", &mytm);
rig_debug(RIG_DEBUG_VERBOSE, "%s: MSVCRT 2038 test = 0x%08llx:%s", __func__, x,
s);
if (strlen(s) == 0) { failed = 1; }
rig_debug(RIG_DEBUG_VERBOSE, "%s: MSVCRT 2038 test = 0x%08lx:%s\n", __func__, x,
s);
else if (strstr(s, "2097")) { return RIG_OK; }
#else