[Hamlib-developer] API Updates
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Frank S. <vk...@ix...> - 2000-09-18 03:56:49
|
Hi, Started to think about API set/get functions. rig.h ----- Added channel struct for mem handling and possible convenience functions. struct channel { int channel_num; freq_t freq; mode_t mode; vfo_t vfo; char channel_desc[MAXCHANDESC]; }; Added set/get pairs for API in rig_caps struct <snip> /* * General API commands, from most primitive to least.. :() * List Set/Get functions pairs */ int (*set_freq)(RIG *rig, freq_t freq); /* select freq */ struct freq_t (*get_freq)(RIG *rig); /* get freq */ int (*set_mode)(RIG *rig, rig_mode_t mode); /* select mode */ struct rig_mode_t (*get_mode)(RIG *rig, rig_mode_t mode); /* get mode */ int (*set_vfo)(RIG *rig, rig_vfo_t vfo); /* select vfo */ struct rig_vfo_t (*get_vfo)(RIG *rig); /* get vfo */ int (*set_ptt)(RIG *rig, rig_ptt_t ptt); /* ptt on/off */ struct rig_ptt_t (*get_ptt)(RIG *rig); /* get ptt status */ int (*set_rpt_shift)(RIG *rig, rig_rptr_shift_t rig_rptr_shift ); /* set repeater shift */ struct rig_rptr_shift_t (*get_rpt_shift)(RIG *rig); /* get repeater shift */ /* etc */ /* * Convenience Functions * */ int (*set_channel)(RIG *rig, struct channel ch); int (*get_channel)(RIG *rig, freq_t freq, rig_mode_t mode, rig_vfo_t vfo); <snip> rig.c ------ Added 3 commands to rig.c for examples cmd_set_freq cmd_set_mode cmd_set_vfo Compiles ok (no linking) with gcc -c rig.c -I. testrig.c ---------- Updated testrig.c with 3 examples also Compiles ok (no linking) with gcc -c testrig.c -I. Cheers / Frank.. -- Frank Singleton VK3FCS Email: victor kilo three foxtrot charlie sierra at ix dot netcom dot com |