tinkerforge 2.1.24 → 2.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +5 -5
  2. data/lib/tinkerforge/brick_dc.rb +156 -75
  3. data/lib/tinkerforge/brick_hat.rb +69 -31
  4. data/lib/tinkerforge/brick_hat_zero.rb +55 -23
  5. data/lib/tinkerforge/brick_imu.rb +185 -78
  6. data/lib/tinkerforge/brick_imu_v2.rb +209 -106
  7. data/lib/tinkerforge/brick_master.rb +491 -183
  8. data/lib/tinkerforge/brick_red.rb +197 -74
  9. data/lib/tinkerforge/brick_servo.rb +186 -102
  10. data/lib/tinkerforge/brick_silent_stepper.rb +247 -167
  11. data/lib/tinkerforge/brick_stepper.rb +211 -99
  12. data/lib/tinkerforge/bricklet_accelerometer.rb +57 -23
  13. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +104 -54
  14. data/lib/tinkerforge/bricklet_air_quality.rb +116 -59
  15. data/lib/tinkerforge/bricklet_ambient_light.rb +50 -21
  16. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +44 -24
  17. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +65 -27
  18. data/lib/tinkerforge/bricklet_analog_in.rb +62 -25
  19. data/lib/tinkerforge/bricklet_analog_in_v2.rb +56 -23
  20. data/lib/tinkerforge/bricklet_analog_in_v3.rb +66 -25
  21. data/lib/tinkerforge/bricklet_analog_out.rb +22 -9
  22. data/lib/tinkerforge/bricklet_analog_out_v2.rb +19 -8
  23. data/lib/tinkerforge/bricklet_analog_out_v3.rb +53 -20
  24. data/lib/tinkerforge/bricklet_barometer.rb +100 -27
  25. data/lib/tinkerforge/bricklet_barometer_v2.rb +98 -37
  26. data/lib/tinkerforge/bricklet_can.rb +83 -19
  27. data/lib/tinkerforge/bricklet_can_v2.rb +171 -38
  28. data/lib/tinkerforge/bricklet_co2.rb +33 -14
  29. data/lib/tinkerforge/bricklet_co2_v2.rb +97 -38
  30. data/lib/tinkerforge/bricklet_color.rb +68 -27
  31. data/lib/tinkerforge/bricklet_color_v2.rb +86 -33
  32. data/lib/tinkerforge/bricklet_compass.rb +77 -30
  33. data/lib/tinkerforge/bricklet_current12.rb +57 -24
  34. data/lib/tinkerforge/bricklet_current25.rb +57 -24
  35. data/lib/tinkerforge/bricklet_dc_v2.rb +521 -0
  36. data/lib/tinkerforge/bricklet_distance_ir.rb +56 -23
  37. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +82 -31
  38. data/lib/tinkerforge/bricklet_distance_us.rb +39 -16
  39. data/lib/tinkerforge/bricklet_distance_us_v2.rb +66 -25
  40. data/lib/tinkerforge/bricklet_dmx.rb +87 -34
  41. data/lib/tinkerforge/bricklet_dual_button.rb +23 -10
  42. data/lib/tinkerforge/bricklet_dual_button_v2.rb +63 -24
  43. data/lib/tinkerforge/bricklet_dual_relay.rb +26 -11
  44. data/lib/tinkerforge/bricklet_dust_detector.rb +39 -16
  45. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +87 -32
  46. data/lib/tinkerforge/bricklet_energy_monitor.rb +72 -27
  47. data/lib/tinkerforge/bricklet_gps.rb +63 -26
  48. data/lib/tinkerforge/bricklet_gps_v2.rb +116 -47
  49. data/lib/tinkerforge/bricklet_hall_effect.rb +42 -23
  50. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +70 -27
  51. data/lib/tinkerforge/bricklet_humidity.rb +50 -21
  52. data/lib/tinkerforge/bricklet_humidity_v2.rb +82 -31
  53. data/lib/tinkerforge/bricklet_imu_v3.rb +784 -0
  54. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +37 -14
  55. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +80 -29
  56. data/lib/tinkerforge/bricklet_industrial_counter.rb +100 -39
  57. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +44 -17
  58. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +76 -29
  59. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +35 -14
  60. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +72 -27
  61. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +39 -16
  62. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +79 -30
  63. data/lib/tinkerforge/bricklet_industrial_dual_ac_relay.rb +325 -0
  64. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +48 -19
  65. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +137 -31
  66. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +60 -23
  67. data/lib/tinkerforge/bricklet_industrial_ptc.rb +475 -0
  68. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +35 -14
  69. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +66 -25
  70. data/lib/tinkerforge/bricklet_io16.rb +54 -21
  71. data/lib/tinkerforge/bricklet_io16_v2.rb +89 -34
  72. data/lib/tinkerforge/bricklet_io4.rb +54 -23
  73. data/lib/tinkerforge/bricklet_io4_v2.rb +95 -36
  74. data/lib/tinkerforge/bricklet_isolator.rb +72 -29
  75. data/lib/tinkerforge/bricklet_joystick.rb +58 -25
  76. data/lib/tinkerforge/bricklet_joystick_v2.rb +67 -26
  77. data/lib/tinkerforge/bricklet_laser_range_finder.rb +81 -32
  78. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +95 -36
  79. data/lib/tinkerforge/bricklet_lcd_128x64.rb +191 -70
  80. data/lib/tinkerforge/bricklet_lcd_16x2.rb +44 -18
  81. data/lib/tinkerforge/bricklet_lcd_20x4.rb +57 -23
  82. data/lib/tinkerforge/bricklet_led_strip.rb +59 -22
  83. data/lib/tinkerforge/bricklet_led_strip_v2.rb +90 -46
  84. data/lib/tinkerforge/bricklet_line.rb +33 -14
  85. data/lib/tinkerforge/bricklet_linear_poti.rb +50 -21
  86. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +54 -21
  87. data/lib/tinkerforge/bricklet_load_cell.rb +60 -23
  88. data/lib/tinkerforge/bricklet_load_cell_v2.rb +79 -30
  89. data/lib/tinkerforge/bricklet_moisture.rb +39 -16
  90. data/lib/tinkerforge/bricklet_motion_detector.rb +21 -10
  91. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +61 -27
  92. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +70 -27
  93. data/lib/tinkerforge/bricklet_multi_touch.rb +30 -13
  94. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +75 -28
  95. data/lib/tinkerforge/bricklet_nfc.rb +126 -62
  96. data/lib/tinkerforge/bricklet_nfc_rfid.rb +32 -13
  97. data/lib/tinkerforge/bricklet_oled_128x64.rb +28 -11
  98. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +65 -24
  99. data/lib/tinkerforge/bricklet_oled_64x48.rb +28 -11
  100. data/lib/tinkerforge/bricklet_one_wire.rb +65 -24
  101. data/lib/tinkerforge/bricklet_outdoor_weather.rb +71 -28
  102. data/lib/tinkerforge/bricklet_particulate_matter.rb +74 -30
  103. data/lib/tinkerforge/bricklet_performance_dc.rb +682 -0
  104. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +18 -9
  105. data/lib/tinkerforge/bricklet_piezo_speaker.rb +21 -10
  106. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +79 -42
  107. data/lib/tinkerforge/bricklet_ptc.rb +73 -42
  108. data/lib/tinkerforge/bricklet_ptc_v2.rb +94 -48
  109. data/lib/tinkerforge/bricklet_real_time_clock.rb +44 -33
  110. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +77 -44
  111. data/lib/tinkerforge/bricklet_remote_switch.rb +38 -29
  112. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +86 -49
  113. data/lib/tinkerforge/bricklet_rgb_led.rb +17 -8
  114. data/lib/tinkerforge/bricklet_rgb_led_button.rb +61 -30
  115. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +78 -33
  116. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +51 -20
  117. data/lib/tinkerforge/bricklet_rotary_encoder.rb +38 -19
  118. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +59 -24
  119. data/lib/tinkerforge/bricklet_rotary_poti.rb +52 -28
  120. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +56 -23
  121. data/lib/tinkerforge/bricklet_rs232.rb +89 -28
  122. data/lib/tinkerforge/bricklet_rs232_v2.rb +117 -44
  123. data/lib/tinkerforge/bricklet_rs485.rb +222 -95
  124. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +24 -14
  125. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +74 -35
  126. data/lib/tinkerforge/bricklet_servo_v2.rb +565 -0
  127. data/lib/tinkerforge/bricklet_silent_stepper_v2.rb +1024 -0
  128. data/lib/tinkerforge/bricklet_solid_state_relay.rb +24 -13
  129. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +58 -25
  130. data/lib/tinkerforge/bricklet_sound_intensity.rb +34 -18
  131. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +71 -31
  132. data/lib/tinkerforge/bricklet_temperature.rb +39 -16
  133. data/lib/tinkerforge/bricklet_temperature_ir.rb +56 -23
  134. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +70 -27
  135. data/lib/tinkerforge/bricklet_temperature_v2.rb +60 -25
  136. data/lib/tinkerforge/bricklet_thermal_imaging.rb +104 -44
  137. data/lib/tinkerforge/bricklet_thermocouple.rb +44 -24
  138. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +64 -27
  139. data/lib/tinkerforge/bricklet_tilt.rb +23 -10
  140. data/lib/tinkerforge/bricklet_uv_light.rb +35 -18
  141. data/lib/tinkerforge/bricklet_uv_light_v2.rb +84 -37
  142. data/lib/tinkerforge/bricklet_voltage.rb +51 -28
  143. data/lib/tinkerforge/bricklet_voltage_current.rb +90 -73
  144. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +89 -68
  145. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +79 -30
  146. data/lib/tinkerforge/device_display_names.rb +170 -0
  147. data/lib/tinkerforge/ip_connection.rb +153 -33
  148. data/lib/tinkerforge/version.rb +1 -1
  149. metadata +11 -3
