[Hamlib-cvs-digest] CVS: hamlib/icom icom.c,1.10,1.11 icom.h,1.9,1.10
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Stephane F. <f4...@us...> - 2000-12-05 22:01:06
|
Update of /cvsroot/hamlib/hamlib/icom In directory slayer.i.sourceforge.net:/tmp/cvs-serv3805/icom Modified Files: icom.c icom.h Log Message: * all the API functions are now targetted to a particular VFO. This is a major change in the library interface, and the implementation is not complete yet (especially in the backends), but the API should be fine. Anyway, at this stage of developement, interface design experimenting matters more than completeness. * added new shortfreq_t type for frequencies on 31bits (up to 2GHz) for use by offset/shifts/etc. Index: icom.c =================================================================== RCS file: /cvsroot/hamlib/hamlib/icom/icom.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** icom.c 2000/12/04 23:39:17 1.10 --- icom.c 2000/12/05 22:01:02 1.11 *************** *** 279,283 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_freq(RIG *rig, freq_t freq) { struct icom_priv_data *priv; --- 279,283 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { struct icom_priv_data *priv; *************** *** 311,315 **** * Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL */ ! int icom_get_freq(RIG *rig, freq_t *freq) { struct icom_priv_data *priv; --- 311,315 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL */ ! int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { struct icom_priv_data *priv; *************** *** 355,359 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_mode(RIG *rig, rmode_t mode, pbwidth_t width) { struct icom_priv_data *priv; --- 355,359 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct icom_priv_data *priv; *************** *** 382,386 **** * Assumes rig!=NULL, rig->state.priv!=NULL, mode!=NULL, width!=NULL */ ! int icom_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width) { struct icom_priv_data *priv; --- 382,386 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, mode!=NULL, width!=NULL */ ! int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { struct icom_priv_data *priv; *************** *** 446,450 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_level(RIG *rig, setting_t level, value_t val) { return -RIG_ENIMPL; --- 446,450 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { return -RIG_ENIMPL; *************** *** 455,459 **** * Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL */ ! int icom_get_level(RIG *rig, setting_t level, value_t *val) { struct icom_priv_data *priv; --- 455,459 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL */ ! int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { struct icom_priv_data *priv; *************** *** 607,611 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_ptt(RIG *rig, ptt_t ptt) { struct icom_priv_data *priv; --- 607,611 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { struct icom_priv_data *priv; *************** *** 634,638 **** * Assumes rig!=NULL, rig->state.priv!=NULL, ptt!=NULL */ ! int icom_get_ptt(RIG *rig, ptt_t *ptt) { struct icom_priv_data *priv; --- 634,638 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, ptt!=NULL */ ! int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { struct icom_priv_data *priv; *************** *** 665,669 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift) { struct icom_priv_data *priv; --- 665,669 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) { struct icom_priv_data *priv; *************** *** 707,711 **** * Assumes rig!=NULL, rig->state.priv!=NULL, rptr_shift!=NULL */ ! int icom_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift) { struct icom_priv_data *priv; --- 707,711 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, rptr_shift!=NULL */ ! int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) { struct icom_priv_data *priv; *************** *** 751,755 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_rptr_offs(RIG *rig, unsigned long rptr_offs) { struct icom_priv_data *priv; --- 751,755 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) { struct icom_priv_data *priv; *************** *** 782,786 **** * Assumes rig!=NULL, rig->state.priv!=NULL, rptr_offs!=NULL */ ! int icom_get_rptr_offs(RIG *rig, unsigned long *rptr_offs) { struct icom_priv_data *priv; --- 782,786 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, rptr_offs!=NULL */ ! int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) { struct icom_priv_data *priv; *************** *** 819,830 **** * FIXME: status */ ! int icom_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq) { int status; status = icom_set_vfo(rig, RIG_VFO_B); ! status |= icom_set_freq(rig, tx_freq); status |= icom_set_vfo(rig, RIG_VFO_A); ! status |= icom_set_freq(rig, rx_freq); return status; --- 819,830 ---- * FIXME: status */ ! int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq) { int status; status = icom_set_vfo(rig, RIG_VFO_B); ! status |= icom_set_freq(rig, RIG_VFO_CURR, tx_freq); status |= icom_set_vfo(rig, RIG_VFO_A); ! status |= icom_set_freq(rig, RIG_VFO_CURR, rx_freq); return status; *************** *** 837,848 **** * FIXME: status */ ! int icom_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq) { int status; status = icom_set_vfo(rig, RIG_VFO_B); ! status |= icom_get_freq(rig, tx_freq); status |= icom_set_vfo(rig, RIG_VFO_A); ! status |= icom_get_freq(rig, rx_freq); return status; --- 837,848 ---- * FIXME: status */ ! int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq) { int status; status = icom_set_vfo(rig, RIG_VFO_B); ! status |= icom_get_freq(rig, RIG_VFO_CURR, tx_freq); status |= icom_set_vfo(rig, RIG_VFO_A); ! status |= icom_get_freq(rig, RIG_VFO_CURR, rx_freq); return status; *************** *** 853,857 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_split(RIG *rig, split_t split) { struct icom_priv_data *priv; --- 853,857 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_split(RIG *rig, vfo_t vfo, split_t split) { struct icom_priv_data *priv; *************** *** 892,896 **** * Assumes rig!=NULL, rig->state.priv!=NULL, split!=NULL */ ! int icom_get_split(RIG *rig, split_t *split) { struct icom_priv_data *priv; --- 892,896 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, split!=NULL */ ! int icom_get_split(RIG *rig, vfo_t vfo, split_t *split) { struct icom_priv_data *priv; *************** *** 933,937 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_ts(RIG *rig, unsigned long ts) { struct icom_priv_data *priv; --- 933,937 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) { struct icom_priv_data *priv; *************** *** 969,973 **** * Assumes rig!=NULL, rig->state.priv!=NULL, ts!=NULL */ ! int icom_get_ts(RIG *rig, unsigned long *ts) { struct icom_priv_data *priv; --- 969,973 ---- * Assumes rig!=NULL, rig->state.priv!=NULL, ts!=NULL */ ! int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) { struct icom_priv_data *priv; *************** *** 1148,1152 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_mem(RIG *rig, int ch) { struct icom_priv_data *priv; --- 1148,1152 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_mem(RIG *rig, vfo_t vfo, int ch) { struct icom_priv_data *priv; *************** *** 1175,1179 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_bank(RIG *rig, int bank) { struct icom_priv_data *priv; --- 1175,1179 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_set_bank(RIG *rig, vfo_t vfo, int bank) { struct icom_priv_data *priv; *************** *** 1202,1206 **** * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_mv_ctl(RIG *rig, mv_op_t op) { struct icom_priv_data *priv; --- 1202,1206 ---- * Assumes rig!=NULL, rig->state.priv!=NULL */ ! int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op) { struct icom_priv_data *priv; *************** *** 1303,1307 **** if (rig->callbacks.freq_event) { freq = from_bcd(buf+5, (priv->civ_731_mode ? 4:5)*2); ! return rig->callbacks.freq_event(rig,freq); } else return -RIG_ENAVAIL; --- 1303,1307 ---- if (rig->callbacks.freq_event) { freq = from_bcd(buf+5, (priv->civ_731_mode ? 4:5)*2); ! return rig->callbacks.freq_event(rig,RIG_VFO_CURR,freq); } else return -RIG_ENAVAIL; *************** *** 1310,1314 **** if (rig->callbacks.mode_event) { icom2hamlib_mode(buf[5]| buf[6]<<8, &mode, &width); ! return rig->callbacks.mode_event(rig,mode,width); } else return -RIG_ENAVAIL; --- 1310,1314 ---- if (rig->callbacks.mode_event) { icom2hamlib_mode(buf[5]| buf[6]<<8, &mode, &width); ! return rig->callbacks.mode_event(rig,RIG_VFO_CURR,mode,width); } else return -RIG_ENAVAIL; Index: icom.h =================================================================== RCS file: /cvsroot/hamlib/hamlib/icom/icom.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** icom.h 2000/12/04 23:39:17 1.9 --- icom.h 2000/12/05 22:01:02 1.10 *************** *** 29,35 **** #define _ICOM_H 1 struct ts_sc_list { ! unsigned long ts; /* tuning step */ unsigned char sc; /* sub command */ }; --- 29,37 ---- #define _ICOM_H 1 + #include <hamlib/rig.h> + struct ts_sc_list { ! shortfreq_t ts; /* tuning step */ unsigned char sc; /* sub command */ }; *************** *** 43,68 **** int icom_init(RIG *rig); int icom_cleanup(RIG *rig); ! int icom_set_freq(RIG *rig, freq_t freq); ! int icom_get_freq(RIG *rig, freq_t *freq); ! int icom_set_mode(RIG *rig, rmode_t mode, pbwidth_t width); ! int icom_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width); int icom_set_vfo(RIG *rig, vfo_t vfo); ! int icom_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift); ! int icom_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift); ! int icom_set_rptr_offs(RIG *rig, unsigned long rptr_offs); ! int icom_get_rptr_offs(RIG *rig, unsigned long *rptr_offs); ! int icom_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq); ! int icom_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq); ! int icom_set_split(RIG *rig, split_t split); ! int icom_get_split(RIG *rig, split_t *split); ! int icom_set_ts(RIG *rig, unsigned long ts); ! int icom_get_ts(RIG *rig, unsigned long *ts); ! int icom_set_ptt(RIG *rig, ptt_t ptt); ! int icom_get_ptt(RIG *rig, ptt_t *ptt); ! int icom_set_bank(RIG *rig, int bank); ! int icom_set_mem(RIG *rig, int ch); ! int icom_mv_ctl(RIG *rig, mv_op_t op); ! int icom_set_level(RIG *rig, setting_t level, value_t val); ! int icom_get_level(RIG *rig, setting_t level, value_t *val); int icom_set_channel(RIG *rig, const channel_t *chan); int icom_get_channel(RIG *rig, channel_t *chan); --- 45,70 ---- int icom_init(RIG *rig); int icom_cleanup(RIG *rig); ! int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq); ! int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); ! int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); ! int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int icom_set_vfo(RIG *rig, vfo_t vfo); ! int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); ! int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); ! int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs); ! int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs); ! int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq); ! int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq); ! int icom_set_split(RIG *rig, vfo_t vfo, split_t split); ! int icom_get_split(RIG *rig, vfo_t vfo, split_t *split); ! int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts); ! int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts); ! int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); ! int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); ! int icom_set_bank(RIG *rig, vfo_t vfo, int bank); ! int icom_set_mem(RIG *rig, vfo_t vfo, int ch); ! int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op); ! int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); ! int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int icom_set_channel(RIG *rig, const channel_t *chan); int icom_get_channel(RIG *rig, channel_t *chan); |