tinkerforge 2.1.17 → 2.1.18

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +6 -6
  3. data/lib/tinkerforge/brick_imu.rb +6 -6
  4. data/lib/tinkerforge/brick_imu_v2.rb +13 -6
  5. data/lib/tinkerforge/brick_master.rb +6 -6
  6. data/lib/tinkerforge/brick_red.rb +2 -2
  7. data/lib/tinkerforge/brick_servo.rb +9 -7
  8. data/lib/tinkerforge/brick_silent_stepper.rb +13 -13
  9. data/lib/tinkerforge/brick_stepper.rb +6 -6
  10. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  11. data/lib/tinkerforge/bricklet_air_quality.rb +514 -0
  12. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  13. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  14. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  15. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  16. data/lib/tinkerforge/bricklet_analog_in_v3.rb +5 -5
  17. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  18. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  19. data/lib/tinkerforge/bricklet_analog_out_v3.rb +210 -0
  20. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  21. data/lib/tinkerforge/bricklet_barometer_v2.rb +497 -0
  22. data/lib/tinkerforge/bricklet_can.rb +2 -2
  23. data/lib/tinkerforge/bricklet_can_v2.rb +5 -5
  24. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  25. data/lib/tinkerforge/bricklet_color.rb +2 -2
  26. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  27. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  28. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  29. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +398 -0
  30. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  31. data/lib/tinkerforge/bricklet_dmx.rb +7 -5
  32. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  33. data/lib/tinkerforge/bricklet_dual_button_v2.rb +283 -0
  34. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  35. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  36. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  37. data/lib/tinkerforge/bricklet_gps_v2.rb +6 -6
  38. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  39. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  40. data/lib/tinkerforge/bricklet_humidity_v2.rb +5 -5
  41. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  42. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +336 -0
  43. data/lib/tinkerforge/bricklet_industrial_counter.rb +12 -12
  44. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  45. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +7 -7
  46. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  47. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +302 -0
  48. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  49. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +382 -0
  50. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  51. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +374 -0
  52. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +5 -5
  53. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  54. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +11 -11
  55. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  56. data/lib/tinkerforge/bricklet_io16_v2.rb +418 -0
  57. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  58. data/lib/tinkerforge/bricklet_io4_v2.rb +6 -6
  59. data/lib/tinkerforge/bricklet_isolator.rb +282 -0
  60. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  61. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  62. data/lib/tinkerforge/bricklet_lcd_128x64.rb +486 -0
  63. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  64. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  65. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  66. data/lib/tinkerforge/bricklet_led_strip_v2.rb +8 -8
  67. data/lib/tinkerforge/bricklet_line.rb +2 -2
  68. data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
  69. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  70. data/lib/tinkerforge/bricklet_load_cell_v2.rb +5 -5
  71. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  72. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  73. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +6 -6
  74. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +5 -5
  75. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  76. data/lib/tinkerforge/bricklet_nfc.rb +6 -6
  77. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  78. data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
  79. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +387 -0
  80. data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
  81. data/lib/tinkerforge/bricklet_one_wire.rb +305 -0
  82. data/lib/tinkerforge/bricklet_outdoor_weather.rb +5 -5
  83. data/lib/tinkerforge/bricklet_particulate_matter.rb +5 -5
  84. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  85. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  86. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  87. data/lib/tinkerforge/bricklet_ptc_v2.rb +5 -5
  88. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  89. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +5 -5
  90. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  91. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +5 -5
  92. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  93. data/lib/tinkerforge/bricklet_rgb_led_button.rb +5 -5
  94. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +5 -5
  95. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  96. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +5 -5
  97. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  98. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  99. data/lib/tinkerforge/bricklet_rs232_v2.rb +5 -5
  100. data/lib/tinkerforge/bricklet_rs485.rb +5 -5
  101. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  102. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  103. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +5 -5
  104. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  105. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +9 -9
  106. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  107. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  108. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +5 -5
  109. data/lib/tinkerforge/bricklet_temperature_v2.rb +278 -0
  110. data/lib/tinkerforge/bricklet_thermal_imaging.rb +5 -5
  111. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  112. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +5 -5
  113. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  114. data/lib/tinkerforge/bricklet_uv_light.rb +6 -5
  115. data/lib/tinkerforge/bricklet_uv_light_v2.rb +430 -0
  116. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  117. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  118. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +5 -5
  119. data/lib/tinkerforge/version.rb +1 -1
  120. metadata +18 -2
