tinkerforge 2.1.15 → 2.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +2 -2
  3. data/lib/tinkerforge/brick_imu.rb +2 -2
  4. data/lib/tinkerforge/brick_imu_v2.rb +2 -2
  5. data/lib/tinkerforge/brick_master.rb +2 -2
  6. data/lib/tinkerforge/brick_red.rb +2 -2
  7. data/lib/tinkerforge/brick_servo.rb +2 -2
  8. data/lib/tinkerforge/brick_silent_stepper.rb +2 -2
  9. data/lib/tinkerforge/brick_stepper.rb +2 -2
  10. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  11. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  12. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  13. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  14. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  15. data/lib/tinkerforge/bricklet_analog_in_v3.rb +319 -0
  16. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  17. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  18. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  19. data/lib/tinkerforge/bricklet_can.rb +2 -2
  20. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  21. data/lib/tinkerforge/bricklet_color.rb +2 -2
  22. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  23. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  24. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  25. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  26. data/lib/tinkerforge/bricklet_dmx.rb +3 -3
  27. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  28. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  29. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  30. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  31. data/lib/tinkerforge/bricklet_gps_v2.rb +2 -2
  32. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  33. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  34. data/lib/tinkerforge/bricklet_humidity_v2.rb +2 -2
  35. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  36. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  37. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  38. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  39. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  40. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  41. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  42. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  43. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  44. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  45. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  46. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  47. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  48. data/lib/tinkerforge/bricklet_line.rb +2 -2
  49. data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
  50. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  51. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  52. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  53. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +261 -0
  54. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +2 -2
  55. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  56. data/lib/tinkerforge/bricklet_nfc.rb +998 -0
  57. data/lib/tinkerforge/bricklet_nfc_rfid.rb +5 -5
  58. data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
  59. data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
  60. data/lib/tinkerforge/bricklet_outdoor_weather.rb +390 -0
  61. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  62. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  63. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  64. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  65. data/lib/tinkerforge/bricklet_remote_switch.rb +3 -3
  66. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +403 -0
  67. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  68. data/lib/tinkerforge/bricklet_rgb_led_button.rb +3 -3
  69. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  70. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  71. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +284 -0
  72. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  73. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  74. data/lib/tinkerforge/bricklet_rs485.rb +2 -2
  75. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  76. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  77. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +247 -0
  78. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  79. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  80. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  81. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +369 -0
  82. data/lib/tinkerforge/bricklet_thermal_imaging.rb +5 -2
  83. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  84. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  85. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  86. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  87. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  88. data/lib/tinkerforge/version.rb +1 -1
  89. metadata +11 -3
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 #
@@ -0,0 +1,369 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2018-02-28. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.16 #
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 contactless object temperature between -70°C and +380°C
14
+ class BrickletTemperatureIRV2 < Device
15
+ DEVICE_IDENTIFIER = 291 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'Temperature IR Bricklet 2.0' # :nodoc:
17
+
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletTemperatureIRV2#set_ambient_temperature_callback_configuration.
20
+ #
21
+ # The `parameter` is the same as BrickletTemperatureIRV2#get_ambient_temperature.
22
+ CALLBACK_AMBIENT_TEMPERATURE = 4
23
+
24
+ # This callback is triggered periodically according to the configuration set by
25
+ # BrickletTemperatureIRV2#set_object_temperature_callback_configuration.
26
+ #
27
+ # The `parameter` is the same as BrickletTemperatureIRV2#get_object_temperature.
28
+ CALLBACK_OBJECT_TEMPERATURE = 8
29
+
30
+ FUNCTION_GET_AMBIENT_TEMPERATURE = 1 # :nodoc:
31
+ FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION = 2 # :nodoc:
32
+ FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION = 3 # :nodoc:
33
+ FUNCTION_GET_OBJECT_TEMPERATURE = 5 # :nodoc:
34
+ FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION = 6 # :nodoc:
35
+ FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION = 7 # :nodoc:
36
+ FUNCTION_SET_EMISSIVITY = 9 # :nodoc:
37
+ FUNCTION_GET_EMISSIVITY = 10 # :nodoc:
38
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
39
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
40
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
41
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
42
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
43
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
44
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
45
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
46
+ FUNCTION_RESET = 243 # :nodoc:
47
+ FUNCTION_WRITE_UID = 248 # :nodoc:
48
+ FUNCTION_READ_UID = 249 # :nodoc:
49
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
50
+
51
+ THRESHOLD_OPTION_OFF = 'x' # :nodoc:
52
+ THRESHOLD_OPTION_OUTSIDE = 'o' # :nodoc:
53
+ THRESHOLD_OPTION_INSIDE = 'i' # :nodoc:
54
+ THRESHOLD_OPTION_SMALLER = '<' # :nodoc:
55
+ THRESHOLD_OPTION_GREATER = '>' # :nodoc:
56
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
57
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
58
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
59
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
60
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
61
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
62
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
63
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
64
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
65
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
66
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
67
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
68
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
69
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
70
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
71
+
72
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
73
+ # the IP Connection <tt>ipcon</tt>.
74
+ def initialize(uid, ipcon)
75
+ super uid, ipcon
76
+
77
+ @api_version = [2, 0, 0]
78
+
79
+ @response_expected[FUNCTION_GET_AMBIENT_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
80
+ @response_expected[FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
81
+ @response_expected[FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
82
+ @response_expected[FUNCTION_GET_OBJECT_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
83
+ @response_expected[FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
84
+ @response_expected[FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
85
+ @response_expected[FUNCTION_SET_EMISSIVITY] = RESPONSE_EXPECTED_FALSE
86
+ @response_expected[FUNCTION_GET_EMISSIVITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
87
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
88
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
89
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
90
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
91
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
92
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
93
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
94
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
95
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
96
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
97
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
98
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
99
+
100
+ @callback_formats[CALLBACK_AMBIENT_TEMPERATURE] = 's'
101
+ @callback_formats[CALLBACK_OBJECT_TEMPERATURE] = 's'
102
+
103
+ end
104
+
105
+ # Returns the ambient temperature of the sensor. The value
106
+ # has a range of -400 to 1250 and is given in °C/10,
107
+ # e.g. a value of 423 means that an ambient temperature of 42.3 °C is
108
+ # measured.
109
+ #
110
+ # If you want to get the ambient temperature periodically, it is recommended
111
+ # to use the CALLBACK_AMBIENT_TEMPERATURE callback and set the period with
112
+ # BrickletTemperatureIRV2#set_ambient_temperature_callback_configuration.
113
+ #
114
+ #
115
+ # If you want to get the value periodically, it is recommended to use the
116
+ # CALLBACK_AMBIENT_TEMPERATURE callback. You can set the callback configuration
117
+ # with BrickletTemperatureIRV2#set_ambient_temperature_callback_configuration.
118
+ def get_ambient_temperature
119
+ send_request FUNCTION_GET_AMBIENT_TEMPERATURE, [], '', 2, 's'
120
+ end
121
+
122
+ # The period in ms is the period with which the CALLBACK_AMBIENT_TEMPERATURE callback is triggered
123
+ # periodically. A value of 0 turns the callback off.
124
+ #
125
+ # If the `value has to change`-parameter is set to true, the callback is only
126
+ # triggered after the value has changed. If the value didn't change
127
+ # within the period, the callback is triggered immediately on change.
128
+ #
129
+ # If it is set to false, the callback is continuously triggered with the period,
130
+ # independent of the value.
131
+ #
132
+ # It is furthermore possible to constrain the callback with thresholds.
133
+ #
134
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_AMBIENT_TEMPERATURE callback.
135
+ #
136
+ # The following options are possible:
137
+ #
138
+ # "Option", "Description"
139
+ #
140
+ # "'x'", "Threshold is turned off"
141
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
142
+ # "'i'", "Threshold is triggered when the value is *inside* the min and max values"
143
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
144
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
145
+ #
146
+ #
147
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
148
+ #
149
+ # The default value is (0, false, 'x', 0, 0).
150
+ def set_ambient_temperature_callback_configuration(period, value_has_to_change, option, min, max)
151
+ send_request FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k S S', 0, ''
152
+ end
153
+
154
+ # Returns the callback configuration as set by BrickletTemperatureIRV2#set_ambient_temperature_callback_configuration.
155
+ def get_ambient_temperature_callback_configuration
156
+ send_request FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k S S'
157
+ end
158
+
159
+ # Returns the object temperature of the sensor, i.e. the temperature
160
+ # of the surface of the object the sensor is aimed at. The value
161
+ # has a range of -700 to 3800 and is given in °C/10,
162
+ # e.g. a value of 3001 means that a temperature of 300.1 °C is measured
163
+ # on the surface of the object.
164
+ #
165
+ # The temperature of different materials is dependent on their `emissivity
166
+ # <https://en.wikipedia.org/wiki/Emissivity>`__. The emissivity of the material
167
+ # can be set with BrickletTemperatureIRV2#set_emissivity.
168
+ #
169
+ # If you want to get the object temperature periodically, it is recommended
170
+ # to use the CALLBACK_OBJECT_TEMPERATURE callback and set the period with
171
+ # BrickletTemperatureIRV2#set_object_temperature_callback_configuration.
172
+ #
173
+ #
174
+ # If you want to get the value periodically, it is recommended to use the
175
+ # CALLBACK_OBJECT_TEMPERATURE callback. You can set the callback configuration
176
+ # with BrickletTemperatureIRV2#set_object_temperature_callback_configuration.
177
+ def get_object_temperature
178
+ send_request FUNCTION_GET_OBJECT_TEMPERATURE, [], '', 2, 's'
179
+ end
180
+
181
+ # The period in ms is the period with which the CALLBACK_OBJECT_TEMPERATURE callback is triggered
182
+ # periodically. A value of 0 turns the callback off.
183
+ #
184
+ # If the `value has to change`-parameter is set to true, the callback is only
185
+ # triggered after the value has changed. If the value didn't change
186
+ # within the period, the callback is triggered immediately on change.
187
+ #
188
+ # If it is set to false, the callback is continuously triggered with the period,
189
+ # independent of the value.
190
+ #
191
+ # It is furthermore possible to constrain the callback with thresholds.
192
+ #
193
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_OBJECT_TEMPERATURE callback.
194
+ #
195
+ # The following options are possible:
196
+ #
197
+ # "Option", "Description"
198
+ #
199
+ # "'x'", "Threshold is turned off"
200
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
201
+ # "'i'", "Threshold is triggered when the value is *inside* the min and max values"
202
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
203
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
204
+ #
205
+ #
206
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
207
+ #
208
+ # The default value is (0, false, 'x', 0, 0).
209
+ def set_object_temperature_callback_configuration(period, value_has_to_change, option, min, max)
210
+ send_request FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k S S', 0, ''
211
+ end
212
+
213
+ # Returns the callback configuration as set by BrickletTemperatureIRV2#set_object_temperature_callback_configuration.
214
+ def get_object_temperature_callback_configuration
215
+ send_request FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k S S'
216
+ end
217
+
218
+ # Sets the `emissivity <https://en.wikipedia.org/wiki/Emissivity>`__ that is
219
+ # used to calculate the surface temperature as returned by
220
+ # BrickletTemperatureIRV2#get_object_temperature.
221
+ #
222
+ # The emissivity is usually given as a value between 0.0 and 1.0. A list of
223
+ # emissivities of different materials can be found
224
+ # `here <http://www.infrared-thermography.com/material.htm>`__.
225
+ #
226
+ # The parameter of BrickletTemperatureIRV2#set_emissivity has to be given with a factor of
227
+ # 65535 (16-bit). For example: An emissivity of 0.1 can be set with the
228
+ # value 6553, an emissivity of 0.5 with the value 32767 and so on.
229
+ #
230
+ # .. note::
231
+ # If you need a precise measurement for the object temperature, it is
232
+ # absolutely crucial that you also provide a precise emissivity.
233
+ #
234
+ # The default emissivity is 1.0 (value of 65535) and the minimum emissivity the
235
+ # sensor can handle is 0.1 (value of 6553).
236
+ def set_emissivity(emissivity)
237
+ send_request FUNCTION_SET_EMISSIVITY, [emissivity], 'S', 0, ''
238
+ end
239
+
240
+ # Returns the emissivity as set by BrickletTemperatureIRV2#set_emissivity.
241
+ def get_emissivity
242
+ send_request FUNCTION_GET_EMISSIVITY, [], '', 2, 'S'
243
+ end
244
+
245
+ # Returns the error count for the communication between Brick and Bricklet.
246
+ #
247
+ # The errors are divided into
248
+ #
249
+ # * ack checksum errors,
250
+ # * message checksum errors,
251
+ # * frameing errors and
252
+ # * overflow errors.
253
+ #
254
+ # The errors counts are for errors that occur on the Bricklet side. All
255
+ # Bricks have a similar function that returns the errors on the Brick side.
256
+ def get_spitfp_error_count
257
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
258
+ end
259
+
260
+ # Sets the bootloader mode and returns the status after the requested
261
+ # mode change was instigated.
262
+ #
263
+ # You can change from bootloader mode to firmware mode and vice versa. A change
264
+ # from bootloader mode to firmware mode will only take place if the entry function,
265
+ # device identifier und crc are present and correct.
266
+ #
267
+ # This function is used by Brick Viewer during flashing. It should not be
268
+ # necessary to call it in a normal user program.
269
+ def set_bootloader_mode(mode)
270
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
271
+ end
272
+
273
+ # Returns the current bootloader mode, see BrickletTemperatureIRV2#set_bootloader_mode.
274
+ def get_bootloader_mode
275
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
276
+ end
277
+
278
+ # Sets the firmware pointer for BrickletTemperatureIRV2#write_firmware. The pointer has
279
+ # to be increased by chunks of size 64. The data is written to flash
280
+ # every 4 chunks (which equals to one page of size 256).
281
+ #
282
+ # This function is used by Brick Viewer during flashing. It should not be
283
+ # necessary to call it in a normal user program.
284
+ def set_write_firmware_pointer(pointer)
285
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
286
+ end
287
+
288
+ # Writes 64 Bytes of firmware at the position as written by
289
+ # BrickletTemperatureIRV2#set_write_firmware_pointer before. The firmware is written
290
+ # to flash every 4 chunks.
291
+ #
292
+ # You can only write firmware in bootloader mode.
293
+ #
294
+ # This function is used by Brick Viewer during flashing. It should not be
295
+ # necessary to call it in a normal user program.
296
+ def write_firmware(data)
297
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
298
+ end
299
+
300
+ # Sets the status LED configuration. By default the LED shows
301
+ # communication traffic between Brick and Bricklet, it flickers once
302
+ # for every 10 received data packets.
303
+ #
304
+ # You can also turn the LED permanently on/off or show a heartbeat.
305
+ #
306
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
307
+ def set_status_led_config(config)
308
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
309
+ end
310
+
311
+ # Returns the configuration as set by BrickletTemperatureIRV2#set_status_led_config
312
+ def get_status_led_config
313
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
314
+ end
315
+
316
+ # Returns the temperature in °C as measured inside the microcontroller. The
317
+ # value returned is not the ambient temperature!
318
+ #
319
+ # The temperature is only proportional to the real temperature and it has bad
320
+ # accuracy. Practically it is only useful as an indicator for
321
+ # temperature changes.
322
+ def get_chip_temperature
323
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
324
+ end
325
+
326
+ # Calling this function will reset the Bricklet. All configurations
327
+ # will be lost.
328
+ #
329
+ # After a reset you have to create new device objects,
330
+ # calling functions on the existing ones will result in
331
+ # undefined behavior!
332
+ def reset
333
+ send_request FUNCTION_RESET, [], '', 0, ''
334
+ end
335
+
336
+ # Writes a new UID into flash. If you want to set a new UID
337
+ # you have to decode the Base58 encoded UID string into an
338
+ # integer first.
339
+ #
340
+ # We recommend that you use Brick Viewer to change the UID.
341
+ def write_uid(uid)
342
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
343
+ end
344
+
345
+ # Returns the current UID as an integer. Encode as
346
+ # Base58 to get the usual string version.
347
+ def read_uid
348
+ send_request FUNCTION_READ_UID, [], '', 4, 'L'
349
+ end
350
+
351
+ # Returns the UID, the UID where the Bricklet is connected to,
352
+ # the position, the hardware and firmware version as well as the
353
+ # device identifier.
354
+ #
355
+ # The position can be 'a', 'b', 'c' or 'd'.
356
+ #
357
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
358
+ # |device_identifier_constant|
359
+ def get_identity
360
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
361
+ end
362
+
363
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
364
+ def register_callback(id, &block)
365
+ callback = block
366
+ @registered_callbacks[id] = callback
367
+ end
368
+ end
369
+ end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 #
@@ -221,6 +221,9 @@ module Tinkerforge
221
221
  # * from 0 to 6553 Kelvin (-273.15°C to +6279.85°C) with 0.1°C resolution or
222
222
  # * from 0 to 655 Kelvin (-273.15°C to +381.85°C) with 0.01°C resolution.
223
223
  #
224
+ # The accuracy is specified for -10°C to 450°C in the
225
+ # first range and -10°C and 140°C in the second range.
226
+ #
224
227
  # The default value is 0 to 655 Kelvin.
225
228
  def set_resolution(resolution)
226
229
  send_request FUNCTION_SET_RESOLUTION, [resolution], 'C', 0, ''
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 2017-11-20. #
3
+ # This file was automatically generated on 2018-02-28. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.15 #
5
+ # Ruby Bindings Version 2.1.16 #
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 #