From ae03f3932e6f03a1ed9e65e8698754aece20f8e5 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 12 May 2016 19:35:40 +0100 Subject: [PATCH] swig/ruby: update bindings Add methods for several Comedilib functions that are currently absent from the Ruby bindings. Rename the comedi_to_physical, comedi_from_physical, and cleanup_calibration_file methods to to_physical, from_physical, and cleanup_calibration, either for consistency (comedi_to_physical and comedi_from_physical) or because they are wrong (cleanup_cleanup_calibration_file). TODO: Add a binding for comedi_get_clock_source() as well, but I'm not sure how to handle multiple output parameters. --- swig/ruby/lib/comedi.rb | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/swig/ruby/lib/comedi.rb b/swig/ruby/lib/comedi.rb index 998a873..f53a044 100644 --- a/swig/ruby/lib/comedi.rb +++ b/swig/ruby/lib/comedi.rb @@ -168,8 +168,8 @@ private to_phys from_phys set_global_oor_behavior - comedi_to_physical - comedi_from_physical + to_physical + from_physical }), ] @@ -209,9 +209,29 @@ private set_max_buffer_size get_buffer_contents mark_buffer_read + mark_buffer_written get_buffer_offset get_softcal_converter get_hardcal_converter + internal_trigger + arm + arm_channel + disarm + disarm_channel + reset + reset_channel + set_counter_mode + set_clock_source + set_filter + set_gate_source + set_other_source + set_routing + get_hardware_buffer_size + digital_trigger_disable + digital_trigger_enable_edges + digital_trigger_enable_levels + set_read_subdevice + set_write_subdevice }), # SWIG::TYPE_p_comedi_t_struct methods that return status and a @@ -221,10 +241,14 @@ private data_read data_read_delayed dio_read + dio_bitfield dio_bitfield2 get_cmd_src_mask get_cmd_generic_timed + get_gate_source + get_routing }), + # TODO: add get_clock_source, but it returns status and two values. # SWIG::TYPE_p_comedi_t_struct methods that return status and a # value. Status is -1 on error. Status and value are both @@ -280,7 +304,7 @@ private # Comedi_calibration_t methods that do not indicate errors. Method_group.new(Comedi_calibration_t, :none, nil, %w{ - cleanup_calibration_file + cleanup_calibration }) ]