@@ -0,0 +1,430 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2018-09-28. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.18 #
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
+ module Tinkerforge
13
+ # Measures UV light
14
+ class BrickletUVLightV2 < Device
15
+ DEVICE_IDENTIFIER = 2118 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'UV Light Bricklet 2.0' # :nodoc:
17
+
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletUVLightV2#set_uva_callback_configuration.
20
+ #
21
+ # The parameter is the same as BrickletUVLightV2#get_uva.
22
+ CALLBACK_UVA = 4
23
+
24
+ # This callback is triggered periodically according to the configuration set by
25
+ # BrickletUVLightV2#set_uvb_callback_configuration.
26
+ #
27
+ # The parameter is the same as BrickletUVLightV2#get_uvb.
28
+ CALLBACK_UVB = 8
29
+
30
+ # This callback is triggered periodically according to the configuration set by
31
+ # BrickletUVLightV2#set_uvi_callback_configuration.
32
+ #
33
+ # The parameter is the same as BrickletUVLightV2#get_uvi.
34
+ CALLBACK_UVI = 12
35
+
36
+ FUNCTION_GET_UVA = 1 # :nodoc:
37
+ FUNCTION_SET_UVA_CALLBACK_CONFIGURATION = 2 # :nodoc:
38
+ FUNCTION_GET_UVA_CALLBACK_CONFIGURATION = 3 # :nodoc:
39
+ FUNCTION_GET_UVB = 5 # :nodoc:
40
+ FUNCTION_SET_UVB_CALLBACK_CONFIGURATION = 6 # :nodoc:
41
+ FUNCTION_GET_UVB_CALLBACK_CONFIGURATION = 7 # :nodoc:
42
+ FUNCTION_GET_UVI = 9 # :nodoc:
43
+ FUNCTION_SET_UVI_CALLBACK_CONFIGURATION = 10 # :nodoc:
44
+ FUNCTION_GET_UVI_CALLBACK_CONFIGURATION = 11 # :nodoc:
45
+ FUNCTION_SET_CONFIGURATION = 13 # :nodoc:
46
+ FUNCTION_GET_CONFIGURATION = 14 # :nodoc:
47
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
48
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
49
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
50
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
51
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
52
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
53
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
54
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
55
+ FUNCTION_RESET = 243 # :nodoc:
56
+ FUNCTION_WRITE_UID = 248 # :nodoc:
57
+ FUNCTION_READ_UID = 249 # :nodoc:
58
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
59
+
60
+ THRESHOLD_OPTION_OFF = 'x' # :nodoc:
61
+ THRESHOLD_OPTION_OUTSIDE = 'o' # :nodoc:
62
+ THRESHOLD_OPTION_INSIDE = 'i' # :nodoc:
63
+ THRESHOLD_OPTION_SMALLER = '<' # :nodoc:
64
+ THRESHOLD_OPTION_GREATER = '>' # :nodoc:
65
+ INTEGRATION_TIME_50MS = 0 # :nodoc:
66
+ INTEGRATION_TIME_100MS = 1 # :nodoc:
67
+ INTEGRATION_TIME_200MS = 2 # :nodoc:
68
+ INTEGRATION_TIME_400MS = 3 # :nodoc:
69
+ INTEGRATION_TIME_800MS = 4 # :nodoc:
70
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
71
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
72
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
73
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
74
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
75
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
76
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
77
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
78
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
79
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
80
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
81
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
82
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
83
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
84
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
85
+
86
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
87
+ # the IP Connection <tt>ipcon</tt>.
88
+ def initialize(uid, ipcon)
89
+ super uid, ipcon
90
+
91
+ @api_version = [2, 0, 0]
92
+
93
+ @response_expected[FUNCTION_GET_UVA] = RESPONSE_EXPECTED_ALWAYS_TRUE
94
+ @response_expected[FUNCTION_SET_UVA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
95
+ @response_expected[FUNCTION_GET_UVA_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
96
+ @response_expected[FUNCTION_GET_UVB] = RESPONSE_EXPECTED_ALWAYS_TRUE
97
+ @response_expected[FUNCTION_SET_UVB_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
98
+ @response_expected[FUNCTION_GET_UVB_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
99
+ @response_expected[FUNCTION_GET_UVI] = RESPONSE_EXPECTED_ALWAYS_TRUE
100
+ @response_expected[FUNCTION_SET_UVI_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
101
+ @response_expected[FUNCTION_GET_UVI_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
102
+ @response_expected[FUNCTION_SET_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
103
+ @response_expected[FUNCTION_GET_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
104
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
105
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
106
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
107
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
108
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
109
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
110
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
111
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
112
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
113
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
114
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
115
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
116
+
117
+ @callback_formats[CALLBACK_UVA] = 'l'
118
+ @callback_formats[CALLBACK_UVB] = 'l'
119
+ @callback_formats[CALLBACK_UVI] = 'l'
120
+
121
+ end
122
+
123
+ # Returns the UVA intensity of the sensor, the intensity is given
124
+ # in 1/10 mW/m². The sensor has not weighted the intensity with the erythemal
125
+ # action spectrum to get the skin-affecting irradiation. Therefore, you cannot
126
+ # just divide the value by 250 to get the UVA index. To get the UV index use
127
+ # BrickletUVLightV2#get_uvi.
128
+ #
129
+ # If the sensor is saturated, then -1 is returned, see BrickletUVLightV2#set_configuration.
130
+ #
131
+ # If you want to get the intensity periodically, it is recommended to use the
132
+ # CALLBACK_UVA callback and set the period with
133
+ # BrickletUVLightV2#set_uva_callback_configuration.
134
+ #
135
+ #
136
+ # If you want to get the value periodically, it is recommended to use the
137
+ # CALLBACK_UVA callback. You can set the callback configuration
138
+ # with BrickletUVLightV2#set_uva_callback_configuration.
139
+ def get_uva
140
+ send_request FUNCTION_GET_UVA, [], '', 4, 'l'
141
+ end
142
+
143
+ # The period in ms is the period with which the CALLBACK_UVA callback is triggered
144
+ # periodically. A value of 0 turns the callback off.
145
+ #
146
+ # If the `value has to change`-parameter is set to true, the callback is only
147
+ # triggered after the value has changed. If the value didn't change
148
+ # within the period, the callback is triggered immediately on change.
149
+ #
150
+ # If it is set to false, the callback is continuously triggered with the period,
151
+ # independent of the value.
152
+ #
153
+ # It is furthermore possible to constrain the callback with thresholds.
154
+ #
155
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_UVA callback.
156
+ #
157
+ # The following options are possible:
158
+ #
159
+ # "Option", "Description"
160
+ #
161
+ # "'x'", "Threshold is turned off"
162
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
163
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
164
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
165
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
166
+ #
167
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
168
+ #
169
+ # The default value is (0, false, 'x', 0, 0).
170
+ def set_uva_callback_configuration(period, value_has_to_change, option, min, max)
171
+ send_request FUNCTION_SET_UVA_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k l l', 0, ''
172
+ end
173
+
174
+ # Returns the callback configuration as set by BrickletUVLightV2#set_uva_callback_configuration.
175
+ def get_uva_callback_configuration
176
+ send_request FUNCTION_GET_UVA_CALLBACK_CONFIGURATION, [], '', 14, 'L ? k l l'
177
+ end
178
+
179
+ # Returns the UVB intensity of the sensor, the intensity is given
180
+ # in 1/10 mW/m². The sensor has not weighted the intensity with the erythemal
181
+ # action spectrum to get the skin-affecting irradiation. Therefore, you cannot
182
+ # just divide the value by 250 to get the UVB index. To get the UV index use
183
+ # BrickletUVLightV2#get_uvi.
184
+ #
185
+ # If the sensor is saturated, then -1 is returned, see BrickletUVLightV2#set_configuration.
186
+ #
187
+ # If you want to get the intensity periodically, it is recommended to use the
188
+ # CALLBACK_UVB callback and set the period with
189
+ # BrickletUVLightV2#set_uvb_callback_configuration.
190
+ #
191
+ #
192
+ # If you want to get the value periodically, it is recommended to use the
193
+ # CALLBACK_UVB callback. You can set the callback configuration
194
+ # with BrickletUVLightV2#set_uvb_callback_configuration.
195
+ def get_uvb
196
+ send_request FUNCTION_GET_UVB, [], '', 4, 'l'
197
+ end
198
+
199
+ # The period in ms is the period with which the CALLBACK_UVB callback is triggered
200
+ # periodically. A value of 0 turns the callback off.
201
+ #
202
+ # If the `value has to change`-parameter is set to true, the callback is only
203
+ # triggered after the value has changed. If the value didn't change
204
+ # within the period, the callback is triggered immediately on change.
205
+ #
206
+ # If it is set to false, the callback is continuously triggered with the period,
207
+ # independent of the value.
208
+ #
209
+ # It is furthermore possible to constrain the callback with thresholds.
210
+ #
211
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_UVB callback.
212
+ #
213
+ # The following options are possible:
214
+ #
215
+ # "Option", "Description"
216
+ #
217
+ # "'x'", "Threshold is turned off"
218
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
219
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
220
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
221
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
222
+ #
223
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
224
+ #
225
+ # The default value is (0, false, 'x', 0, 0).
226
+ def set_uvb_callback_configuration(period, value_has_to_change, option, min, max)
227
+ send_request FUNCTION_SET_UVB_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k l l', 0, ''
228
+ end
229
+
230
+ # Returns the callback configuration as set by BrickletUVLightV2#set_uvb_callback_configuration.
231
+ def get_uvb_callback_configuration
232
+ send_request FUNCTION_GET_UVB_CALLBACK_CONFIGURATION, [], '', 14, 'L ? k l l'
233
+ end
234
+
235
+ # Returns the UV index of the sensor, the index is given in 1/10.
236
+ #
237
+ # If the sensor is saturated, then -1 is returned, see BrickletUVLightV2#set_configuration.
238
+ #
239
+ # If you want to get the intensity periodically, it is recommended to use the
240
+ # CALLBACK_UVI callback and set the period with
241
+ # BrickletUVLightV2#set_uvi_callback_configuration.
242
+ #
243
+ #
244
+ # If you want to get the value periodically, it is recommended to use the
245
+ # CALLBACK_UVI callback. You can set the callback configuration
246
+ # with BrickletUVLightV2#set_uvi_callback_configuration.
247
+ def get_uvi
248
+ send_request FUNCTION_GET_UVI, [], '', 4, 'l'
249
+ end
250
+
251
+ # The period in ms is the period with which the CALLBACK_UVI callback is triggered
252
+ # periodically. A value of 0 turns the callback off.
253
+ #
254
+ # If the `value has to change`-parameter is set to true, the callback is only
255
+ # triggered after the value has changed. If the value didn't change
256
+ # within the period, the callback is triggered immediately on change.
257
+ #
258
+ # If it is set to false, the callback is continuously triggered with the period,
259
+ # independent of the value.
260
+ #
261
+ # It is furthermore possible to constrain the callback with thresholds.
262
+ #
263
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_UVI callback.
264
+ #
265
+ # The following options are possible:
266
+ #
267
+ # "Option", "Description"
268
+ #
269
+ # "'x'", "Threshold is turned off"
270
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
271
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
272
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
273
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
274
+ #
275
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
276
+ #
277
+ # The default value is (0, false, 'x', 0, 0).
278
+ def set_uvi_callback_configuration(period, value_has_to_change, option, min, max)
279
+ send_request FUNCTION_SET_UVI_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k l l', 0, ''
280
+ end
281
+
282
+ # Returns the callback configuration as set by BrickletUVLightV2#set_uvi_callback_configuration.
283
+ def get_uvi_callback_configuration
284
+ send_request FUNCTION_GET_UVI_CALLBACK_CONFIGURATION, [], '', 14, 'L ? k l l'
285
+ end
286
+
287
+ # Sets the configuration of the sensor. The integration time can be configured
288
+ # between 50 and 800 ms. With a shorter integration time the sensor reading updates
289
+ # more often but contains more noise. With a longer integration the sensor reading
290
+ # contains less noise but updates less often.
291
+ #
292
+ # With a longer integration time (especially 800 ms) and a higher UV intensity the
293
+ # sensor can be saturated. If this happens the UVA/UVB/UVI readings are all -1.
294
+ # In this case you need to choose a shorter integration time.
295
+ #
296
+ # Default value: 400 ms.
297
+ def set_configuration(integration_time)
298
+ send_request FUNCTION_SET_CONFIGURATION, [integration_time], 'C', 0, ''
299
+ end
300
+
301
+ # Returns the configuration as set by BrickletUVLightV2#set_configuration.
302
+ def get_configuration
303
+ send_request FUNCTION_GET_CONFIGURATION, [], '', 1, 'C'
304
+ end
305
+
306
+ # Returns the error count for the communication between Brick and Bricklet.
307
+ #
308
+ # The errors are divided into
309
+ #
310
+ # * ACK checksum errors,
311
+ # * message checksum errors,
312
+ # * framing errors and
313
+ # * overflow errors.
314
+ #
315
+ # The errors counts are for errors that occur on the Bricklet side. All
316
+ # Bricks have a similar function that returns the errors on the Brick side.
317
+ def get_spitfp_error_count
318
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
319
+ end
320
+
321
+ # Sets the bootloader mode and returns the status after the requested
322
+ # mode change was instigated.
323
+ #
324
+ # You can change from bootloader mode to firmware mode and vice versa. A change
325
+ # from bootloader mode to firmware mode will only take place if the entry function,
326
+ # device identifier and CRC are present and correct.
327
+ #
328
+ # This function is used by Brick Viewer during flashing. It should not be
329
+ # necessary to call it in a normal user program.
330
+ def set_bootloader_mode(mode)
331
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
332
+ end
333
+
334
+ # Returns the current bootloader mode, see BrickletUVLightV2#set_bootloader_mode.
335
+ def get_bootloader_mode
336
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
337
+ end
338
+
339
+ # Sets the firmware pointer for BrickletUVLightV2#write_firmware. The pointer has
340
+ # to be increased by chunks of size 64. The data is written to flash
341
+ # every 4 chunks (which equals to one page of size 256).
342
+ #
343
+ # This function is used by Brick Viewer during flashing. It should not be
344
+ # necessary to call it in a normal user program.
345
+ def set_write_firmware_pointer(pointer)
346
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
347
+ end
348
+
349
+ # Writes 64 Bytes of firmware at the position as written by
350
+ # BrickletUVLightV2#set_write_firmware_pointer before. The firmware is written
351
+ # to flash every 4 chunks.
352
+ #
353
+ # You can only write firmware in bootloader mode.
354
+ #
355
+ # This function is used by Brick Viewer during flashing. It should not be
356
+ # necessary to call it in a normal user program.
357
+ def write_firmware(data)
358
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
359
+ end
360
+
361
+ # Sets the status LED configuration. By default the LED shows
362
+ # communication traffic between Brick and Bricklet, it flickers once
363
+ # for every 10 received data packets.
364
+ #
365
+ # You can also turn the LED permanently on/off or show a heartbeat.
366
+ #
367
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
368
+ def set_status_led_config(config)
369
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
370
+ end
371
+
372
+ # Returns the configuration as set by BrickletUVLightV2#set_status_led_config
373
+ def get_status_led_config
374
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
375
+ end
376
+
377
+ # Returns the temperature in °C as measured inside the microcontroller. The
378
+ # value returned is not the ambient temperature!
379
+ #
380
+ # The temperature is only proportional to the real temperature and it has bad
381
+ # accuracy. Practically it is only useful as an indicator for
382
+ # temperature changes.
383
+ def get_chip_temperature
384
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
385
+ end
386
+
387
+ # Calling this function will reset the Bricklet. All configurations
388
+ # will be lost.
389
+ #
390
+ # After a reset you have to create new device objects,
391
+ # calling functions on the existing ones will result in
392
+ # undefined behavior!
393
+ def reset
394
+ send_request FUNCTION_RESET, [], '', 0, ''
395
+ end
396
+
397
+ # Writes a new UID into flash. If you want to set a new UID
398
+ # you have to decode the Base58 encoded UID string into an
399
+ # integer first.
400
+ #
401
+ # We recommend that you use Brick Viewer to change the UID.
402
+ def write_uid(uid)
403
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
404
+ end
405
+
406
+ # Returns the current UID as an integer. Encode as
407
+ # Base58 to get the usual string version.
408
+ def read_uid
409
+ send_request FUNCTION_READ_UID, [], '', 4, 'L'
410
+ end
411
+
412
+ # Returns the UID, the UID where the Bricklet is connected to,
413
+ # the position, the hardware and firmware version as well as the
414
+ # device identifier.
415
+ #
416
+ # The position can be 'a', 'b', 'c' or 'd'.
417
+ #
418
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
419
+ # |device_identifier_constant|
420
+ def get_identity
421
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
422
+ end
423
+
424
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
425
+ def register_callback(id, &block)
426
+ callback = block
427
+ @registered_callbacks[id] = callback
428
+ end
429
+ end
430
+ end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-06-08. #
3
+ # This file was automatically generated on 2018-09-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.17 #
5
+ # Ruby Bindings Version 2.1.18 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-06-08. #
3
+ # This file was automatically generated on 2018-09-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.17 #
5
+ # Ruby Bindings Version 2.1.18 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2018-06-08. #
3
+ # This file was automatically generated on 2018-09-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.17 #
5
+ # Ruby Bindings Version 2.1.18 #
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 #
@@ -330,9 +330,9 @@ module Tinkerforge
330
330
  #
331
331
  # The errors are divided into
332
332
  #
333
- # * ack checksum errors,
333
+ # * ACK checksum errors,
334
334
  # * message checksum errors,
335
- # * frameing errors and
335
+ # * framing errors and
336
336
  # * overflow errors.
337
337
  #
338
338
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -346,7 +346,7 @@ module Tinkerforge
346
346
  #
347
347
  # You can change from bootloader mode to firmware mode and vice versa. A change
348
348
  # from bootloader mode to firmware mode will only take place if the entry function,
349
- # device identifier und crc are present and correct.
349
+ # device identifier and CRC are present and correct.
350
350
  #
351
351
  # This function is used by Brick Viewer during flashing. It should not be
352
352
  # necessary to call it in a normal user program.
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Tinkerforge
3
- VERSION = '2.1.17'
3
+ VERSION = '2.1.18'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinkerforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.17
4
+ version: 2.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Bolte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-08 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: matthias@tinkerforge.com
@@ -26,6 +26,7 @@ files:
26
26
  - lib/tinkerforge/brick_silent_stepper.rb
27
27
  - lib/tinkerforge/brick_stepper.rb
28
28
  - lib/tinkerforge/bricklet_accelerometer.rb
29
+ - lib/tinkerforge/bricklet_air_quality.rb
29
30
  - lib/tinkerforge/bricklet_ambient_light.rb
30
31
  - lib/tinkerforge/bricklet_ambient_light_v2.rb
31
32
  - lib/tinkerforge/bricklet_analog_in.rb
@@ -33,7 +34,9 @@ files:
33
34
  - lib/tinkerforge/bricklet_analog_in_v3.rb
34
35
  - lib/tinkerforge/bricklet_analog_out.rb
35
36
  - lib/tinkerforge/bricklet_analog_out_v2.rb
37
+ - lib/tinkerforge/bricklet_analog_out_v3.rb
36
38
  - lib/tinkerforge/bricklet_barometer.rb
39
+ - lib/tinkerforge/bricklet_barometer_v2.rb
37
40
  - lib/tinkerforge/bricklet_can.rb
38
41
  - lib/tinkerforge/bricklet_can_v2.rb
39
42
  - lib/tinkerforge/bricklet_co2.rb
@@ -41,9 +44,11 @@ files:
41
44
  - lib/tinkerforge/bricklet_current12.rb
42
45
  - lib/tinkerforge/bricklet_current25.rb
43
46
  - lib/tinkerforge/bricklet_distance_ir.rb
47
+ - lib/tinkerforge/bricklet_distance_ir_v2.rb
44
48
  - lib/tinkerforge/bricklet_distance_us.rb
45
49
  - lib/tinkerforge/bricklet_dmx.rb
46
50
  - lib/tinkerforge/bricklet_dual_button.rb
51
+ - lib/tinkerforge/bricklet_dual_button_v2.rb
47
52
  - lib/tinkerforge/bricklet_dual_relay.rb
48
53
  - lib/tinkerforge/bricklet_dust_detector.rb
49
54
  - lib/tinkerforge/bricklet_gps.rb
@@ -52,20 +57,27 @@ files:
52
57
  - lib/tinkerforge/bricklet_humidity.rb
53
58
  - lib/tinkerforge/bricklet_humidity_v2.rb
54
59
  - lib/tinkerforge/bricklet_industrial_analog_out.rb
60
+ - lib/tinkerforge/bricklet_industrial_analog_out_v2.rb
55
61
  - lib/tinkerforge/bricklet_industrial_counter.rb
56
62
  - lib/tinkerforge/bricklet_industrial_digital_in_4.rb
57
63
  - lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb
58
64
  - lib/tinkerforge/bricklet_industrial_digital_out_4.rb
65
+ - lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb
59
66
  - lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb
67
+ - lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb
60
68
  - lib/tinkerforge/bricklet_industrial_dual_analog_in.rb
69
+ - lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb
61
70
  - lib/tinkerforge/bricklet_industrial_dual_relay.rb
62
71
  - lib/tinkerforge/bricklet_industrial_quad_relay.rb
63
72
  - lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb
64
73
  - lib/tinkerforge/bricklet_io16.rb
74
+ - lib/tinkerforge/bricklet_io16_v2.rb
65
75
  - lib/tinkerforge/bricklet_io4.rb
66
76
  - lib/tinkerforge/bricklet_io4_v2.rb
77
+ - lib/tinkerforge/bricklet_isolator.rb
67
78
  - lib/tinkerforge/bricklet_joystick.rb
68
79
  - lib/tinkerforge/bricklet_laser_range_finder.rb
80
+ - lib/tinkerforge/bricklet_lcd_128x64.rb
69
81
  - lib/tinkerforge/bricklet_lcd_16x2.rb
70
82
  - lib/tinkerforge/bricklet_lcd_20x4.rb
71
83
  - lib/tinkerforge/bricklet_led_strip.rb
@@ -82,7 +94,9 @@ files:
82
94
  - lib/tinkerforge/bricklet_nfc.rb
83
95
  - lib/tinkerforge/bricklet_nfc_rfid.rb
84
96
  - lib/tinkerforge/bricklet_oled_128x64.rb
97
+ - lib/tinkerforge/bricklet_oled_128x64_v2.rb
85
98
  - lib/tinkerforge/bricklet_oled_64x48.rb
99
+ - lib/tinkerforge/bricklet_one_wire.rb
86
100
  - lib/tinkerforge/bricklet_outdoor_weather.rb
87
101
  - lib/tinkerforge/bricklet_particulate_matter.rb
88
102
  - lib/tinkerforge/bricklet_piezo_buzzer.rb
@@ -110,11 +124,13 @@ files:
110
124
  - lib/tinkerforge/bricklet_temperature.rb
111
125
  - lib/tinkerforge/bricklet_temperature_ir.rb
112
126
  - lib/tinkerforge/bricklet_temperature_ir_v2.rb
127
+ - lib/tinkerforge/bricklet_temperature_v2.rb
113
128
  - lib/tinkerforge/bricklet_thermal_imaging.rb
114
129
  - lib/tinkerforge/bricklet_thermocouple.rb
115
130
  - lib/tinkerforge/bricklet_thermocouple_v2.rb
116
131
  - lib/tinkerforge/bricklet_tilt.rb
117
132
  - lib/tinkerforge/bricklet_uv_light.rb
133
+ - lib/tinkerforge/bricklet_uv_light_v2.rb
118
134
  - lib/tinkerforge/bricklet_voltage.rb
119
135
  - lib/tinkerforge/bricklet_voltage_current.rb
120
136
  - lib/tinkerforge/bricklet_voltage_current_v2.rb