tinkerforge 2.1.24 → 2.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +155 -74
  3. data/lib/tinkerforge/brick_hat.rb +70 -30
  4. data/lib/tinkerforge/brick_hat_zero.rb +56 -22
  5. data/lib/tinkerforge/brick_imu.rb +184 -77
  6. data/lib/tinkerforge/brick_imu_v2.rb +208 -105
  7. data/lib/tinkerforge/brick_master.rb +484 -182
  8. data/lib/tinkerforge/brick_red.rb +197 -74
  9. data/lib/tinkerforge/brick_servo.rb +185 -101
  10. data/lib/tinkerforge/brick_silent_stepper.rb +246 -166
  11. data/lib/tinkerforge/brick_stepper.rb +210 -98
  12. data/lib/tinkerforge/bricklet_accelerometer.rb +58 -23
  13. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +105 -54
  14. data/lib/tinkerforge/bricklet_air_quality.rb +117 -59
  15. data/lib/tinkerforge/bricklet_ambient_light.rb +51 -21
  16. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +40 -22
  17. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +61 -25
  18. data/lib/tinkerforge/bricklet_analog_in.rb +63 -25
  19. data/lib/tinkerforge/bricklet_analog_in_v2.rb +57 -23
  20. data/lib/tinkerforge/bricklet_analog_in_v3.rb +67 -25
  21. data/lib/tinkerforge/bricklet_analog_out.rb +23 -9
  22. data/lib/tinkerforge/bricklet_analog_out_v2.rb +20 -8
  23. data/lib/tinkerforge/bricklet_analog_out_v3.rb +54 -20
  24. data/lib/tinkerforge/bricklet_barometer.rb +66 -26
  25. data/lib/tinkerforge/bricklet_barometer_v2.rb +99 -37
  26. data/lib/tinkerforge/bricklet_can.rb +83 -18
  27. data/lib/tinkerforge/bricklet_can_v2.rb +172 -38
  28. data/lib/tinkerforge/bricklet_co2.rb +34 -14
  29. data/lib/tinkerforge/bricklet_co2_v2.rb +97 -37
  30. data/lib/tinkerforge/bricklet_color.rb +69 -27
  31. data/lib/tinkerforge/bricklet_color_v2.rb +87 -33
  32. data/lib/tinkerforge/bricklet_compass.rb +78 -30
  33. data/lib/tinkerforge/bricklet_current12.rb +58 -24
  34. data/lib/tinkerforge/bricklet_current25.rb +58 -24
  35. data/lib/tinkerforge/bricklet_distance_ir.rb +57 -23
  36. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +83 -31
  37. data/lib/tinkerforge/bricklet_distance_us.rb +40 -16
  38. data/lib/tinkerforge/bricklet_distance_us_v2.rb +67 -25
  39. data/lib/tinkerforge/bricklet_dmx.rb +88 -34
  40. data/lib/tinkerforge/bricklet_dual_button.rb +24 -10
  41. data/lib/tinkerforge/bricklet_dual_button_v2.rb +64 -24
  42. data/lib/tinkerforge/bricklet_dual_relay.rb +27 -11
  43. data/lib/tinkerforge/bricklet_dust_detector.rb +40 -16
  44. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +88 -32
  45. data/lib/tinkerforge/bricklet_energy_monitor.rb +73 -27
  46. data/lib/tinkerforge/bricklet_gps.rb +64 -26
  47. data/lib/tinkerforge/bricklet_gps_v2.rb +117 -47
  48. data/lib/tinkerforge/bricklet_hall_effect.rb +43 -23
  49. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +71 -27
  50. data/lib/tinkerforge/bricklet_humidity.rb +51 -21
  51. data/lib/tinkerforge/bricklet_humidity_v2.rb +83 -31
  52. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +38 -14
  53. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +81 -29
  54. data/lib/tinkerforge/bricklet_industrial_counter.rb +101 -39
  55. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +45 -17
  56. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +77 -29
  57. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +36 -14
  58. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +73 -27
  59. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +40 -16
  60. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +79 -29
  61. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +49 -19
  62. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +82 -30
  63. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +61 -23
  64. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +36 -14
  65. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +67 -25
  66. data/lib/tinkerforge/bricklet_io16.rb +55 -21
  67. data/lib/tinkerforge/bricklet_io16_v2.rb +90 -34
  68. data/lib/tinkerforge/bricklet_io4.rb +55 -23
  69. data/lib/tinkerforge/bricklet_io4_v2.rb +96 -36
  70. data/lib/tinkerforge/bricklet_isolator.rb +72 -28
  71. data/lib/tinkerforge/bricklet_joystick.rb +59 -25
  72. data/lib/tinkerforge/bricklet_joystick_v2.rb +68 -26
  73. data/lib/tinkerforge/bricklet_laser_range_finder.rb +82 -32
  74. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +96 -36
  75. data/lib/tinkerforge/bricklet_lcd_128x64.rb +192 -70
  76. data/lib/tinkerforge/bricklet_lcd_16x2.rb +45 -18
  77. data/lib/tinkerforge/bricklet_lcd_20x4.rb +58 -23
  78. data/lib/tinkerforge/bricklet_led_strip.rb +60 -22
  79. data/lib/tinkerforge/bricklet_led_strip_v2.rb +91 -46
  80. data/lib/tinkerforge/bricklet_line.rb +34 -14
  81. data/lib/tinkerforge/bricklet_linear_poti.rb +51 -21
  82. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +55 -21
  83. data/lib/tinkerforge/bricklet_load_cell.rb +61 -23
  84. data/lib/tinkerforge/bricklet_load_cell_v2.rb +80 -30
  85. data/lib/tinkerforge/bricklet_moisture.rb +40 -16
  86. data/lib/tinkerforge/bricklet_motion_detector.rb +22 -10
  87. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +62 -24
  88. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +71 -27
  89. data/lib/tinkerforge/bricklet_multi_touch.rb +31 -13
  90. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +76 -28
  91. data/lib/tinkerforge/bricklet_nfc.rb +123 -58
  92. data/lib/tinkerforge/bricklet_nfc_rfid.rb +33 -13
  93. data/lib/tinkerforge/bricklet_oled_128x64.rb +29 -11
  94. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +66 -24
  95. data/lib/tinkerforge/bricklet_oled_64x48.rb +29 -11
  96. data/lib/tinkerforge/bricklet_one_wire.rb +66 -24
  97. data/lib/tinkerforge/bricklet_outdoor_weather.rb +71 -27
  98. data/lib/tinkerforge/bricklet_particulate_matter.rb +75 -30
  99. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +19 -9
  100. data/lib/tinkerforge/bricklet_piezo_speaker.rb +22 -10
  101. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +80 -42
  102. data/lib/tinkerforge/bricklet_ptc.rb +74 -42
  103. data/lib/tinkerforge/bricklet_ptc_v2.rb +95 -48
  104. data/lib/tinkerforge/bricklet_real_time_clock.rb +45 -33
  105. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +78 -44
  106. data/lib/tinkerforge/bricklet_remote_switch.rb +39 -29
  107. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +87 -49
  108. data/lib/tinkerforge/bricklet_rgb_led.rb +18 -8
  109. data/lib/tinkerforge/bricklet_rgb_led_button.rb +62 -30
  110. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +79 -33
  111. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +52 -20
  112. data/lib/tinkerforge/bricklet_rotary_encoder.rb +39 -19
  113. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +60 -24
  114. data/lib/tinkerforge/bricklet_rotary_poti.rb +53 -28
  115. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +57 -23
  116. data/lib/tinkerforge/bricklet_rs232.rb +90 -28
  117. data/lib/tinkerforge/bricklet_rs232_v2.rb +118 -44
  118. data/lib/tinkerforge/bricklet_rs485.rb +223 -95
  119. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +25 -14
  120. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +75 -35
  121. data/lib/tinkerforge/bricklet_solid_state_relay.rb +25 -13
  122. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +59 -25
  123. data/lib/tinkerforge/bricklet_sound_intensity.rb +35 -18
  124. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +72 -31
  125. data/lib/tinkerforge/bricklet_temperature.rb +40 -16
  126. data/lib/tinkerforge/bricklet_temperature_ir.rb +57 -23
  127. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +71 -27
  128. data/lib/tinkerforge/bricklet_temperature_v2.rb +61 -25
  129. data/lib/tinkerforge/bricklet_thermal_imaging.rb +105 -44
  130. data/lib/tinkerforge/bricklet_thermocouple.rb +45 -24
  131. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +65 -27
  132. data/lib/tinkerforge/bricklet_tilt.rb +24 -10
  133. data/lib/tinkerforge/bricklet_uv_light.rb +36 -18
  134. data/lib/tinkerforge/bricklet_uv_light_v2.rb +85 -37
  135. data/lib/tinkerforge/bricklet_voltage.rb +52 -28
  136. data/lib/tinkerforge/bricklet_voltage_current.rb +91 -73
  137. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +90 -68
  138. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +80 -30
  139. data/lib/tinkerforge/device_display_names.rb +163 -0
  140. data/lib/tinkerforge/ip_connection.rb +151 -32
  141. data/lib/tinkerforge/version.rb +1 -1
  142. metadata +3 -2
