kopia lustrzana https://github.com/Hamlib/Hamlib
had rx and tx status swapped (document error?)
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@37 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.0.1
rodzic
d6393077c2
commit
654a394267
|
@ -6,7 +6,7 @@
|
||||||
* via serial interface to an FT-847 using the "CAT" interface.
|
* via serial interface to an FT-847 using the "CAT" interface.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft847.c,v 1.5 2000-07-28 01:20:00 javabear Exp $
|
* $Id: ft847.c,v 1.6 2000-07-28 02:04:49 javabear Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -258,6 +258,8 @@ unsigned char cmd_get_rx_status(int fd) {
|
||||||
write_block(fd,data);
|
write_block(fd,data);
|
||||||
n = read_sleep(fd,datain,1); /* wait and read for 1 byte to be read */
|
n = read_sleep(fd,datain,1); /* wait and read for 1 byte to be read */
|
||||||
|
|
||||||
|
printf("datain[0] = %x \n",datain[0]);
|
||||||
|
|
||||||
return datain[0];
|
return datain[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -329,7 +331,7 @@ unsigned char cmd_get_freq_mode_status_sat_rx_vfo(int fd) {
|
||||||
unsigned char cmd_get_freq_mode_status_sat_tx_vfo(int fd) {
|
unsigned char cmd_get_freq_mode_status_sat_tx_vfo(int fd) {
|
||||||
int n; /* counters */
|
int n; /* counters */
|
||||||
|
|
||||||
static unsigned char data[] = { 0x00, 0x00, 0x00, 0x00, 0x13 }; /* get freq and mode status */
|
static unsigned char data[] = { 0x00, 0x00, 0x00, 0x00, 0x23 }; /* get freq and mode status */
|
||||||
/* sat tx vfo*/
|
/* sat tx vfo*/
|
||||||
|
|
||||||
write_block(fd,data);
|
write_block(fd,data);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* via serial interface to an FT-847 using the "CAT" interface.
|
* via serial interface to an FT-847 using the "CAT" interface.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: ft847.h,v 1.2 2000-07-25 23:14:35 javabear Exp $
|
* $Id: ft847.h,v 1.3 2000-07-28 02:02:22 javabear Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -16,21 +16,21 @@
|
||||||
|
|
||||||
#undef TX_ENABLED
|
#undef TX_ENABLED
|
||||||
|
|
||||||
/*
|
|
||||||
* TX Status Flags
|
|
||||||
*/
|
|
||||||
|
|
||||||
const unsigned char TXSF_DISC_CENTER = (1<<5);
|
|
||||||
const unsigned char TXSF_CTCSS_DCS_CODE = (1<<6);
|
|
||||||
const unsigned char TXSF_SQUELCH_STATUS = (1<<7);
|
|
||||||
const unsigned char TXSF_SMETER_MASK = 0x1f; /* bottom 5 bits */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RX Status Flags
|
* RX Status Flags
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const unsigned char RXSF_PTT_STATUS = (1<<7);
|
const unsigned char RXSF_DISC_CENTER = (1<<5);
|
||||||
const unsigned char RXSF_POALC_METER_MASK = 0x1f; /* bottom 5 bits */
|
const unsigned char RXSF_CTCSS_DCS_CODE = (1<<6);
|
||||||
|
const unsigned char RXSF_SQUELCH_STATUS = (1<<7);
|
||||||
|
const unsigned char RXSF_SMETER_MASK = 0x1f; /* bottom 5 bits */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TX Status Flags
|
||||||
|
*/
|
||||||
|
|
||||||
|
const unsigned char TXSF_PTT_STATUS = (1<<7);
|
||||||
|
const unsigned char TXSF_POALC_METER_MASK = 0x1f; /* bottom 5 bits */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* via serial interface to an FT-847 using the "CAT" interface.
|
* via serial interface to an FT-847 using the "CAT" interface.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: testlibft847.c,v 1.4 2000-07-26 00:37:26 javabear Exp $
|
* $Id: testlibft847.c,v 1.5 2000-07-28 02:03:27 javabear Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -26,46 +26,49 @@ static unsigned char datain[5]; /* data read from rig */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decode routine for rx status update map
|
* Decode routine for TX status update map
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void decode_rx_status_flags(unsigned char rxflag) {
|
static void decode_tx_status_flags(unsigned char txflag) {
|
||||||
|
|
||||||
if((rxflag & RXSF_PTT_STATUS) != 0 ) {
|
printf("TX Status = %i \n", txflag);
|
||||||
|
printf("TXSF_PTT_STATUS = %i \n",TXSF_PTT_STATUS);
|
||||||
|
|
||||||
|
if((txflag & TXSF_PTT_STATUS) != 0 ) {
|
||||||
printf("PTT = OFF (RX) \n");
|
printf("PTT = OFF (RX) \n");
|
||||||
} else {
|
} else {
|
||||||
printf("PTT = ON (TX) \n");
|
printf("PTT = ON (TX) \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("PO/ALC Meter Data = %i \n", rxflag & RXSF_POALC_METER_MASK);
|
printf("PO/ALC Meter Data = %i \n", txflag & TXSF_POALC_METER_MASK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decode routine for tx status update map
|
* Decode routine for RX status update map
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void decode_tx_status_flags(unsigned char txflag) {
|
static void decode_rx_status_flags(unsigned char rxflag) {
|
||||||
|
|
||||||
if((txflag & TXSF_DISC_CENTER) != 0 ) {
|
if((rxflag & RXSF_DISC_CENTER) != 0 ) {
|
||||||
printf("Discriminator = Off Center \n");
|
printf("Discriminator = Off Center \n");
|
||||||
} else {
|
} else {
|
||||||
printf("Discriminator = Centered \n");
|
printf("Discriminator = Centered \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((txflag & TXSF_SQUELCH_STATUS) != 0 ) {
|
if((rxflag & RXSF_SQUELCH_STATUS) != 0 ) {
|
||||||
printf("Squelch = Squelch On (no signal) \n");
|
printf("Squelch = Squelch On (no signal) \n");
|
||||||
} else {
|
} else {
|
||||||
printf("Squelch = Squelch Off (signal present) \n");
|
printf("Squelch = Squelch Off (signal present) \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((txflag & TXSF_CTCSS_DCS_CODE) != 0 ) {
|
if((rxflag & RXSF_CTCSS_DCS_CODE) != 0 ) {
|
||||||
printf("CTCSS/DCS Code = Un-Matched \n");
|
printf("CTCSS/DCS Code = Un-Matched \n");
|
||||||
} else {
|
} else {
|
||||||
printf("CTCSS/DCS Code = Matched \n");
|
printf("CTCSS/DCS Code = Matched \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("S-Meter Meter Data = %i \n", txflag & TXSF_SMETER_MASK);
|
printf("S-Meter Meter Data = %i \n", rxflag & RXSF_SMETER_MASK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,11 +154,13 @@ static int test(fd) {
|
||||||
cmd_cat_on(fd); /* cat on */
|
cmd_cat_on(fd); /* cat on */
|
||||||
sleep(1);
|
sleep(1);
|
||||||
cmd_sat_on(fd); /* sat mode on */
|
cmd_sat_on(fd); /* sat mode on */
|
||||||
sleep(1);
|
sleep(5);
|
||||||
cmd_sat_off(fd); /* sat mode off */
|
cmd_sat_off(fd); /* sat mode off */
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
data1 = cmd_get_rx_status(fd);
|
data1 = cmd_get_rx_status(fd);
|
||||||
|
printf("data1 = %i \n", data1);
|
||||||
|
|
||||||
decode_rx_status_flags(data1);
|
decode_rx_status_flags(data1);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
cmd_cat_off(fd); /* cat off */
|
cmd_cat_off(fd); /* cat off */
|
||||||
|
|
Ładowanie…
Reference in New Issue