@@ -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 2021-05-06. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.24 #
5
+ # Ruby Bindings Version 2.1.29 #
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 relative humidity
14
16
  class BrickletHumidityV2 < Device
@@ -84,7 +86,7 @@ module Tinkerforge
84
86
  # Creates an object with the unique device ID <tt>uid</tt> and adds it to
85
87
  # the IP Connection <tt>ipcon</tt>.
86
88
  def initialize(uid, ipcon)
87
- super uid, ipcon
89
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
88
90
 
89
91
  @api_version = [2, 0, 2]
90
92
 
@@ -113,9 +115,10 @@ module Tinkerforge
113
115
  @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
114
116
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
115
117
 
116
- @callback_formats[CALLBACK_HUMIDITY] = 'S'
117
- @callback_formats[CALLBACK_TEMPERATURE] = 's'
118
+ @callback_formats[CALLBACK_HUMIDITY] = [10, 'S']
119
+ @callback_formats[CALLBACK_TEMPERATURE] = [10, 's']
118
120
 
121
+ @ipcon.add_device self
119
122
  end
120
123
 
121
124
  # Returns the humidity measured by the sensor.
@@ -125,7 +128,9 @@ module Tinkerforge
125
128
  # CALLBACK_HUMIDITY callback. You can set the callback configuration
126
129
  # with BrickletHumidityV2#set_humidity_callback_configuration.
127
130
  def get_humidity
128
- send_request FUNCTION_GET_HUMIDITY, [], '', 2, 'S'
131
+ check_validity
132
+
133
+ send_request FUNCTION_GET_HUMIDITY, [], '', 10, 'S'
129
134
  end
130
135
 
131
136
  # The period is the period with which the CALLBACK_HUMIDITY callback is triggered
@@ -154,12 +159,16 @@ module Tinkerforge
154
159
  #
155
160
  # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
156
161
  def set_humidity_callback_configuration(period, value_has_to_change, option, min, max)
157
- send_request FUNCTION_SET_HUMIDITY_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k S S', 0, ''
162
+ check_validity
163
+
164
+ send_request FUNCTION_SET_HUMIDITY_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k S S', 8, ''
158
165
  end
159
166
 
160
167
  # Returns the callback configuration as set by BrickletHumidityV2#set_humidity_callback_configuration.
161
168
  def get_humidity_callback_configuration
162
- send_request FUNCTION_GET_HUMIDITY_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k S S'
169
+ check_validity
170
+
171
+ send_request FUNCTION_GET_HUMIDITY_CALLBACK_CONFIGURATION, [], '', 18, 'L ? k S S'
163
172
  end
164
173
 
165
174
  # Returns the temperature measured by the sensor.
@@ -169,7 +178,9 @@ module Tinkerforge
169
178
  # CALLBACK_TEMPERATURE callback. You can set the callback configuration
170
179
  # with BrickletHumidityV2#set_temperature_callback_configuration.
171
180
  def get_temperature
172
- send_request FUNCTION_GET_TEMPERATURE, [], '', 2, 's'
181
+ check_validity
182
+
183
+ send_request FUNCTION_GET_TEMPERATURE, [], '', 10, 's'
173
184
  end
174
185
 
175
186
  # The period is the period with which the CALLBACK_TEMPERATURE callback is triggered
@@ -198,23 +209,31 @@ module Tinkerforge
198
209
  #
199
210
  # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
200
211
  def set_temperature_callback_configuration(period, value_has_to_change, option, min, max)
201
- send_request FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k s s', 0, ''
212
+ check_validity
213
+
214
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k s s', 8, ''
202
215
  end
203
216
 
204
217
  # Returns the callback configuration as set by BrickletHumidityV2#set_temperature_callback_configuration.
205
218
  def get_temperature_callback_configuration
206
- send_request FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k s s'
219
+ check_validity
220
+
221
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 18, 'L ? k s s'
207
222
  end
208
223
 
209
224
  # Enables/disables the heater. The heater can be used to dry the sensor in
210
225
  # extremely wet conditions.
211
226
  def set_heater_configuration(heater_config)
212
- send_request FUNCTION_SET_HEATER_CONFIGURATION, [heater_config], 'C', 0, ''
227
+ check_validity
228
+
229
+ send_request FUNCTION_SET_HEATER_CONFIGURATION, [heater_config], 'C', 8, ''
213
230
  end
