Re: [Hamlib-developer] Proper caps in NET driver
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Bill S. <g4...@cl...> - 2015-12-11 16:48:02
|
On 11/12/2015 15:36, Piotr SQ9FK wrote: > How is correct way to solve this ? > Should I in f. netrigctl_open() after every rig->state.* update copy the > value to correspond caps->* ? Hi Piotr, rig->caps is a pointer to a struct that is supposed to be immutable. I don't think that the const struct rig_caps (netrigctl_caps) should be modified as it could be shared by more than one opened rig - the const is there for a reason! If it does make sense to "clone" the caps struct of a network accessed rig then netrigctl could build a new rig_caps struct on the heap and set rig->caps to point at it. In that case allocating a rig_caps struct on the heap and starting with a copy of netrigctl_caps in it might make sense. 73 Bill G4WJS. |