kopia lustrzana https://github.com/Hamlib/Hamlib
rodzic
a1c8493c62
commit
23d291de3c
|
@ -24,7 +24,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h> /* String function definitions */
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <hamlib/rig.h>
|
#include <hamlib/rig.h>
|
||||||
#include "idx_builtin.h"
|
#include "idx_builtin.h"
|
||||||
|
@ -1537,18 +1538,29 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||||
resplen = sizeof(respbuf);
|
resplen = sizeof(respbuf);
|
||||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||||
dump_hex(respbuf, resplen);
|
dump_hex(respbuf, resplen);
|
||||||
*year = respbuf[4];
|
*year = from_bcd(&respbuf[4], 4);
|
||||||
*month = respbuf[5];
|
*month = from_bcd(&respbuf[5], 2);
|
||||||
*day = respbuf[6];
|
*day = from_bcd(&respbuf[6], 2);
|
||||||
|
|
||||||
if (hour >= 0) //
|
if (hour != NULL)
|
||||||
{
|
{
|
||||||
prmbuf[0] = 0x00;
|
prmbuf[0] = 0x00;
|
||||||
prmbuf[1] = 0x95;
|
prmbuf[1] = 0x95;
|
||||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||||
dump_hex(respbuf, resplen);
|
dump_hex(respbuf, resplen);
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: %02d-%02d-%02dT%02d:%02d:%02d:%0.3lf\n'",
|
*hour = from_bcd(&respbuf[4], 2);
|
||||||
__func__, *year, *month, *day, *hour, *min, *sec, *msec);
|
*min = from_bcd(&respbuf[5], 2);
|
||||||
|
*sec = 0;
|
||||||
|
*msec = 0;
|
||||||
|
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -1644,7 +1656,8 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int *hour,
|
||||||
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen);
|
||||||
dump_hex(respbuf, resplen);
|
dump_hex(respbuf, resplen);
|
||||||
*utc_offset = respbuf[4];
|
*utc_offset = respbuf[4];
|
||||||
if (respbuf[5] > 0) *utc_offset = *utc_offset*100 + respbuf[5];
|
|
||||||
|
if (respbuf[5] > 0) { *utc_offset = *utc_offset * 100 + respbuf[5]; }
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Ładowanie…
Reference in New Issue