214
231
 
215
232
  # Returns the heater configuration as set by BrickletHumidityV2#set_heater_configuration.
216
233
  def get_heater_configuration
217
- send_request FUNCTION_GET_HEATER_CONFIGURATION, [], '', 1, 'C'
234
+ check_validity
235
+
236
+ send_request FUNCTION_GET_HEATER_CONFIGURATION, [], '', 9, 'C'
218
237
  end
219
238
 
220
239
  # Sets the length of a `moving averaging <https://en.wikipedia.org/wiki/Moving_average>`__
@@ -232,12 +251,16 @@ module Tinkerforge
232
251
  # of th IC, changed the default value from 20 samples per second to 1. With 1 sample per second
233
252
  # a moving average length of 1000 would result in an averaging window of 1000 seconds!
234
253
  def set_moving_average_configuration(moving_average_length_humidity, moving_average_length_temperature)
235
- send_request FUNCTION_SET_MOVING_AVERAGE_CONFIGURATION, [moving_average_length_humidity, moving_average_length_temperature], 'S S', 0, ''
254
+ check_validity
255
+
256
+ send_request FUNCTION_SET_MOVING_AVERAGE_CONFIGURATION, [moving_average_length_humidity, moving_average_length_temperature], 'S S', 8, ''
236
257
  end
237
258
 
238
259
  # Returns the moving average configuration as set by BrickletHumidityV2#set_moving_average_configuration.
239
260
  def get_moving_average_configuration
240
- send_request FUNCTION_GET_MOVING_AVERAGE_CONFIGURATION, [], '', 4, 'S S'
261
+ check_validity
262
+
263
+ send_request FUNCTION_GET_MOVING_AVERAGE_CONFIGURATION, [], '', 12, 'S S'
241
264
  end
242
265
 
243
266
  # Sets the samples per second that are gathered by the humidity/temperature sensor HDC1080.
@@ -252,14 +275,18 @@ module Tinkerforge
252
275
  #
253
276
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
254
277
  def set_samples_per_second(sps)
255
- send_request FUNCTION_SET_SAMPLES_PER_SECOND, [sps], 'C', 0, ''
278
+ check_validity
279
+
280
+ send_request FUNCTION_SET_SAMPLES_PER_SECOND, [sps], 'C', 8, ''
256
281
  end
257
282
 
258
283
  # Returnes the samples per second, as set by BrickletHumidityV2#set_samples_per_second.
259
284
  #
260
285
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
261
286
  def get_samples_per_second
262
- send_request FUNCTION_GET_SAMPLES_PER_SECOND, [], '', 1, 'C'
287
+ check_validity
288
+
289
+ send_request FUNCTION_GET_SAMPLES_PER_SECOND, [], '', 9, 'C'
263
290
  end
264
291
 
265
292
  # Returns the error count for the communication between Brick and Bricklet.
@@ -274,7 +301,9 @@ module Tinkerforge
274
301
  # The errors counts are for errors that occur on the Bricklet side. All
275
302
  # Bricks have a similar function that returns the errors on the Brick side.
276
303
  def get_spitfp_error_count
277
- send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
304
+ check_validity
305
+
306
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
278
307
  end
279
308
 
280
309
  # Sets the bootloader mode and returns the status after the requested
@@ -287,12 +316,16 @@ module Tinkerforge
287
316
  # This function is used by Brick Viewer during flashing. It should not be
288
317
  # necessary to call it in a normal user program.
289
318
  def set_bootloader_mode(mode)
290
- send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
319
+ check_validity
320
+
321
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
291
322
  end
292
323
 
293
324
  # Returns the current bootloader mode, see BrickletHumidityV2#set_bootloader_mode.
294
325
  def get_bootloader_mode
295
- send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
326
+ check_validity
327
+
328
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
296
329
  end
297
330
 
298
331
  # Sets the firmware pointer for BrickletHumidityV2#write_firmware. The pointer has
@@ -302,7 +335,9 @@ module Tinkerforge
302
335
  # This function is used by Brick Viewer during flashing. It should not be
303
336
  # necessary to call it in a normal user program.
304
337
  def set_write_firmware_pointer(pointer)
305
- send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
338
+ check_validity
339
+
340
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
306
341
  end
307
342
 
308
343
  # Writes 64 Bytes of firmware at the position as written by
@@ -314,7 +349,9 @@ module Tinkerforge
314
349
  # This function is used by Brick Viewer during flashing. It should not be
315
350
  # necessary to call it in a normal user program.
316
351
  def write_firmware(data)
317
- send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
352
+ check_validity
353
+
354
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
318
355
  end
319
356
 
320
357
  # Sets the status LED configuration. By default the LED shows
@@ -325,22 +362,28 @@ module Tinkerforge
325
362
  #
326
363
  # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
327
364
  def set_status_led_config(config)
328
- send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
365
+ check_validity
366
+
367
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
329
368
  end
330
369
 
331
370
  # Returns the configuration as set by BrickletHumidityV2#set_status_led_config
332
371
  def get_status_led_config
333
- send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
372
+ check_validity
373
+
374
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
334
375
  end
335
376
 
336
- # Returns the temperature in °C as measured inside the microcontroller. The
377
+ # Returns the temperature as measured inside the microcontroller. The
337
378
  # value returned is not the ambient temperature!
338
379
  #
339
380
  # The temperature is only proportional to the real temperature and it has bad
340
381
  # accuracy. Practically it is only useful as an indicator for
341
382
  # temperature changes.
342
383
  def get_chip_temperature
343
- send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
384
+ check_validity
385
+
386
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
344
387
  end
345
388
 
346
389
  # Calling this function will reset the Bricklet. All configurations
@@ -350,7 +393,9 @@ module Tinkerforge
350
393
  # calling functions on the existing ones will result in
351
394
  # undefined behavior!
352
395
  def reset
353
- send_request FUNCTION_RESET, [], '', 0, ''
396
+ check_validity
397
+
398
+ send_request FUNCTION_RESET, [], '', 8, ''
354
399
  end
355
400
 
356
401
  # Writes a new UID into flash. If you want to set a new UID
@@ -359,25 +404,31 @@ module Tinkerforge
359
404
  #
360
405
  # We recommend that you use Brick Viewer to change the UID.
361
406
  def write_uid(uid)
362
- send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
407
+ check_validity
408
+
409
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
363
410
  end
364
411
 
365
412
  # Returns the current UID as an integer. Encode as
366
413
  # Base58 to get the usual string version.
367
414
  def read_uid
368
- send_request FUNCTION_READ_UID, [], '', 4, 'L'
415
+ check_validity
416
+
417
+ send_request FUNCTION_READ_UID, [], '', 12, 'L'
369
418
  end
370
419
 
371
420
  # Returns the UID, the UID where the Bricklet is connected to,
372
421
  # the position, the hardware and firmware version as well as the
373
422
  # device identifier.
374
423
  #
375
- # The position can be 'a', 'b', 'c' or 'd'.
424
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
425
+ # A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
426
+ # position 'z'.
376
427
  #
377
428
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
378
429
  # |device_identifier_constant|
379
430
  def get_identity
