kopia lustrzana https://github.com/Hamlib/Hamlib
set/get_clock routines for IC7100/7300/7600/7610/7700/7800/785x/9700
https://github.com/Hamlib/Hamlib/issues/851Hamlib-4.4
rodzic
41990372da
commit
d38a248fda
2
NEWS
2
NEWS
|
@ -15,7 +15,7 @@ Version 4.4
|
|||
* Added ability to build hamlib with docker
|
||||
* Added M0NKA mcHF URP rig
|
||||
* Faster serial i/o noticeable on higher baud rates
|
||||
* IC7300 set_clock/get_clock routines added -- no auto set yet
|
||||
* IC7300/9700/7800/785x set_clock/get_clock routines added -- no auto set yet
|
||||
|
||||
Version 4.3.1
|
||||
* 2021-09-14
|
||||
|
|
|
@ -1149,6 +1149,11 @@ YYYY-MM-DDTHH:MM:SS.SSS+ZZ (where +ZZ is either -/+ UTC offset)
|
|||
YYYY-MM-DDTHH:MM:SS+ZZ
|
||||
YYYY-MM-DDTHH:MM+ZZ
|
||||
YYYY-MM-DD (sets date only)
|
||||
Note: Icom rigs expect you to set local time and the hours off to UTC.
|
||||
So...4PM EST example would be 2021-12-01T16:00:00+05
|
||||
But...if you want to display GMT you must set the clock for GMT with zero UTC offset.
|
||||
Hopefully Icom will allow displaying either clock in the future
|
||||
|
||||
.EE
|
||||
.
|
||||
.TP
|
||||
|
|
|
@ -377,7 +377,8 @@ read_another_frame:
|
|||
Unhold_Decode(rig);
|
||||
|
||||
*data_len = frm_data_len;
|
||||
if (data != NULL && data_len != NULL) memcpy(data, buf + 4, *data_len);
|
||||
|
||||
if (data != NULL && data_len != NULL) { memcpy(data, buf + 4, *data_len); }
|
||||
|
||||
/*
|
||||
* TODO: check addresses in reply frame
|
||||
|
|
|
@ -202,6 +202,106 @@ static const struct icom_priv_caps ic7100_priv_caps =
|
|||
.ant_count = 2
|
||||
};
|
||||
|
||||
// if hour < 0 then only date will be set
|
||||
int ic7100_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
||||
int sec, double msec, int utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x20;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x21;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x23;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ic7100_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
int resplen;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
unsigned char respbuf[MAXFRAMELEN];
|
||||
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x20;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x21;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x23;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
const struct rig_caps ic7100_caps =
|
||||
{
|
||||
RIG_MODEL(RIG_MODEL_IC7100),
|
||||
|
@ -407,5 +507,7 @@ const struct rig_caps ic7100_caps =
|
|||
.get_powerstat = icom_get_powerstat,
|
||||
.send_morse = icom_send_morse,
|
||||
.stop_morse = icom_stop_morse,
|
||||
.wait_morse = rig_wait_morse
|
||||
.wait_morse = rig_wait_morse,
|
||||
.set_clock = ic7100_set_clock,
|
||||
.get_clock = ic7100_get_clock
|
||||
};
|
||||
|
|
|
@ -543,7 +543,7 @@ const struct rig_caps ic7300_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC7300),
|
||||
.model_name = "IC-7300",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".5",
|
||||
.version = BACKEND_VER ".6",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -772,7 +772,7 @@ const struct rig_caps ic9700_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC9700),
|
||||
.model_name = "IC-9700",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".4",
|
||||
.version = BACKEND_VER ".5",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -1482,10 +1482,10 @@ int ic7300_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x94;
|
||||
prmbuf[2] = year / 100;
|
||||
prmbuf[3] = year % 100;
|
||||
prmbuf[4] = month;
|
||||
prmbuf[5] = day;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1498,8 +1498,8 @@ int ic7300_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x95;
|
||||
prmbuf[2] = hour;
|
||||
prmbuf[3] = min;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1509,9 +1509,10 @@ int ic7300_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x96;
|
||||
prmbuf[2] = utc_offset / 100;
|
||||
prmbuf[3] = utc_offset % 100;
|
||||
prmbuf[4] = utc_offset >= 0 ? 0 : 1;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1537,8 +1538,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
|||
prmbuf[1] = 0x94;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*year = from_bcd(&respbuf[4], 2)*1000+from_bcd(&respbuf[5],2);
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
|
@ -1547,7 +1547,6 @@ 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);
|
||||
dump_hex(respbuf, resplen);
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
|
@ -1556,11 +1555,15 @@ 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);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2);
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: %02d-%02d-%02dT%02d:%02d:%02d:%0.3lf%s%02d\n'",
|
||||
__func__, *year, *month, *day, *hour, *min, *sec, *msec,
|
||||
*utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
@ -1577,12 +1580,12 @@ int ic9700_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x94;
|
||||
prmbuf[2] = year / 100;
|
||||
prmbuf[3] = year % 100;
|
||||
prmbuf[4] = month;
|
||||
prmbuf[5] = day;
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x79;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1593,10 +1596,10 @@ int ic9700_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x95;
|
||||
prmbuf[2] = hour;
|
||||
prmbuf[3] = min;
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x80;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1604,11 +1607,12 @@ int ic9700_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x96;
|
||||
prmbuf[2] = utc_offset / 100;
|
||||
prmbuf[3] = utc_offset % 100;
|
||||
prmbuf[4] = utc_offset >= 0 ? 0 : 1;
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x84;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1634,30 +1638,32 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
|||
prmbuf[1] = 0x79;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*year = respbuf[4];
|
||||
*month = respbuf[5];
|
||||
*day = respbuf[6];
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x80;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*hour = respbuf[4];
|
||||
*min = respbuf[5];
|
||||
*sec = respbuf[6];
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: %02d-%02d-%02dT%02d:%02d:%02d:%0.3lf\n'",
|
||||
__func__, *year, *month, *day, *hour, *min, *sec, *msec);
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x81;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*utc_offset = respbuf[4];
|
||||
|
||||
if (respbuf[5] > 0) { *utc_offset = *utc_offset * 100 + respbuf[5]; }
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x84;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h> /* String function definitions */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "token.h"
|
||||
|
@ -32,6 +33,8 @@
|
|||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "bandplan.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define IC7600_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 IC7600_1HZ_TS_MODES IC7600_ALL_RX_MODES
|
||||
|
@ -163,12 +166,113 @@ static const struct icom_priv_caps ic7600_priv_caps =
|
|||
.extcmds = ic7600_extcmds, /* Custom op parameters */
|
||||
};
|
||||
|
||||
|
||||
// if hour < 0 then only date will be set
|
||||
int ic7600_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
||||
int sec, double msec, int utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x53;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x54;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x56;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ic7600_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
int resplen;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
unsigned char respbuf[MAXFRAMELEN];
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x53;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x54;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x56;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
const struct rig_caps ic7600_caps =
|
||||
{
|
||||
RIG_MODEL(RIG_MODEL_IC7600),
|
||||
.model_name = "IC-7600",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".1",
|
||||
.version = BACKEND_VER ".2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -343,5 +447,7 @@ const struct rig_caps ic7600_caps =
|
|||
.get_split_vfo = icom_get_split_vfo,
|
||||
.set_powerstat = icom_set_powerstat,
|
||||
.get_powerstat = icom_get_powerstat,
|
||||
.send_morse = icom_send_morse
|
||||
.send_morse = icom_send_morse,
|
||||
.set_clock = ic7600_set_clock,
|
||||
.get_clock = ic7600_get_clock
|
||||
};
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h> /* String function definitions */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "token.h"
|
||||
|
@ -33,6 +34,8 @@
|
|||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "bandplan.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define IC7610_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 IC7610_1HZ_TS_MODES IC7610_ALL_RX_MODES
|
||||
|
@ -243,12 +246,113 @@ static const struct icom_priv_caps ic7610_priv_caps =
|
|||
.extcmds = ic7610_extcmds,
|
||||
};
|
||||
|
||||
|
||||
// if hour < 0 then only date will be set
|
||||
int ic7610_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
||||
int sec, double msec, int utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x58;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ic7610_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
int resplen;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
unsigned char respbuf[MAXFRAMELEN];
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x58;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
const struct rig_caps ic7610_caps =
|
||||
{
|
||||
RIG_MODEL(RIG_MODEL_IC7610),
|
||||
.model_name = "IC-7610",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".4",
|
||||
.version = BACKEND_VER ".5",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -478,5 +582,7 @@ const struct rig_caps ic7610_caps =
|
|||
.send_morse = icom_send_morse,
|
||||
.stop_morse = icom_stop_morse,
|
||||
.wait_morse = rig_wait_morse,
|
||||
.send_voice_mem = rig_send_voice_mem
|
||||
.send_voice_mem = rig_send_voice_mem,
|
||||
.set_clock = ic7610_set_clock,
|
||||
.get_clock = ic7610_get_clock
|
||||
};
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h> /* String function definitions */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "token.h"
|
||||
|
@ -32,6 +33,8 @@
|
|||
#include "icom.h"
|
||||
#include "icom_defs.h"
|
||||
#include "bandplan.h"
|
||||
#include "frame.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define IC7700_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PSK|RIG_MODE_PSKR)
|
||||
#define IC7700_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
|
||||
|
@ -146,6 +149,106 @@ static const struct icom_priv_caps ic7700_priv_caps =
|
|||
.extcmds = ic7700_extcmds,
|
||||
};
|
||||
|
||||
// if hour < 0 then only date will be set
|
||||
int ic7700_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
||||
int sec, double msec, int utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x58;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x61;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ic7700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset)
|
||||
{
|
||||
int cmd = 0x1a;
|
||||
int subcmd = 0x05;
|
||||
int retval = RIG_OK;
|
||||
int resplen;
|
||||
unsigned char prmbuf[MAXFRAMELEN];
|
||||
unsigned char respbuf[MAXFRAMELEN];
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x58;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x61;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
const struct rig_caps ic7700_caps =
|
||||
{
|
||||
RIG_MODEL(RIG_MODEL_IC7700),
|
||||
|
@ -325,5 +428,7 @@ const struct rig_caps ic7700_caps =
|
|||
.get_powerstat = icom_get_powerstat,
|
||||
.send_morse = icom_send_morse,
|
||||
.stop_morse = icom_stop_morse,
|
||||
.wait_morse = rig_wait_morse
|
||||
.wait_morse = rig_wait_morse,
|
||||
.set_clock = ic7700_set_clock,
|
||||
.get_clock = ic7700_get_clock
|
||||
};
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#endif
|
||||
|
||||
#include <string.h> /* String function definitions */
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "token.h"
|
||||
|
@ -155,7 +156,7 @@ const struct rig_caps ic7800_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC7800),
|
||||
.model_name = "IC-7800",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".4",
|
||||
.version = BACKEND_VER ".5",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -417,12 +418,12 @@ int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
|
||||
if (year >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x20;
|
||||
prmbuf[2] = year / 100;
|
||||
prmbuf[3] = year % 100;
|
||||
prmbuf[4] = month;
|
||||
prmbuf[5] = day;
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x59;
|
||||
to_bcd(&prmbuf[2], year / 100, 2);
|
||||
to_bcd(&prmbuf[3], year % 100, 2);
|
||||
to_bcd(&prmbuf[4], month, 2);
|
||||
to_bcd(&prmbuf[5], day, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -433,10 +434,10 @@ int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
|
||||
if (hour >= 0)
|
||||
{
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x21;
|
||||
prmbuf[2] = hour;
|
||||
prmbuf[3] = min;
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x60;
|
||||
to_bcd(&prmbuf[2], hour, 2);
|
||||
to_bcd(&prmbuf[3], min, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -444,11 +445,12 @@ int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval));
|
||||
}
|
||||
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x23;
|
||||
prmbuf[2] = utc_offset / 100;
|
||||
prmbuf[3] = utc_offset % 100;
|
||||
prmbuf[4] = utc_offset >= 0 ? 0 : 1;
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2);
|
||||
to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2);
|
||||
to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -460,7 +462,6 @@ int ic7800_set_clock(RIG *rig, int year, int month, int day, int hour, int min,
|
|||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||
int *min, int *sec, double *msec, int *utc_offset)
|
||||
{
|
||||
|
@ -472,30 +473,36 @@ int ic7800_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
|||
unsigned char respbuf[MAXFRAMELEN];
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x94;
|
||||
prmbuf[1] = 0x59;
|
||||
resplen = sizeof(respbuf);
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*year = respbuf[4];
|
||||
*month = respbuf[5];
|
||||
*day = respbuf[6];
|
||||
*year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2);
|
||||
*month = from_bcd(&respbuf[6], 2);
|
||||
*day = from_bcd(&respbuf[7], 2);
|
||||
|
||||
if (hour >= 0) //
|
||||
if (hour != NULL)
|
||||
{
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x95;
|
||||
prmbuf[1] = 0x60;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: %02d-%02d-%02dT%02d:%02d:%02d:%0.3lf\n'",
|
||||
__func__, *year, *month, *day, *hour, *min, *sec, *msec);
|
||||
prmbuf[0] = 0x01;
|
||||
prmbuf[1] = 0x81;
|
||||
*hour = from_bcd(&respbuf[4], 2);
|
||||
*min = from_bcd(&respbuf[5], 2);
|
||||
*sec = 0;
|
||||
*msec = 0;
|
||||
|
||||
prmbuf[0] = 0x00;
|
||||
prmbuf[1] = 0x62;
|
||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||
dump_hex(respbuf, resplen);
|
||||
*utc_offset = respbuf[4];
|
||||
if (respbuf[5] > 0) *utc_offset = *utc_offset*100 + respbuf[5];
|
||||
*utc_offset = from_bcd(&respbuf[4], 2) * 100;
|
||||
*utc_offset += from_bcd(&respbuf[5], 2);
|
||||
|
||||
if (respbuf[6] != 0x00) { *utc_offset *= -1; }
|
||||
|
||||
//rig_debug(RIG_DEBUG_VERBOSE,
|
||||
// "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'",
|
||||
// __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000,
|
||||
// *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ const struct rig_caps ic785x_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC785x),
|
||||
.model_name = "IC-7850/7851",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".2",
|
||||
.version = BACKEND_VER ".3",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -346,7 +346,8 @@ static struct test_table test_list[] =
|
|||
{ 0xf5, "get_rig_info", ACTION(get_rig_info), ARG_NOVFO | ARG_OUT, "RigInfo" }, /* get several vfo parameters at once */
|
||||
{ 0xf4, "get_vfo_list", ACTION(get_vfo_list), ARG_OUT | ARG_NOVFO, "VFOs" },
|
||||
{ 0xf6, "get_modes", ACTION(get_modes), ARG_OUT | ARG_NOVFO, "Modes" },
|
||||
{ 0xf9, "get_clock", ACTION(get_clock), ARG_IN | ARG_NOVFO, "local/utc" },
|
||||
// { 0xf9, "get_clock", ACTION(get_clock), ARG_IN | ARG_NOVFO, "local/utc" },
|
||||
{ 0xf9, "get_clock", ACTION(get_clock), ARG_NOVFO },
|
||||
{ 0xf8, "set_clock", ACTION(set_clock), ARG_IN | ARG_NOVFO, "YYYYMMDDHHMMSS.sss+ZZ" },
|
||||
{ 0xf1, "halt", ACTION(halt), ARG_NOVFO }, /* rigctld only--halt the daemon */
|
||||
{ 0x8c, "pause", ACTION(pause), ARG_IN, "Seconds" },
|
||||
|
@ -5228,6 +5229,10 @@ declare_proto_rig(set_clock)
|
|||
__func__, n, year, mon, day, hour, min, sec, msec, utc_offset >= 0 ? "+" : "-",
|
||||
(unsigned)abs(utc_offset));
|
||||
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
if (utc_offset < 24) utc_offset *= 100; // allow for minutes offset too
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset);
|
||||
|
||||
RETURNFUNC(rig_set_clock(rig, year, mon, day, hour, min, sec, msec,
|
||||
utc_offset));
|
||||
}
|
||||
|
@ -5235,20 +5240,21 @@ declare_proto_rig(set_clock)
|
|||
/* '0xf9' */
|
||||
declare_proto_rig(get_clock)
|
||||
{
|
||||
char option[64];
|
||||
int year, month, day, hour, min, sec, utc_offset;
|
||||
//char option[64];
|
||||
int year, month, day, hour, min, sec, utc_offset, aoffset;
|
||||
int retval;
|
||||
double msec;
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
CHKSCN1ARG(sscanf(arg1, "%63s", option));
|
||||
//CHKSCN1ARG(sscanf(arg1, "%63s", option));
|
||||
|
||||
retval = rig_get_clock(rig, &year, &month, &day, &hour, &min, &sec, &msec,
|
||||
&utc_offset);
|
||||
|
||||
fprintf(fout, "%04d-%02d-%02dT%02d:%02d:%02d.%0.3f%s%02d\n", year, month, day,
|
||||
hour, min, sec, msec, utc_offset >= 0 ? "+" : "-", (unsigned)abs(utc_offset));
|
||||
aoffset = abs(utc_offset);
|
||||
fprintf(fout, "%04d-%02d-%02dT%02d:%02d:%06.3f%s%02d:%02d\n", year, month, day,
|
||||
hour, min, sec + msec / 1000, utc_offset >= 0 ? "+" : "-",
|
||||
aoffset/100, aoffset % 100);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue