From: Ervin H. - H. <ai...@gm...> - 2013-05-20 13:59:27
|
Hello Nate, hello list :) so, I haven't too much time in recent past, but as I wrote few months ago I restructured the API functions. When I started to use hamlib (with Python) I could't use few functions (eg: send_morse), because the order (and number) of arguments doesn't match with C functions - but it hasn't own API without documentation. In API the all functions where the first argument is a vfo object, accepts it as last argument, and it's not mandatory, it has a default value. After I discuss this problem with Nate and I suggested change all functions to be conform with original C API. I think this is not necessarily a good solution, so I think I keep untached the "reordered" arguments functions, but rename all of them. So, I attached the patches: * rig.swg.patch: contains the core modifications to make all of above * pytest.py.patch: contains the modifications of Nate's Python example, but there is the new and old formula of the affected functions * perltest.pl.patch: same as pytest.py.patch And finally, here is a spreadsheet, which contains the all affected (or will affect soon) functions, with name, argument list, original name wich conform with the C API, and new name which still works with old API convention. https://docs.google.com/spreadsheet/ccc?key=0AvfXisaU5sMBdFZHY0Jyckk0cWpfMUVTQmQ2SkEzS3c#gid=0 As you can see, the main convention is the function with default value argument will renamed from original name, as the method (set, get) moved to the end of the name of function. Example, the C function is set_mode(), in bindings this name will be used, and 1st argument is mandatory as a vfo_t object. This is accesible with new name: mode_set(), vfo_t is the last argument, and not mandatory, evaulated the currently used VFO. Please look at the patches, any comment welcome. Nate, I didn't look the Rotator part of hamlib, it could be same problem like VFO in Rig part? How can I help you next? As you can see, there are some unimplemented functions, should I see those? You wrote previously it would be great to create Java binding - but I think first clean the all function. bye, 73: Ervin HA2OS -- I � UTF-8 |