380
- send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
431
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
381
432
  end
382
433
 
383
434
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -0,0 +1,784 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2021-05-06. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.29 #
6
+ # #
7
+ # If you have a bugfix for this file and want to commit it, #
8
+ # please fix the bug in the generator. You can find a link #
9
+ # to the generators git repository on tinkerforge.com #
10
+ #############################################################
11
+
12
+ require_relative './ip_connection'
13
+
14
+ module Tinkerforge
15
+ # Full fledged AHRS with 9 degrees of freedom
16
+ class BrickletIMUV3 < Device
17
+ DEVICE_IDENTIFIER = 2161 # :nodoc:
18
+ DEVICE_DISPLAY_NAME = 'IMU Bricklet 3.0' # :nodoc:
19
+
20
+ # This callback is triggered periodically with the period that is set by
21
+ # BrickletIMUV3#set_acceleration_callback_configuration. The parameters are the acceleration
22
+ # for the x, y and z axis.
23
+ CALLBACK_ACCELERATION = 33
24
+
25
+ # This callback is triggered periodically with the period that is set by
26
+ # BrickletIMUV3#set_magnetic_field_callback_configuration. The parameters are the magnetic
27
+ # field for the x, y and z axis.
28
+ CALLBACK_MAGNETIC_FIELD = 34
29
+
30
+ # This callback is triggered periodically with the period that is set by
31
+ # BrickletIMUV3#set_angular_velocity_callback_configuration. The parameters are the angular
32
+ # velocity for the x, y and z axis.
33
+ CALLBACK_ANGULAR_VELOCITY = 35
34
+
35
+ # This callback is triggered periodically with the period that is set by
36
+ # BrickletIMUV3#set_temperature_callback_configuration. The parameter is the temperature.
37
+ CALLBACK_TEMPERATURE = 36
38
+
39
+ # This callback is triggered periodically with the period that is set by
40
+ # BrickletIMUV3#set_linear_acceleration_callback_configuration. The parameters are the
41
+ # linear acceleration for the x, y and z axis.
42
+ CALLBACK_LINEAR_ACCELERATION = 37
43
+
44
+ # This callback is triggered periodically with the period that is set by
45
+ # BrickletIMUV3#set_gravity_vector_callback_configuration. The parameters gravity vector
46
+ # for the x, y and z axis.
47
+ CALLBACK_GRAVITY_VECTOR = 38
48
+
49
+ # This callback is triggered periodically with the period that is set by
50
+ # BrickletIMUV3#set_orientation_callback_configuration. The parameters are the orientation
51
+ # (heading (yaw), roll, pitch) of the IMU Brick in Euler angles. See
52
+ # BrickletIMUV3#get_orientation for details.
53
+ CALLBACK_ORIENTATION = 39
54
+
55
+ # This callback is triggered periodically with the period that is set by
56
+ # BrickletIMUV3#set_quaternion_callback_configuration. The parameters are the orientation
57
+ # (w, x, y, z) of the IMU Brick in quaternions. See BrickletIMUV3#get_quaternion
58
+ # for details.
59
+ CALLBACK_QUATERNION = 40
60
+
61
+ # This callback is triggered periodically with the period that is set by
62
+ # BrickletIMUV3#set_all_data_callback_configuration. The parameters are as for
63
+ # BrickletIMUV3#get_all_data.
64
+ CALLBACK_ALL_DATA = 41
65
+
66
+ FUNCTION_GET_ACCELERATION = 1 # :nodoc:
67
+ FUNCTION_GET_MAGNETIC_FIELD = 2 # :nodoc:
68
+ FUNCTION_GET_ANGULAR_VELOCITY = 3 # :nodoc:
69
+ FUNCTION_GET_TEMPERATURE = 4 # :nodoc:
70
+ FUNCTION_GET_ORIENTATION = 5 # :nodoc:
71
+ FUNCTION_GET_LINEAR_ACCELERATION = 6 # :nodoc:
72
+ FUNCTION_GET_GRAVITY_VECTOR = 7 # :nodoc:
73
+ FUNCTION_GET_QUATERNION = 8 # :nodoc:
74
+ FUNCTION_GET_ALL_DATA = 9 # :nodoc:
75
+ FUNCTION_SAVE_CALIBRATION = 10 # :nodoc:
76
+ FUNCTION_SET_SENSOR_CONFIGURATION = 11 # :nodoc:
77
+ FUNCTION_GET_SENSOR_CONFIGURATION = 12 # :nodoc:
78
+ FUNCTION_SET_SENSOR_FUSION_MODE = 13 # :nodoc:
79
+ FUNCTION_GET_SENSOR_FUSION_MODE = 14 # :nodoc:
80
+ FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION = 15 # :nodoc:
81
+ FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION = 16 # :nodoc:
82
+ FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION = 17 # :nodoc:
83
+ FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION = 18 # :nodoc:
84
+ FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION = 19 # :nodoc:
85
+ FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION = 20 # :nodoc:
86
+ FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION = 21 # :nodoc:
87
+ FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION = 22 # :nodoc:
88
+ FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION = 23 # :nodoc:
89
+ FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION = 24 # :nodoc:
90
+ FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION = 25 # :nodoc:
91
+ FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION = 26 # :nodoc:
92
+ FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION = 27 # :nodoc:
93
+ FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION = 28 # :nodoc:
94
+ FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION = 29 # :nodoc:
95
+ FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION = 30 # :nodoc:
96
+ FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION = 31 # :nodoc:
97
+ FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION = 32 # :nodoc:
98
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
99
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
100
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
101
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
102
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
103
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
104
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
105
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
106
+ FUNCTION_RESET = 243 # :nodoc:
107
+ FUNCTION_WRITE_UID = 248 # :nodoc:
108
+ FUNCTION_READ_UID = 249 # :nodoc:
109
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
110
+
111
+ MAGNETOMETER_RATE_2HZ = 0 # :nodoc:
112
+ MAGNETOMETER_RATE_6HZ = 1 # :nodoc:
113
+ MAGNETOMETER_RATE_8HZ = 2 # :nodoc:
114
+ MAGNETOMETER_RATE_10HZ = 3 # :nodoc:
115
+ MAGNETOMETER_RATE_15HZ = 4 # :nodoc:
116
+ MAGNETOMETER_RATE_20HZ = 5 # :nodoc:
117
+ MAGNETOMETER_RATE_25HZ = 6 # :nodoc:
118
+ MAGNETOMETER_RATE_30HZ = 7 # :nodoc:
119
+ GYROSCOPE_RANGE_2000DPS = 0 # :nodoc:
120
+ GYROSCOPE_RANGE_1000DPS = 1 # :nodoc:
121
+ GYROSCOPE_RANGE_500DPS = 2 # :nodoc:
122
+ GYROSCOPE_RANGE_250DPS = 3 # :nodoc:
123
+ GYROSCOPE_RANGE_125DPS = 4 # :nodoc:
124
+ GYROSCOPE_BANDWIDTH_523HZ = 0 # :nodoc:
125
+ GYROSCOPE_BANDWIDTH_230HZ = 1 # :nodoc:
126
+ GYROSCOPE_BANDWIDTH_116HZ = 2 # :nodoc:
127
+ GYROSCOPE_BANDWIDTH_47HZ = 3 # :nodoc:
128
+ GYROSCOPE_BANDWIDTH_23HZ = 4 # :nodoc:
129
+ GYROSCOPE_BANDWIDTH_12HZ = 5 # :nodoc:
130
+ GYROSCOPE_BANDWIDTH_64HZ = 6 # :nodoc:
131
+ GYROSCOPE_BANDWIDTH_32HZ = 7 # :nodoc:
132
+ ACCELEROMETER_RANGE_2G = 0 # :nodoc:
133
+ ACCELEROMETER_RANGE_4G = 1 # :nodoc:
134
+ ACCELEROMETER_RANGE_8G = 2 # :nodoc:
135
+ ACCELEROMETER_RANGE_16G = 3 # :nodoc:
136
+ ACCELEROMETER_BANDWIDTH_7_81HZ = 0 # :nodoc:
137
+ ACCELEROMETER_BANDWIDTH_15_63HZ = 1 # :nodoc:
138
+ ACCELEROMETER_BANDWIDTH_31_25HZ = 2 # :nodoc:
139
+ ACCELEROMETER_BANDWIDTH_62_5HZ = 3 # :nodoc:
140
+ ACCELEROMETER_BANDWIDTH_125HZ = 4 # :nodoc:
141
+ ACCELEROMETER_BANDWIDTH_250HZ = 5 # :nodoc:
142
+ ACCELEROMETER_BANDWIDTH_500HZ = 6 # :nodoc:
143
+ ACCELEROMETER_BANDWIDTH_1000HZ = 7 # :nodoc:
144
+ SENSOR_FUSION_OFF = 0 # :nodoc:
145
+ SENSOR_FUSION_ON = 1 # :nodoc:
146
+ SENSOR_FUSION_ON_WITHOUT_MAGNETOMETER = 2 # :nodoc:
147
+ SENSOR_FUSION_ON_WITHOUT_FAST_MAGNETOMETER_CALIBRATION = 3 # :nodoc:
148
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
149
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
150
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
151
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
152
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
153
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
154
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
155
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
156
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
157
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
158
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
159
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
160
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
161
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
162
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
163
+
164
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
165
+ # the IP Connection <tt>ipcon</tt>.
166
+ def initialize(uid, ipcon)
167
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
168
+
169
+ @api_version = [2, 0, 0]
170
+
171
+ @response_expected[FUNCTION_GET_ACCELERATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
172
+ @response_expected[FUNCTION_GET_MAGNETIC_FIELD] = RESPONSE_EXPECTED_ALWAYS_TRUE
173
+ @response_expected[FUNCTION_GET_ANGULAR_VELOCITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
174
+ @response_expected[FUNCTION_GET_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
175
+ @response_expected[FUNCTION_GET_ORIENTATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
176
+ @response_expected[FUNCTION_GET_LINEAR_ACCELERATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
177
+ @response_expected[FUNCTION_GET_GRAVITY_VECTOR] = RESPONSE_EXPECTED_ALWAYS_TRUE
178
+ @response_expected[FUNCTION_GET_QUATERNION] = RESPONSE_EXPECTED_ALWAYS_TRUE
179
+ @response_expected[FUNCTION_GET_ALL_DATA] = RESPONSE_EXPECTED_ALWAYS_TRUE
180
+ @response_expected[FUNCTION_SAVE_CALIBRATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
181
+ @response_expected[FUNCTION_SET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
182
+ @response_expected[FUNCTION_GET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
183
+ @response_expected[FUNCTION_SET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_FALSE
184
+ @response_expected[FUNCTION_GET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
185
+ @response_expected[FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
186
+ @response_expected[FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
187
+ @response_expected[FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
188
+ @response_expected[FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
189
+ @response_expected[FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
190
+ @response_expected[FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
191
+ @response_expected[FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
192
+ @response_expected[FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
193
+ @response_expected[FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
194
+ @response_expected[FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
195
+ @response_expected[FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
196
+ @response_expected[FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
197
+ @response_expected[FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
198
+ @response_expected[FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
199
+ @response_expected[FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
200
+ @response_expected[FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
201
+ @response_expected[FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
202
+ @response_expected[FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
203
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
204
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
205
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
206
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
207
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
208
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
209
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
210
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
211
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
212
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
213
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
214
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
215
+
216
+ @callback_formats[CALLBACK_ACCELERATION] = [14, 's s s']
217
+ @callback_formats[CALLBACK_MAGNETIC_FIELD] = [14, 's s s']
218
+ @callback_formats[CALLBACK_ANGULAR_VELOCITY] = [14, 's s s']
219
+ @callback_formats[CALLBACK_TEMPERATURE] = [9, 'c']
220
+ @callback_formats[CALLBACK_LINEAR_ACCELERATION] = [14, 's s s']
221
+ @callback_formats[CALLBACK_GRAVITY_VECTOR] = [14, 's s s']
222
+ @callback_formats[CALLBACK_ORIENTATION] = [14, 's s s']
223
+ @callback_formats[CALLBACK_QUATERNION] = [16, 's s s s']
224
+ @callback_formats[CALLBACK_ALL_DATA] = [54, 's3 s3 s3 s3 s4 s3 s3 c C']
225
+
226
+ @ipcon.add_device self
227
+ end
228
+
229
+ # Returns the calibrated acceleration from the accelerometer for the
230
+ # x, y and z axis. The acceleration is in the range configured with
231
+ # BrickletIMUV3#set_sensor_configuration.
232
+ #
233
+ # If you want to get the acceleration periodically, it is recommended
234
+ # to use the CALLBACK_ACCELERATION callback and set the period with
235
+ # BrickletIMUV3#set_acceleration_callback_configuration.
236
+ def get_acceleration
237
+ check_validity
238
+
239
+ send_request FUNCTION_GET_ACCELERATION, [], '', 14, 's s s'
240
+ end
241
+
242
+ # Returns the calibrated magnetic field from the magnetometer for the
243
+ # x, y and z axis.
244
+ #
245
+ # If you want to get the magnetic field periodically, it is recommended
246
+ # to use the CALLBACK_MAGNETIC_FIELD callback and set the period with
247
+ # BrickletIMUV3#set_magnetic_field_callback_configuration.
248
+ def get_magnetic_field
249
+ check_validity
250
+
251
+ send_request FUNCTION_GET_MAGNETIC_FIELD, [], '', 14, 's s s'
252
+ end
253
+
254
+ # Returns the calibrated angular velocity from the gyroscope for the
255
+ # x, y and z axis. The angular velocity is in the range configured with
256
+ # BrickletIMUV3#set_sensor_configuration.
257
+ #
258
+ # If you want to get the angular velocity periodically, it is recommended
259
+ # to use the CALLBACK_ANGULAR_VELOCITY acallback nd set the period with
260
+ # BrickletIMUV3#set_angular_velocity_callback_configuration.
261
+ def get_angular_velocity
262
+ check_validity
263
+
264
+ send_request FUNCTION_GET_ANGULAR_VELOCITY, [], '', 14, 's s s'
265
+ end
266
+
267
+ # Returns the temperature of the IMU Brick.
268
+ # The temperature is measured in the core of the BNO055 IC, it is not the
269
+ # ambient temperature
270
+ def get_temperature
271
+ check_validity
272
+
273
+ send_request FUNCTION_GET_TEMPERATURE, [], '', 9, 'c'
274
+ end
275
+
276
+ # Returns the current orientation (heading, roll, pitch) of the IMU Brick as
277
+ # independent Euler angles. Note that Euler angles always
278
+ # experience a `gimbal lock <https://en.wikipedia.org/wiki/Gimbal_lock>`__.
279
+ # We recommend that you use quaternions instead, if you need the absolute
280
+ # orientation.
281
+ #
282
+ # If you want to get the orientation periodically, it is recommended
283
+ # to use the CALLBACK_ORIENTATION callback and set the period with
284
+ # BrickletIMUV3#set_orientation_callback_configuration.
285
+ def get_orientation
286
+ check_validity
287
+
288
+ send_request FUNCTION_GET_ORIENTATION, [], '', 14, 's s s'
289
+ end
290
+
291
+ # Returns the linear acceleration of the IMU Brick for the
292
+ # x, y and z axis. The acceleration is in the range configured with
293
+ # BrickletIMUV3#set_sensor_configuration.
294
+ #
295
+ # The linear acceleration is the acceleration in each of the three
296
+ # axis of the IMU Brick with the influences of gravity removed.
297
+ #
298
+ # It is also possible to get the gravity vector with the influence of linear
299
+ # acceleration removed, see BrickletIMUV3#get_gravity_vector.
300
+ #
301
+ # If you want to get the linear acceleration periodically, it is recommended
302
+ # to use the CALLBACK_LINEAR_ACCELERATION callback and set the period with
303
+ # BrickletIMUV3#set_linear_acceleration_callback_configuration.
304
+ def get_linear_acceleration
305
+ check_validity
306
+
307
+ send_request FUNCTION_GET_LINEAR_ACCELERATION, [], '', 14, 's s s'
308
+ end
309
+
310
+ # Returns the current gravity vector of the IMU Brick for the
311
+ # x, y and z axis.
312
+ #
313
+ # The gravity vector is the acceleration that occurs due to gravity.
314
+ # Influences of additional linear acceleration are removed.
315
+ #
316
+ # It is also possible to get the linear acceleration with the influence
317
+ # of gravity removed, see BrickletIMUV3#get_linear_acceleration.
318
+ #
319
+ # If you want to get the gravity vector periodically, it is recommended
320
+ # to use the CALLBACK_GRAVITY_VECTOR callback and set the period with
321
+ # BrickletIMUV3#set_gravity_vector_callback_configuration.
322
+ def get_gravity_vector
323
+ check_validity
324
+
325
+ send_request FUNCTION_GET_GRAVITY_VECTOR, [], '', 14, 's s s'
326
+ end
327
+
328
+ # Returns the current orientation (w, x, y, z) of the IMU Brick as
329
+ # `quaternions <https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation>`__.
330
+ #
331
+ # You have to divide the return values by 16383 (14 bit) to get
332
+ # the usual range of -1.0 to +1.0 for quaternions.
333
+ #
334
+ # If you want to get the quaternions periodically, it is recommended
335
+ # to use the CALLBACK_QUATERNION callback and set the period with
336
+ # BrickletIMUV3#set_quaternion_callback_configuration.
337
+ def get_quaternion
338
+ check_validity
339
+
340
+ send_request FUNCTION_GET_QUATERNION, [], '', 16, 's s s s'
341
+ end
342
+
343
+ # Return all of the available data of the IMU Brick.
344
+ #
345
+ # * acceleration (see BrickletIMUV3#get_acceleration)
346
+ # * magnetic field (see BrickletIMUV3#get_magnetic_field)
347
+ # * angular velocity (see BrickletIMUV3#get_angular_velocity)
348
+ # * Euler angles (see BrickletIMUV3#get_orientation)
349
+ # * quaternion (see BrickletIMUV3#get_quaternion)
350
+ # * linear acceleration (see BrickletIMUV3#get_linear_acceleration)
351
+ # * gravity vector (see BrickletIMUV3#get_gravity_vector)
352
+ # * temperature (see BrickletIMUV3#get_temperature)
353
+ # * calibration status (see below)
354
+ #
355
+ # The calibration status consists of four pairs of two bits. Each pair
356
+ # of bits represents the status of the current calibration.
357
+ #
358
+ # * bit 0-1: Magnetometer
359
+ # * bit 2-3: Accelerometer
360
+ # * bit 4-5: Gyroscope
361
+ # * bit 6-7: System
362
+ #
363
+ # A value of 0 means for "not calibrated" and a value of 3 means
364
+ # "fully calibrated". In your program you should always be able to
365
+ # ignore the calibration status, it is used by the calibration
366
+ # window of the Brick Viewer and it can be ignored after the first
367
+ # calibration. See the documentation in the calibration window for
368
+ # more information regarding the calibration of the IMU Brick.
369
+ #
370
+ # If you want to get the data periodically, it is recommended
371
+ # to use the CALLBACK_ALL_DATA callback and set the period with
372
+ # BrickletIMUV3#set_all_data_callback_configuration.
373
+ def get_all_data
374
+ check_validity
375
+
376
+ send_request FUNCTION_GET_ALL_DATA, [], '', 54, 's3 s3 s3 s3 s4 s3 s3 c C'
377
+ end
378
+
379
+ # A call of this function saves the current calibration to be used
380
+ # as a starting point for the next restart of continuous calibration
381
+ # of the IMU Brick.
382
+ #
383
+ # A return value of *true* means that the calibration could be used and
384
+ # *false* means that it could not be used (this happens if the calibration
385
+ # status is not "fully calibrated").
386
+ #
387
+ # This function is used by the calibration window of the Brick Viewer, you
388
+ # should not need to call it in your program.
389
+ def save_calibration
390
+ check_validity
391
+
392
+ send_request FUNCTION_SAVE_CALIBRATION, [], '', 9, '?'
393
+ end
394
+
395
+ # Sets the available sensor configuration for the Magnetometer, Gyroscope and
396
+ # Accelerometer. The Accelerometer Range is user selectable in all fusion modes,
397
+ # all other configurations are auto-controlled in fusion mode.
398
+ def set_sensor_configuration(magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth)
399
+ check_validity
400
+
401
+ send_request FUNCTION_SET_SENSOR_CONFIGURATION, [magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth], 'C C C C C', 8, ''
402
+ end
403
+
404
+ # Returns the sensor configuration as set by BrickletIMUV3#set_sensor_configuration.
405
+ def get_sensor_configuration
406
+ check_validity
407
+
408
+ send_request FUNCTION_GET_SENSOR_CONFIGURATION, [], '', 13, 'C C C C C'
409
+ end
410
+
411
+ # If the fusion mode is turned off, the functions BrickletIMUV3#get_acceleration,
412
+ # BrickletIMUV3#get_magnetic_field and BrickletIMUV3#get_angular_velocity return uncalibrated
413
+ # and uncompensated sensor data. All other sensor data getters return no data.
414
+ #
415
+ # Since firmware version 2.0.6 you can also use a fusion mode without magnetometer.
416
+ # In this mode the calculated orientation is relative (with magnetometer it is
417
+ # absolute with respect to the earth). However, the calculation can't be influenced
418
+ # by spurious magnetic fields.
419
+ #
420
+ # Since firmware version 2.0.13 you can also use a fusion mode without fast
421
+ # magnetometer calibration. This mode is the same as the normal fusion mode,
422
+ # but the fast magnetometer calibration is turned off. So to find the orientation
423
+ # the first time will likely take longer, but small magnetic influences might
424
+ # not affect the automatic calibration as much.
425
+ def set_sensor_fusion_mode(mode)
426
+ check_validity
427
+
428
+ send_request FUNCTION_SET_SENSOR_FUSION_MODE, [mode], 'C', 8, ''
429
+ end
430
+
431
+ # Returns the sensor fusion mode as set by BrickletIMUV3#set_sensor_fusion_mode.
432
+ def get_sensor_fusion_mode
433
+ check_validity
434
+
435
+ send_request FUNCTION_GET_SENSOR_FUSION_MODE, [], '', 9, 'C'
436
+ end
437
+
438
+ # The period is the period with which the CALLBACK_ACCELERATION callback
439
+ # is triggered periodically. A value of 0 turns the callback off.
440
+ #
441
+ # If the `value has to change`-parameter is set to true, the callback is only
442
+ # triggered after the value has changed. If the value didn't change within the
443
+ # period, the callback is triggered immediately on change.
444
+ #
445
+ # If it is set to false, the callback is continuously triggered with the period,
446
+ # independent of the value.
447
+ def set_acceleration_callback_configuration(period, value_has_to_change)
448
+ check_validity
449
+
450
+ send_request FUNCTION_SET_ACCELERATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
451
+ end
452
+
453
+ # Returns the callback configuration as set by BrickletIMUV3#set_acceleration_callback_configuration.
454
+ def get_acceleration_callback_configuration
455
+ check_validity
456
+
457
+ send_request FUNCTION_GET_ACCELERATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
458
+ end
459
+
460
+ # The period is the period with which the CALLBACK_MAGNETIC_FIELD callback
461
+ # is triggered periodically. A value of 0 turns the callback off.
462
+ #
463
+ # If the `value has to change`-parameter is set to true, the callback is only
464
+ # triggered after the value has changed. If the value didn't change within the
465
+ # period, the callback is triggered immediately on change.
466
+ #
467
+ # If it is set to false, the callback is continuously triggered with the period,
468
+ # independent of the value.
469
+ def set_magnetic_field_callback_configuration(period, value_has_to_change)
470
+ check_validity
471
+
472
+ send_request FUNCTION_SET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
473
+ end
474
+
475
+ # Returns the callback configuration as set by BrickletIMUV3#set_magnetic_field_callback_configuration.
476
+ def get_magnetic_field_callback_configuration
477
+ check_validity
478
+
479
+ send_request FUNCTION_GET_MAGNETIC_FIELD_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
480
+ end
481
+
482
+ # The period is the period with which the CALLBACK_ANGULAR_VELOCITY callback
483
+ # is triggered periodically. A value of 0 turns the callback off.
484
+ #
485
+ # If the `value has to change`-parameter is set to true, the callback is only
486
+ # triggered after the value has changed. If the value didn't change within the
487
+ # period, the callback is triggered immediately on change.
488
+ #
489
+ # If it is set to false, the callback is continuously triggered with the period,
490
+ # independent of the value.
491
+ def set_angular_velocity_callback_configuration(period, value_has_to_change)
492
+ check_validity
493
+
494
+ send_request FUNCTION_SET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
495
+ end
496
+
497
+ # Returns the callback configuration as set by BrickletIMUV3#set_angular_velocity_callback_configuration.
498
+ def get_angular_velocity_callback_configuration
499
+ check_validity
500
+
501
+ send_request FUNCTION_GET_ANGULAR_VELOCITY_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
502
+ end
503
+
504
+ # The period is the period with which the CALLBACK_TEMPERATURE callback
505
+ # is triggered periodically. A value of 0 turns the callback off.
506
+ #
507
+ # If the `value has to change`-parameter is set to true, the callback is only
508
+ # triggered after the value has changed. If the value didn't change within the
509
+ # period, the callback is triggered immediately on change.
510
+ #
511
+ # If it is set to false, the callback is continuously triggered with the period,
512
+ # independent of the value.
513
+ def set_temperature_callback_configuration(period, value_has_to_change)
514
+ check_validity
515
+
516
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
517
+ end
518
+
519
+ # Returns the callback configuration as set by BrickletIMUV3#set_temperature_callback_configuration.
520
+ def get_temperature_callback_configuration
521
+ check_validity
522
+
523
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
524
+ end
525
+
526
+ # The period is the period with which the CALLBACK_ORIENTATION callback
527
+ # is triggered periodically. A value of 0 turns the callback off.
528
+ #
529
+ # If the `value has to change`-parameter is set to true, the callback is only
530
+ # triggered after the value has changed. If the value didn't change within the
531
+ # period, the callback is triggered immediately on change.
532
+ #
533
+ # If it is set to false, the callback is continuously triggered with the period,
534
+ # independent of the value.
535
+ def set_orientation_callback_configuration(period, value_has_to_change)
536
+ check_validity
537
+
538
+ send_request FUNCTION_SET_ORIENTATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
539
+ end
540
+
541
+ # Returns the callback configuration as set by BrickletIMUV3#set_orientation_callback_configuration.
542
+ def get_orientation_callback_configuration
543
+ check_validity
544
+
545
+ send_request FUNCTION_GET_ORIENTATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
546
+ end
547
+
548
+ # The period is the period with which the CALLBACK_LINEAR_ACCELERATION callback
549
+ # is triggered periodically. A value of 0 turns the callback off.
550
+ #
551
+ # If the `value has to change`-parameter is set to true, the callback is only
552
+ # triggered after the value has changed. If the value didn't change within the
553
+ # period, the callback is triggered immediately on change.
554
+ #
555
+ # If it is set to false, the callback is continuously triggered with the period,
556
+ # independent of the value.
557
+ def set_linear_acceleration_callback_configuration(period, value_has_to_change)
558
+ check_validity
559
+
560
+ send_request FUNCTION_SET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
561
+ end
562
+
563
+ # Returns the callback configuration as set by BrickletIMUV3#set_linear_acceleration_callback_configuration.
564
+ def get_linear_acceleration_callback_configuration
565
+ check_validity
566
+
567
+ send_request FUNCTION_GET_LINEAR_ACCELERATION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
568
+ end
569
+
570
+ # The period is the period with which the CALLBACK_GRAVITY_VECTOR callback
571
+ # is triggered periodically. A value of 0 turns the callback off.
572
+ #
573
+ # If the `value has to change`-parameter is set to true, the callback is only
574
+ # triggered after the value has changed. If the value didn't change within the
575
+ # period, the callback is triggered immediately on change.
576
+ #
577
+ # If it is set to false, the callback is continuously triggered with the period,
578
+ # independent of the value.
579
+ def set_gravity_vector_callback_configuration(period, value_has_to_change)
580
+ check_validity
581
+
582
+ send_request FUNCTION_SET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
583
+ end
584
+
585
+ # Returns the callback configuration as set by BrickletIMUV3#set_gravity_vector_callback_configuration.
586
+ def get_gravity_vector_callback_configuration
587
+ check_validity
588
+
589
+ send_request FUNCTION_GET_GRAVITY_VECTOR_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
590
+ end
591
+
592
+ # The period is the period with which the CALLBACK_QUATERNION callback
593
+ # is triggered periodically. A value of 0 turns the callback off.
594
+ #
595
+ # If the `value has to change`-parameter is set to true, the callback is only
596
+ # triggered after the value has changed. If the value didn't change within the
597
+ # period, the callback is triggered immediately on change.
598
+ #
599
+ # If it is set to false, the callback is continuously triggered with the period,
600
+ # independent of the value.
601
+ def set_quaternion_callback_configuration(period, value_has_to_change)
602
+ check_validity
603
+
604
+ send_request FUNCTION_SET_QUATERNION_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
605
+ end
606
+
607
+ # Returns the callback configuration as set by BrickletIMUV3#set_quaternion_callback_configuration.
608
+ def get_quaternion_callback_configuration
609
+ check_validity
610
+
611
+ send_request FUNCTION_GET_QUATERNION_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
612
+ end
613
+
614
+ # The period is the period with which the CALLBACK_ALL_DATA callback
615
+ # is triggered periodically. A value of 0 turns the callback off.
616
+ #
617
+ # If the `value has to change`-parameter is set to true, the callback is only
618
+ # triggered after the value has changed. If the value didn't change within the
619
+ # period, the callback is triggered immediately on change.
620
+ #
621
+ # If it is set to false, the callback is continuously triggered with the period,
622
+ # independent of the value.
623
+ def set_all_data_callback_configuration(period, value_has_to_change)
624
+ check_validity
625
+
626
+ send_request FUNCTION_SET_ALL_DATA_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
627
+ end
628
+
629
+ # Returns the callback configuration as set by BrickletIMUV3#set_all_data_callback_configuration.
630
+ def get_all_data_callback_configuration
631
+ check_validity
632
+
633
+ send_request FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
634
+ end
635
+
636
+ # Returns the error count for the communication between Brick and Bricklet.
637
+ #
638
+ # The errors are divided into
639
+ #
640
+ # * ACK checksum errors,
641
+ # * message checksum errors,
642
+ # * framing errors and
643
+ # * overflow errors.
644
+ #
645
+ # The errors counts are for errors that occur on the Bricklet side. All
646
+ # Bricks have a similar function that returns the errors on the Brick side.
647
+ def get_spitfp_error_count
648
+ check_validity
649
+
650
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
651
+ end
652
+
653
+ # Sets the bootloader mode and returns the status after the requested
654
+ # mode change was instigated.
655
+ #
656
+ # You can change from bootloader mode to firmware mode and vice versa. A change
657
+ # from bootloader mode to firmware mode will only take place if the entry function,
658
+ # device identifier and CRC are present and correct.
659
+ #
660
+ # This function is used by Brick Viewer during flashing. It should not be
661
+ # necessary to call it in a normal user program.
662
+ def set_bootloader_mode(mode)
663
+ check_validity
664
+
665
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
666
+ end
667
+
668
+ # Returns the current bootloader mode, see BrickletIMUV3#set_bootloader_mode.
669
+ def get_bootloader_mode
670
+ check_validity
671
+
672
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
673
+ end
674
+
675
+ # Sets the firmware pointer for BrickletIMUV3#write_firmware. The pointer has
676
+ # to be increased by chunks of size 64. The data is written to flash
677
+ # every 4 chunks (which equals to one page of size 256).
678
+ #
679
+ # This function is used by Brick Viewer during flashing. It should not be
680
+ # necessary to call it in a normal user program.
681
+ def set_write_firmware_pointer(pointer)
682
+ check_validity
683
+
684
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
685
+ end
686
+
687
+ # Writes 64 Bytes of firmware at the position as written by
688
+ # BrickletIMUV3#set_write_firmware_pointer before. The firmware is written
689
+ # to flash every 4 chunks.
690
+ #
691
+ # You can only write firmware in bootloader mode.
692
+ #
693
+ # This function is used by Brick Viewer during flashing. It should not be
694
+ # necessary to call it in a normal user program.
695
+ def write_firmware(data)
696
+ check_validity
697
+
698
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
699
+ end
700
+
701
+ # Sets the status LED configuration. By default the LED shows
702
+ # communication traffic between Brick and Bricklet, it flickers once
703
+ # for every 10 received data packets.
704
+ #
705
+ # You can also turn the LED permanently on/off or show a heartbeat.
706
+ #
707
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
708
+ def set_status_led_config(config)
709
+ check_validity
710
+
711
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
712
+ end
713
+
714
+ # Returns the configuration as set by BrickletIMUV3#set_status_led_config
715
+ def get_status_led_config
716
+ check_validity
717
+
718
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
719
+ end
720
+
721
+ # Returns the temperature as measured inside the microcontroller. The
722
+ # value returned is not the ambient temperature!
723
+ #
724
+ # The temperature is only proportional to the real temperature and it has bad
725
+ # accuracy. Practically it is only useful as an indicator for
726
+ # temperature changes.
727
+ def get_chip_temperature
728
+ check_validity
729
+
730
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
731
+ end
732
+
733
+ # Calling this function will reset the Bricklet. All configurations
734
+ # will be lost.
735
+ #
736
+ # After a reset you have to create new device objects,
737
+ # calling functions on the existing ones will result in
738
+ # undefined behavior!
739
+ def reset
740
+ check_validity
741
+
742
+ send_request FUNCTION_RESET, [], '', 8, ''
743
+ end
744
+
745
+ # Writes a new UID into flash. If you want to set a new UID
746
+ # you have to decode the Base58 encoded UID string into an
747
+ # integer first.
748
+ #
749
+ # We recommend that you use Brick Viewer to change the UID.
750
+ def write_uid(uid)
751
+ check_validity
752
+
753
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
754
+ end
755
+
756
+ # Returns the current UID as an integer. Encode as
757
+ # Base58 to get the usual string version.
758
+ def read_uid
759
+ check_validity
760
+
761
+ send_request FUNCTION_READ_UID, [], '', 12, 'L'
762
+ end
763
+
764
+ # Returns the UID, the UID where the Bricklet is connected to,
765
+ # the position, the hardware and firmware version as well as the
766
+ # device identifier.
767
+ #
768
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
769
+ # A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
770
+ # position 'z'.
771
+ #
772
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
773
+ # |device_identifier_constant|
774
+ def get_identity
775
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
776
+ end
777
+
778
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
779
+ def register_callback(id, &block)
780
+ callback = block
781
+ @registered_callbacks[id] = callback
782
+ end
783
+ end
784
+ end