From: Nate B. <n0...@n0...> - 2012-12-14 20:22:45
|
* On 2012 14 Dec 13:27 -0600, k4...@fa... wrote: > Thanks to help from Nate and Tor, I have hamlib talking to my Yaesu > FTdx5000. > > Frequency and width work just fine. > Just don't understand the mode coming back from the radio. > > Here's what comes back: > rig in lsb, an 8 is returned. > usb returns a 4 > cw returns a 2 > AM returns a 1 > > Can someone point to where I can find the hamlib definitions? Yes, they are defined in rig.h. Your program should already be including hamlib/rig.h. The mode values you're seeing are the results of bit settings so you can look for modes with a bitmask. The modes have their own type, rmode_t, and are defined as RIG_MODE_AM, RIG_MODE_CW, and so on. If you want to convert the mode values to strings, the rig_strrmode() function is useful. Passing it 'RIG_MODE_AM', for example, will cause it to return the string "AM". Conversely, if you have the string "AM" you can convert that to the mode value with rig_parse_mode as in: rig_set_mode(my_rig, RIG_VFO_CURR, rig_parse_mode("AM"), rig_passband_normal(rig_parse_mode("AM")); And so on... I am working on the tests/testrig.c code that will use these functions a bit more prominently to make their use more clear. 73, de Nate >> -- "The optimist proclaims that we live in the best of all possible worlds. The pessimist fears this is true." Ham radio, Linux, bikes, and more: http://www.n0nb.us |