Re: [Hamlib-developer] [Hamlib/Hamlib] Fix rotorez.c to accept config parameters before rig open. (
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: George B. <geo...@gm...> - 2024-06-11 15:32:04
|
On 6/11/24 8:20 AM, Michael Black wrote: > > Turns our rotorez is not the only one that does this and it is much > simpler to handle this in rotctl/rotctld with a 1-line change to add a > rotor then to put this code in every backend. Plus you missed saving > the value which is used for the command selection in the set_conf > function. This does seem to be unique to rotor backends. > This is so wrong on so many levels I hardly know where to begin. But lets go through them. "Plus you missed saving the value which is used for the command selection in the set_conf function." This gets me the most - I save the command that would be sent to the rotator, not anything from the set_conf call. It's already been encoded with the value - upper case for set, lower case for clear. I just send the same command to the rotator a little bit later. "Turns our rotorez is not the only one that does this and it is much simpler to handle this in rotctl/rotctld with a 1-line change to add a rotor then to put this code in every backend." Yes, it might be simpler - but wrong. It doesn't fix the root cause, that rotorez_set_conf() doesn't agree with the (unwritten) Hamlib specifications. That means an application(not just rotctl[d]) will call rot_set_conf() before rot_open(), expecting the value will be set for future use, whenever it is referenced. Moreover, it could mix frontend and backend parameters in the same set of calls. They have to be handled similarly. ISTM that this is the very basic reason that Hamlib exists - to provide a completely consistent sequence of calls to handle any parameter of any device. If there are others, I'll fix those too. Why? Because I don't like incomplete fixes. It only took half an hour to write the code once I figured out where things were, so lets fix it right. > > Reply to this email directly, view it on GitHub > <https://github.com/Hamlib/Hamlib/pull/1565#issuecomment-2160620224>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AC36NNGNBPQFDA333ZYX7NTZG3TQBAVCNFSM6AAAAABJBF2DHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRQGYZDAMRSGQ>. > You are receiving this because you authored the thread.Message ID: > <Hamlib/Hamlib/pull/1565/c21...@gi...> > |