@@ -1,14 +1,16 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-11-25. #
3
+ # This file was automatically generated on 2020-04-07. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.24 #
5
+ # Ruby Bindings Version 2.1.25 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
9
9
  # to the generators git repository on tinkerforge.com #
10
10
  #############################################################
11
11
 
12
+ require_relative './ip_connection'
13
+
12
14
  module Tinkerforge
13
15
  # 2-axis joystick with push-button
14
16
  class BrickletJoystick < Device
@@ -78,7 +80,7 @@ module Tinkerforge
78
80
  # Creates an object with the unique device ID <tt>uid</tt> and adds it to
79
81
  # the IP Connection <tt>ipcon</tt>.
80
82
  def initialize(uid, ipcon)
81
- super uid, ipcon
83
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
82
84
 
83
85
  @api_version = [2, 0, 0]
84
86
 
@@ -98,13 +100,14 @@ module Tinkerforge
98
100
  @response_expected[FUNCTION_GET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
99
101
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
100
102
 
101
- @callback_formats[CALLBACK_POSITION] = 's s'
102
- @callback_formats[CALLBACK_ANALOG_VALUE] = 'S S'
103
- @callback_formats[CALLBACK_POSITION_REACHED] = 's s'
104
- @callback_formats[CALLBACK_ANALOG_VALUE_REACHED] = 'S S'
105
- @callback_formats[CALLBACK_PRESSED] = ''
106
- @callback_formats[CALLBACK_RELEASED] = ''
103
+ @callback_formats[CALLBACK_POSITION] = [12, 's s']
104
+ @callback_formats[CALLBACK_ANALOG_VALUE] = [12, 'S S']
105
+ @callback_formats[CALLBACK_POSITION_REACHED] = [12, 's s']
106
+ @callback_formats[CALLBACK_ANALOG_VALUE_REACHED] = [12, 'S S']
107
+ @callback_formats[CALLBACK_PRESSED] = [8, '']
108
+ @callback_formats[CALLBACK_RELEASED] = [8, '']
107
109
 
110
+ @ipcon.add_device self
108
111
  end
109
112
 
110
113
  # Returns the position of the joystick. The middle position of the joystick is x=0, y=0.
@@ -114,7 +117,9 @@ module Tinkerforge
114
117
  # CALLBACK_POSITION callback and set the period with
115
118
  # BrickletJoystick#set_position_callback_period.
116
119
  def get_position
117
- send_request FUNCTION_GET_POSITION, [], '', 4, 's s'
120
+ check_validity
121
+
122
+ send_request FUNCTION_GET_POSITION, [], '', 12, 's s'
118
123
  end
119
124
 
120
125
  # Returns *true* if the button is pressed and *false* otherwise.
@@ -122,7 +127,9 @@ module Tinkerforge
122
127
  # It is recommended to use the CALLBACK_PRESSED and CALLBACK_RELEASED callbacks
123
128
  # to handle the button.
124
129
  def is_pressed
125
- send_request FUNCTION_IS_PRESSED, [], '', 1, '?'
130
+ check_validity
131
+
132
+ send_request FUNCTION_IS_PRESSED, [], '', 9, '?'
126
133
  end
127
134
 
128
135
  # Returns the values as read by a 12-bit analog-to-digital converter.
@@ -137,7 +144,9 @@ module Tinkerforge
137
144
  # CALLBACK_ANALOG_VALUE callback and set the period with
138
145
  # BrickletJoystick#set_analog_value_callback_period.
139
146
  def get_analog_value
140
- send_request FUNCTION_GET_ANALOG_VALUE, [], '', 4, 'S S'
147
+ check_validity
148
+
149
+ send_request FUNCTION_GET_ANALOG_VALUE, [], '', 12, 'S S'
141
150
  end
142
151
 
143
152
  # Calibrates the middle position of the joystick. If your Joystick Bricklet
@@ -147,7 +156,9 @@ module Tinkerforge
147
156
  # The resulting calibration will be saved on the EEPROM of the Joystick
148
157
  # Bricklet, thus you only have to calibrate it once.
149
158
  def calibrate
150
- send_request FUNCTION_CALIBRATE, [], '', 0, ''
159
+ check_validity
160
+
161
+ send_request FUNCTION_CALIBRATE, [], '', 8, ''
151
162
  end
152
163
 
153
164
  # Sets the period with which the CALLBACK_POSITION callback is triggered
@@ -156,12 +167,16 @@ module Tinkerforge
156
167
  # The CALLBACK_POSITION callback is only triggered if the position has changed since the
157
168
  # last triggering.
158
169
  def set_position_callback_period(period)
159
- send_request FUNCTION_SET_POSITION_CALLBACK_PERIOD, [period], 'L', 0, ''
170
+ check_validity
171
+
172
+ send_request FUNCTION_SET_POSITION_CALLBACK_PERIOD, [period], 'L', 8, ''
160
173
  end
161
174
 
162
175
  # Returns the period as set by BrickletJoystick#set_position_callback_period.
163
176
  def get_position_callback_period
164
- send_request FUNCTION_GET_POSITION_CALLBACK_PERIOD, [], '', 4, 'L'
177
+ check_validity
178
+
179
+ send_request FUNCTION_GET_POSITION_CALLBACK_PERIOD, [], '', 12, 'L'
165
180
  end
166
181
 
167
182
  # Sets the period with which the CALLBACK_ANALOG_VALUE callback is triggered
@@ -170,12 +185,16 @@ module Tinkerforge
170
185
  # The CALLBACK_ANALOG_VALUE callback is only triggered if the analog values have
171
186
  # changed since the last triggering.
172
187
  def set_analog_value_callback_period(period)
173
- send_request FUNCTION_SET_ANALOG_VALUE_CALLBACK_PERIOD, [period], 'L', 0, ''
188
+ check_validity
189
+
190
+ send_request FUNCTION_SET_ANALOG_VALUE_CALLBACK_PERIOD, [period], 'L', 8, ''
174
191
  end
175
192
 
176
193
  # Returns the period as set by BrickletJoystick#set_analog_value_callback_period.
177
194
  def get_analog_value_callback_period
178
- send_request FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 4, 'L'
195
+ check_validity
196
+
197
+ send_request FUNCTION_GET_ANALOG_VALUE_CALLBACK_PERIOD, [], '', 12, 'L'
179
198
  end
180
199
 
181
200
  # Sets the thresholds for the CALLBACK_POSITION_REACHED callback.
@@ -190,12 +209,16 @@ module Tinkerforge
190
209
  # "'<'", "Callback is triggered when the position is smaller than the min values (max is ignored)"
191
210
  # "'>'", "Callback is triggered when the position is greater than the min values (max is ignored)"
192
211
  def set_position_callback_threshold(option, min_x, max_x, min_y, max_y)
193
- send_request FUNCTION_SET_POSITION_CALLBACK_THRESHOLD, [option, min_x, max_x, min_y, max_y], 'k s s s s', 0, ''
212
+ check_validity
213
+
214
+ send_request FUNCTION_SET_POSITION_CALLBACK_THRESHOLD, [option, min_x, max_x, min_y, max_y], 'k s s s s', 8, ''
194
215
  end
195
216
 
196
217
  # Returns the threshold as set by BrickletJoystick#set_position_callback_threshold.
197
218
  def get_position_callback_threshold
198
- send_request FUNCTION_GET_POSITION_CALLBACK_THRESHOLD, [], '', 9, 'k s s s s'
219
+ check_validity
220
+
221
+ send_request FUNCTION_GET_POSITION_CALLBACK_THRESHOLD, [], '', 17, 'k s s s s'
199
222
  end
200
223
 
201
224
  # Sets the thresholds for the CALLBACK_ANALOG_VALUE_REACHED callback.
@@ -210,12 +233,16 @@ module Tinkerforge
210
233
  # "'<'", "Callback is triggered when the analog values are smaller than the min values (max is ignored)"
211
234
  # "'>'", "Callback is triggered when the analog values are greater than the min values (max is ignored)"
212
235
  def set_analog_value_callback_threshold(option, min_x, max_x, min_y, max_y)
213
- send_request FUNCTION_SET_ANALOG_VALUE_CALLBACK_THRESHOLD, [option, min_x, max_x, min_y, max_y], 'k S S S S', 0, ''
236
+ check_validity
237
+
238
+ send_request FUNCTION_SET_ANALOG_VALUE_CALLBACK_THRESHOLD, [option, min_x, max_x, min_y, max_y], 'k S S S S', 8, ''
214
239
  end
215
240
 
216
241
  # Returns the threshold as set by BrickletJoystick#set_analog_value_callback_threshold.
217
242
  def get_analog_value_callback_threshold
218
- send_request FUNCTION_GET_ANALOG_VALUE_CALLBACK_THRESHOLD, [], '', 9, 'k S S S S'
243
+ check_validity
244
+
245
+ send_request FUNCTION_GET_ANALOG_VALUE_CALLBACK_THRESHOLD, [], '', 17, 'k S S S S'
219
246
  end
220
247
 
221
248
  # Sets the period with which the threshold callbacks
@@ -230,24 +257,31 @@ module Tinkerforge
230
257
  #
231
258
  # keep being reached.
232
259
  def set_debounce_period(debounce)
233
- send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
260
+ check_validity
261
+
262
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 8, ''
234
263
  end
235
264
 
236
265
  # Returns the debounce period as set by BrickletJoystick#set_debounce_period.
237
266
  def get_debounce_period
238
- send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
267
+ check_validity
268
+
269
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 12, 'L'
239
270
  end
240
271
 
241
272
  # Returns the UID, the UID where the Bricklet is connected to,
242
273
  # the position, the hardware and firmware version as well as the
243
274
  # device identifier.
244
275
  #
245
- # The position can be 'a', 'b', 'c' or 'd'.
276
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
277
+ # The Raspberry Pi HAT (Zero) Brick is always at position 'i' and the Bricklet
278
+ # connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
279
+ # position 'z'.
246
280
  #
247
281
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
248
282
  # |device_identifier_constant|
249
283
  def get_identity
250
- send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
284
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
251
285
  end
252
286
 
253
287
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,14 +1,16 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-11-25. #
3
+ # This file was automatically generated on 2020-04-07. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.24 #
5
+ # Ruby Bindings Version 2.1.25 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
9
9
  # to the generators git repository on tinkerforge.com #
10
10
  #############################################################
11
11
 
12
+ require_relative './ip_connection'
13
+
12
14
  module Tinkerforge
13
15
  # 2-axis joystick with push-button
14
16
  class BrickletJoystickV2 < Device
@@ -66,7 +68,7 @@ module Tinkerforge
66
68
  # Creates an object with the unique device ID <tt>uid</tt> and adds it to
67
69
  # the IP Connection <tt>ipcon</tt>.
68
70
  def initialize(uid, ipcon)
69
- super uid, ipcon
71
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
70
72
 
71
73
  @api_version = [2, 0, 0]
72
74
 
@@ -90,9 +92,10 @@ module Tinkerforge
90
92
  @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
91
93
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
92
94
 
93
- @callback_formats[CALLBACK_POSITION] = 's s'
94
- @callback_formats[CALLBACK_PRESSED] = '?'
95
+ @callback_formats[CALLBACK_POSITION] = [12, 's s']
96
+ @callback_formats[CALLBACK_PRESSED] = [9, '?']
95
97
 
98
+ @ipcon.add_device self
96
99
  end
97
100
 
98
101
  # Returns the position of the joystick. The middle position of the joystick is x=0, y=0.
@@ -102,7 +105,9 @@ module Tinkerforge
102
105
  # CALLBACK_POSITION callback and set the period with
103
106
  # BrickletJoystickV2#set_position_callback_configuration.
104
107
  def get_position
105
- send_request FUNCTION_GET_POSITION, [], '', 4, 's s'
108
+ check_validity
109
+
110
+ send_request FUNCTION_GET_POSITION, [], '', 12, 's s'
106
111
  end
107
112
 
108
113
  # Returns *true* if the button is pressed and *false* otherwise.
@@ -111,7 +116,9 @@ module Tinkerforge
111
116
  # CALLBACK_PRESSED callback and set the period with
112
117
  # BrickletJoystickV2#set_pressed_callback_configuration.
113
118
  def is_pressed
114
- send_request FUNCTION_IS_PRESSED, [], '', 1, '?'
119
+ check_validity
120
+
121
+ send_request FUNCTION_IS_PRESSED, [], '', 9, '?'
115
122
  end
116
123
 
117
124
  # Calibrates the middle position of the joystick. If your Joystick Bricklet 2.0
@@ -121,7 +128,9 @@ module Tinkerforge
121
128
  # The resulting calibration will be saved in non-volatile memory,
122
129
  # thus you only have to calibrate it once.
123
130
  def calibrate
124
- send_request FUNCTION_CALIBRATE, [], '', 0, ''
131
+ check_validity
132
+
133
+ send_request FUNCTION_CALIBRATE, [], '', 8, ''
125
134
  end
126
135
 
127
136
  # The period is the period with which the CALLBACK_POSITION
@@ -134,13 +143,17 @@ module Tinkerforge
134
143
  # If it is set to false, the callback is continuously triggered with the period,
135
144
  # independent of the value.
136
145
  def set_position_callback_configuration(period, value_has_to_change)
137
- send_request FUNCTION_SET_POSITION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 0, ''
146
+ check_validity
147
+
148
+ send_request FUNCTION_SET_POSITION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
138
149
  end
139
150
 
140
151
  # Returns the callback configuration as set by
141
152
  # BrickletJoystickV2#set_position_callback_configuration.
142
153
  def get_position_callback_configuration
143
- send_request FUNCTION_GET_POSITION_CALLBACK_CONFIGURATION, [], '', 5, 'L ?'
154
+ check_validity
155
+
156
+ send_request FUNCTION_GET_POSITION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
144
157
  end
145
158
 
146
159
  # The period is the period with which the CALLBACK_PRESSED
@@ -153,13 +166,17 @@ module Tinkerforge
153
166
  # If it is set to false, the callback is continuously triggered with the period,
154
167
  # independent of the value.
155
168
  def set_pressed_callback_configuration(period, value_has_to_change)
156
- send_request FUNCTION_SET_PRESSED_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 0, ''
169
+ check_validity
170
+
171
+ send_request FUNCTION_SET_PRESSED_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
157
172
  end
158
173
 
159
174
  # Returns the callback configuration as set by
160
175
  # BrickletJoystickV2#set_pressed_callback_configuration.
161
176
  def get_pressed_callback_configuration
162
- send_request FUNCTION_GET_PRESSED_CALLBACK_CONFIGURATION, [], '', 5, 'L ?'
177
+ check_validity
178
+
179
+ send_request FUNCTION_GET_PRESSED_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
163
180
  end
164
181
 
165
182
  # Returns the error count for the communication between Brick and Bricklet.
@@ -174,7 +191,9 @@ module Tinkerforge
174
191
  # The errors counts are for errors that occur on the Bricklet side. All
175
192
  # Bricks have a similar function that returns the errors on the Brick side.
176
193
  def get_spitfp_error_count
177
- send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
194
+ check_validity
195
+
196
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
178
197
  end
179
198
 
180
199
  # Sets the bootloader mode and returns the status after the requested
@@ -187,12 +206,16 @@ module Tinkerforge
187
206
  # This function is used by Brick Viewer during flashing. It should not be
188
207
  # necessary to call it in a normal user program.
189
208
  def set_bootloader_mode(mode)
190
- send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
209
+ check_validity
210
+
211
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
191
212
  end
192
213
 
193
214
  # Returns the current bootloader mode, see BrickletJoystickV2#set_bootloader_mode.
194
215
  def get_bootloader_mode
195
- send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
216
+ check_validity
217
+
218
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
196
219
  end
197
220
 
198
221
  # Sets the firmware pointer for BrickletJoystickV2#write_firmware. The pointer has
@@ -202,7 +225,9 @@ module Tinkerforge
202
225
  # This function is used by Brick Viewer during flashing. It should not be
203
226
  # necessary to call it in a normal user program.
204
227
  def set_write_firmware_pointer(pointer)
205
- send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
228
+ check_validity
229
+
230
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
206
231
  end
207
232
 
208
233
  # Writes 64 Bytes of firmware at the position as written by
@@ -214,7 +239,9 @@ module Tinkerforge
214
239
  # This function is used by Brick Viewer during flashing. It should not be
215
240
  # necessary to call it in a normal user program.
216
241
  def write_firmware(data)
217
- send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
242
+ check_validity
243
+
244
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
218
245
  end
219
246
 
220
247
  # Sets the status LED configuration. By default the LED shows
@@ -225,22 +252,28 @@ module Tinkerforge
225
252
  #
226
253
  # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
227
254
  def set_status_led_config(config)
228
- send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
255
+ check_validity
256
+
257
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
229
258
  end
230
259
 
231
260
  # Returns the configuration as set by BrickletJoystickV2#set_status_led_config
232
261
  def get_status_led_config
233
- send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
262
+ check_validity
263
+
264
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
234
265
  end
235
266
 
236
- # Returns the temperature in °C as measured inside the microcontroller. The
267
+ # Returns the temperature as measured inside the microcontroller. The
237
268
  # value returned is not the ambient temperature!
238
269
  #
239
270
  # The temperature is only proportional to the real temperature and it has bad
240
271
  # accuracy. Practically it is only useful as an indicator for
241
272
  # temperature changes.
242
273
  def get_chip_temperature
243
- send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
274
+ check_validity
275
+
276
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
244
277
  end
245
278
 
246
279
  # Calling this function will reset the Bricklet. All configurations
@@ -250,7 +283,9 @@ module Tinkerforge
250
283
  # calling functions on the existing ones will result in
251
284
  # undefined behavior!
252
285
  def reset
253
- send_request FUNCTION_RESET, [], '', 0, ''
286
+ check_validity
287
+
288
+ send_request FUNCTION_RESET, [], '', 8, ''
254
289
  end
255
290
 
256
291
  # Writes a new UID into flash. If you want to set a new UID
@@ -259,25 +294,32 @@ module Tinkerforge
259
294
  #
260
295
  # We recommend that you use Brick Viewer to change the UID.
261
296
  def write_uid(uid)
262
- send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
297
+ check_validity
298
+
299
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
263
300
  end
264
301
 
265
302
  # Returns the current UID as an integer. Encode as
266
303
  # Base58 to get the usual string version.
267
304
  def read_uid
268
- send_request FUNCTION_READ_UID, [], '', 4, 'L'
305
+ check_validity
306
+
307
+ send_request FUNCTION_READ_UID, [], '', 12, 'L'
269
308
  end
270
309
 
271
310
  # Returns the UID, the UID where the Bricklet is connected to,
272
311
  # the position, the hardware and firmware version as well as the
273
312
  # device identifier.
274
313
  #
275
- # The position can be 'a', 'b', 'c' or 'd'.
314
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
315
+ # The Raspberry Pi HAT (Zero) Brick is always at position 'i' and the Bricklet
316
+ # connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
317
+ # position 'z'.
276
318
  #
277
319
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
278
320
  # |device_identifier_constant|
279
321
  def get_identity
280
- send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
322
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
281
323
  end
282
324
 
283
325
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,14 +1,16 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-11-25. #
3
+ # This file was automatically generated on 2020-04-07. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.24 #
5
+ # Ruby Bindings Version 2.1.25 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
9
9
  # to the generators git repository on tinkerforge.com #
10
10
  #############################################################
11
11
 
12
+ require_relative './ip_connection'
13
+
12
14
  module Tinkerforge
13
15
  # Measures distance up to 40m with laser light
14
16
  class BrickletLaserRangeFinder < Device
@@ -87,7 +89,7 @@ module Tinkerforge
87
89
  # Creates an object with the unique device ID <tt>uid</tt> and adds it to
88
90
  # the IP Connection <tt>ipcon</tt>.
89
91
  def initialize(uid, ipcon)
90
- super uid, ipcon
92
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
91
93
 
92
94
  @api_version = [2, 0, 1]
93
95
 
@@ -115,11 +117,12 @@ module Tinkerforge
115
117
  @response_expected[FUNCTION_GET_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
116
118
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
117
119
 
118
- @callback_formats[CALLBACK_DISTANCE] = 'S'
119
- @callback_formats[CALLBACK_VELOCITY] = 's'
120
- @callback_formats[CALLBACK_DISTANCE_REACHED] = 'S'
121
- @callback_formats[CALLBACK_VELOCITY_REACHED] = 's'
120
+ @callback_formats[CALLBACK_DISTANCE] = [10, 'S']
121
+ @callback_formats[CALLBACK_VELOCITY] = [10, 's']
122
+ @callback_formats[CALLBACK_DISTANCE_REACHED] = [10, 'S']
123
+ @callback_formats[CALLBACK_VELOCITY_REACHED] = [10, 's']
122
124
 
125
+ @ipcon.add_device self
123
126
  end
124
127
 
125
128
  # Returns the measured distance.
@@ -134,7 +137,9 @@ module Tinkerforge
134
137
  # use the CALLBACK_DISTANCE callback and set the period with
135
138
  # BrickletLaserRangeFinder#set_distance_callback_period.
136
139
  def get_distance
137
- send_request FUNCTION_GET_DISTANCE, [], '', 2, 'S'
140
+ check_validity
141
+
142
+ send_request FUNCTION_GET_DISTANCE, [], '', 10, 'S'
138
143
  end
139
144
 
140
145
  # Returns the measured velocity.
@@ -151,7 +156,9 @@ module Tinkerforge
151
156
  # use the CALLBACK_VELOCITY callback and set the period with
152
157
  # BrickletLaserRangeFinder#set_velocity_callback_period.
153
158
  def get_velocity
154
- send_request FUNCTION_GET_VELOCITY, [], '', 2, 's'
159
+ check_validity
160
+
161
+ send_request FUNCTION_GET_VELOCITY, [], '', 10, 's'
155
162
  end
156
163
 
157
164
  # Sets the period with which the CALLBACK_DISTANCE callback is triggered
@@ -160,12 +167,16 @@ module Tinkerforge
160
167
  # The CALLBACK_DISTANCE callback is only triggered if the distance value has
161
168
  # changed since the last triggering.
162
169
  def set_distance_callback_period(period)
163
- send_request FUNCTION_SET_DISTANCE_CALLBACK_PERIOD, [period], 'L', 0, ''
170
+ check_validity
171
+
172
+ send_request FUNCTION_SET_DISTANCE_CALLBACK_PERIOD, [period], 'L', 8, ''
164
173
  end
165
174
 
166
175
  # Returns the period as set by BrickletLaserRangeFinder#set_distance_callback_period.
167
176
  def get_distance_callback_period
168
- send_request FUNCTION_GET_DISTANCE_CALLBACK_PERIOD, [], '', 4, 'L'
177
+ check_validity
178
+
179
+ send_request FUNCTION_GET_DISTANCE_CALLBACK_PERIOD, [], '', 12, 'L'
169
180
  end
170
181
 
171
182
  # Sets the period with which the CALLBACK_VELOCITY callback is triggered
@@ -174,12 +185,16 @@ module Tinkerforge
174
185
  # The CALLBACK_VELOCITY callback is only triggered if the velocity value has
175
186
  # changed since the last triggering.
176
187
  def set_velocity_callback_period(period)
177
- send_request FUNCTION_SET_VELOCITY_CALLBACK_PERIOD, [period], 'L', 0, ''
188
+ check_validity
189
+
190
+ send_request FUNCTION_SET_VELOCITY_CALLBACK_PERIOD, [period], 'L', 8, ''
178
191
  end
179
192
 
180
193
  # Returns the period as set by BrickletLaserRangeFinder#set_velocity_callback_period.
181
194
  def get_velocity_callback_period
182
- send_request FUNCTION_GET_VELOCITY_CALLBACK_PERIOD, [], '', 4, 'L'
195
+ check_validity
196
+
197
+ send_request FUNCTION_GET_VELOCITY_CALLBACK_PERIOD, [], '', 12, 'L'
183
198
  end
184
199
 
185
200
  # Sets the thresholds for the CALLBACK_DISTANCE_REACHED callback.
@@ -194,12 +209,16 @@ module Tinkerforge
194
209
  # "'<'", "Callback is triggered when the distance value is smaller than the min value (max is ignored)"
195
210
  # "'>'", "Callback is triggered when the distance value is greater than the min value (max is ignored)"
196
211
  def set_distance_callback_threshold(option, min, max)
197
- send_request FUNCTION_SET_DISTANCE_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, ''
212
+ check_validity
213
+
214
+ send_request FUNCTION_SET_DISTANCE_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 8, ''
198
215
  end
199
216
 
200
217
  # Returns the threshold as set by BrickletLaserRangeFinder#set_distance_callback_threshold.
201
218
  def get_distance_callback_threshold
202
- send_request FUNCTION_GET_DISTANCE_CALLBACK_THRESHOLD, [], '', 5, 'k S S'
219
+ check_validity
220
+
221
+ send_request FUNCTION_GET_DISTANCE_CALLBACK_THRESHOLD, [], '', 13, 'k S S'
203
222
  end
204
223
 
205
224
  # Sets the thresholds for the CALLBACK_VELOCITY_REACHED callback.
@@ -214,12 +233,16 @@ module Tinkerforge
214
233
  # "'<'", "Callback is triggered when the velocity is smaller than the min value (max is ignored)"
215
234
  # "'>'", "Callback is triggered when the velocity is greater than the min value (max is ignored)"
216
235
  def set_velocity_callback_threshold(option, min, max)
217
- send_request FUNCTION_SET_VELOCITY_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, ''
236
+ check_validity
237
+
238
+ send_request FUNCTION_SET_VELOCITY_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 8, ''
218
239
  end
219
240
 
220
241
  # Returns the threshold as set by BrickletLaserRangeFinder#set_velocity_callback_threshold.
221
242
  def get_velocity_callback_threshold
222
- send_request FUNCTION_GET_VELOCITY_CALLBACK_THRESHOLD, [], '', 5, 'k s s'
243
+ check_validity
244
+
245
+ send_request FUNCTION_GET_VELOCITY_CALLBACK_THRESHOLD, [], '', 13, 'k s s'
223
246
  end
224
247
 
225
248
  # Sets the period with which the threshold callbacks
@@ -234,12 +257,16 @@ module Tinkerforge
234
257
  #
235
258
  # keep being reached.
236
259
  def set_debounce_period(debounce)
237
- send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
260
+ check_validity
261
+
262
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 8, ''
238
263
  end
239
264
 
240
265
  # Returns the debounce period as set by BrickletLaserRangeFinder#set_debounce_period.
241
266
  def get_debounce_period
242
- send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
267
+ check_validity
268
+
269
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 12, 'L'
243
270
  end
244
271
 
245
272
  # Sets the length of a `moving averaging <https://en.wikipedia.org/wiki/Moving_average>`__
@@ -248,12 +275,16 @@ module Tinkerforge
248
275
  # Setting the length to 0 will turn the averaging completely off. With less
249
276
  # averaging, there is more noise on the data.
250
277
  def set_moving_average(distance_average_length, velocity_average_length)
251
- send_request FUNCTION_SET_MOVING_AVERAGE, [distance_average_length, velocity_average_length], 'C C', 0, ''
278
+ check_validity
279
+
280
+ send_request FUNCTION_SET_MOVING_AVERAGE, [distance_average_length, velocity_average_length], 'C C', 8, ''
252
281
  end
253
282
 
254
283
  # Returns the length moving average as set by BrickletLaserRangeFinder#set_moving_average.
255
284
  def get_moving_average
256
- send_request FUNCTION_GET_MOVING_AVERAGE, [], '', 2, 'C C'
285
+ check_validity
286
+
287
+ send_request FUNCTION_GET_MOVING_AVERAGE, [], '', 10, 'C C'
257
288
  end
258
289
 
259
290
  # .. note::
@@ -273,12 +304,16 @@ module Tinkerforge
273
304
  # * 3: Velocity is measured with resolution 0.5 m/s and range is 0-63.5 m/s
274
305
  # * 4: Velocity is measured with resolution 1.0 m/s and range is 0-127 m/s
275
306
  def set_mode(mode)
276
- send_request FUNCTION_SET_MODE, [mode], 'C', 0, ''
307
+ check_validity
308
+
309
+ send_request FUNCTION_SET_MODE, [mode], 'C', 8, ''
277
310
  end
278
311
 
279
312
  # Returns the mode as set by BrickletLaserRangeFinder#set_mode.
280
313
  def get_mode
281
- send_request FUNCTION_GET_MODE, [], '', 1, 'C'
314
+ check_validity
315
+
316
+ send_request FUNCTION_GET_MODE, [], '', 9, 'C'
282
317
  end
283
318
 
284
319
  # Activates the laser of the LIDAR.
@@ -286,24 +321,32 @@ module Tinkerforge
286
321
  # We recommend that you wait 250ms after enabling the laser before
287
322
  # the first call of BrickletLaserRangeFinder#get_distance to ensure stable measurements.
288
323
  def enable_laser
289
- send_request FUNCTION_ENABLE_LASER, [], '', 0, ''
324
+ check_validity
325
+
326
+ send_request FUNCTION_ENABLE_LASER, [], '', 8, ''
290
327
  end
291
328
 
292
329
  # Deactivates the laser of the LIDAR.
293
330
  def disable_laser
294
- send_request FUNCTION_DISABLE_LASER, [], '', 0, ''
331
+ check_validity
332
+
333
+ send_request FUNCTION_DISABLE_LASER, [], '', 8, ''
295
334
  end
296
335
 
297
336
  # Returns *true* if the laser is enabled, *false* otherwise.
298
337
  def is_laser_enabled
299
- send_request FUNCTION_IS_LASER_ENABLED, [], '', 1, '?'
338
+ check_validity
339
+
340
+ send_request FUNCTION_IS_LASER_ENABLED, [], '', 9, '?'
300
341
  end
301
342
 
302
343
  # Returns the LIDAR-Lite hardware version.
303
344
  #
304
345
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
305
346
  def get_sensor_hardware_version
306
- send_request FUNCTION_GET_SENSOR_HARDWARE_VERSION, [], '', 1, 'C'
347
+ check_validity
348
+
349
+ send_request FUNCTION_GET_SENSOR_HARDWARE_VERSION, [], '', 9, 'C'
307
350
  end
308
351
 
309
352
  # .. note::
@@ -328,7 +371,7 @@ module Tinkerforge
328
371
  # the distance to something with a very high reflection (e.g. mirror). Set this to 0 to
329
372
  # use the default algorithm. The other allowed values are 1-255.
330
373
  #
331
- # Set the **Measurement Frequency** in Hz to force a fixed measurement rate. If set to 0,
374
+ # Set the **Measurement Frequency** to force a fixed measurement rate. If set to 0,
332
375
  # the Laser Range Finder Bricklet will use the optimal frequency according to the other
333
376
  # configurations and the actual measured distance. Since the rate is not fixed in this case,
334
377
  # the velocity measurement is not stable. For a stable velocity measurement you should
@@ -338,26 +381,33 @@ module Tinkerforge
338
381
  #
339
382
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
340
383
  def set_configuration(acquisition_count, enable_quick_termination, threshold_value, measurement_frequency)
341
- send_request FUNCTION_SET_CONFIGURATION, [acquisition_count, enable_quick_termination, threshold_value, measurement_frequency], 'C ? C S', 0, ''
384
+ check_validity
385
+
386
+ send_request FUNCTION_SET_CONFIGURATION, [acquisition_count, enable_quick_termination, threshold_value, measurement_frequency], 'C ? C S', 8, ''
342
387
  end
343
388
 
344
389
  # Returns the configuration as set by BrickletLaserRangeFinder#set_configuration.
345
390
  #
346
391
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
347
392
  def get_configuration
348
- send_request FUNCTION_GET_CONFIGURATION, [], '', 5, 'C ? C S'
393
+ check_validity
394
+
395
+ send_request FUNCTION_GET_CONFIGURATION, [], '', 13, 'C ? C S'
349
396
  end
350
397
 
351
398
  # Returns the UID, the UID where the Bricklet is connected to,
352
399
  # the position, the hardware and firmware version as well as the
353
400
  # device identifier.
354
401
  #
355
- # The position can be 'a', 'b', 'c' or 'd'.
402
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
403
+ # The Raspberry Pi HAT (Zero) Brick is always at position 'i' and the Bricklet
404
+ # connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always as
405
+ # position 'z'.
356
406
  #
357
407
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
358
408
  # |device_identifier_constant|
359
409
  def get_identity
360
- send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
410
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
361
411
  end
362
412
 
363
413
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.