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
@@ -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 #
@@ -214,9 +214,9 @@ module Tinkerforge
214
214
  #
215
215
  # The errors are divided into
216
216
  #
217
- # * ack checksum errors,
217
+ # * ACK checksum errors,
218
218
  # * message checksum errors,
219
- # * frameing errors and
219
+ # * framing errors and
220
220
  # * overflow errors.
221
221
  #
222
222
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -230,7 +230,7 @@ module Tinkerforge
230
230
  #
231
231
  # You can change from bootloader mode to firmware mode and vice versa. A change
232
232
  # from bootloader mode to firmware mode will only take place if the entry function,
233
- # device identifier und crc are present and correct.
233
+ # device identifier and CRC are present and correct.
234
234
  #
235
235
  # This function is used by Brick Viewer during flashing. It should not be
236
236
  # necessary to call it in a normal user program.
@@ -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 #
@@ -920,9 +920,9 @@ module Tinkerforge
920
920
  #
921
921
  # The errors are divided into
922
922
  #
923
- # * ack checksum errors,
923
+ # * ACK checksum errors,
924
924
  # * message checksum errors,
925
- # * frameing errors and
925
+ # * framing errors and
926
926
  # * overflow errors.
927
927
  #
928
928
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -936,7 +936,7 @@ module Tinkerforge
936
936
  #
937
937
  # You can change from bootloader mode to firmware mode and vice versa. A change
938
938
  # from bootloader mode to firmware mode will only take place if the entry function,
939
- # device identifier und crc are present and correct.
939
+ # device identifier and CRC are present and correct.
940
940
  #
941
941
  # This function is used by Brick Viewer during flashing. It should not be
942
942
  # necessary to call it in a normal user program.
@@ -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 #
@@ -124,9 +124,9 @@ module Tinkerforge
124
124
  #
125
125
  # The errors are divided into
126
126
  #
127
- # * ack checksum errors,
127
+ # * ACK checksum errors,
128
128
  # * message checksum errors,
129
- # * frameing errors and
129
+ # * framing errors and
130
130
  # * overflow errors.
131
131
  #
132
132
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -140,7 +140,7 @@ module Tinkerforge
140
140
  #
141
141
  # You can change from bootloader mode to firmware mode and vice versa. A change
142
142
  # from bootloader mode to firmware mode will only take place if the entry function,
143
- # device identifier und crc are present and correct.
143
+ # device identifier and CRC are present and correct.
144
144
  #
145
145
  # This function is used by Brick Viewer during flashing. It should not be
146
146
  # necessary to call it in a normal user program.
@@ -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 #
@@ -22,13 +22,13 @@ module Tinkerforge
22
22
  CALLBACK_DECIBEL = 4
23
23
 
24
24
  # This callback is triggered periodically according to the configuration set by
25
- # BrickletSoundPressureLevel#set_spectrum_callback_configuration.
25
+ # BrickletSoundPressureLevel#set_spectrum_callback_configuration.
26
26
  #
27
27
  # The parameter is the same as BrickletSoundPressureLevel#get_spectrum.
28
28
  CALLBACK_SPECTRUM_LOW_LEVEL = 8
29
29
 
30
30
  # This callback is triggered periodically according to the configuration set by
31
- # BrickletSoundPressureLevel#set_spectrum_callback_configuration.
31
+ # BrickletSoundPressureLevel#set_spectrum_callback_configuration.
32
32
  #
33
33
  # The parameter is the same as BrickletSoundPressureLevel#get_spectrum.
34
34
  CALLBACK_SPECTRUM = -8
@@ -187,7 +187,7 @@ module Tinkerforge
187
187
  # dB(Z) if you need the unaltered spectrum.
188
188
  #
189
189
  # The values are not in dB form yet. If you want a proper dB scale of the
190
- # spectrum you have to apply the formula f(x) = 20*log10(max(1, x/sqrt(2)))
190
+ # spectrum you have to apply the formula f(x) = 20*log10(max(1, x/sqrt(2)))
191
191
  # on each value.
192
192
  def get_spectrum_low_level
193
193
  send_request FUNCTION_GET_SPECTRUM_LOW_LEVEL, [], '', 64, 'S S S30'
@@ -246,9 +246,9 @@ module Tinkerforge
246
246
  #
247
247
  # The errors are divided into
248
248
  #
249
- # * ack checksum errors,
249
+ # * ACK checksum errors,
250
250
  # * message checksum errors,
251
- # * frameing errors and
251
+ # * framing errors and
252
252
  # * overflow errors.
253
253
  #
254
254
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -262,7 +262,7 @@ module Tinkerforge
262
262
  #
263
263
  # You can change from bootloader mode to firmware mode and vice versa. A change
264
264
  # from bootloader mode to firmware mode will only take place if the entry function,
265
- # device identifier und crc are present and correct.
265
+ # device identifier and CRC are present and correct.
266
266
  #
267
267
  # This function is used by Brick Viewer during flashing. It should not be
268
268
  # necessary to call it in a normal user program.
@@ -376,7 +376,7 @@ module Tinkerforge
376
376
  # dB(Z) if you need the unaltered spectrum.
377
377
  #
378
378
  # The values are not in dB form yet. If you want a proper dB scale of the
379
- # spectrum you have to apply the formula f(x) = 20*log10(max(1, x/sqrt(2)))
379
+ # spectrum you have to apply the formula f(x) = 20*log10(max(1, x/sqrt(2)))
380
380
  # on each value.
381
381
  def get_spectrum
382
382
  spectrum_length = nil # assigned in block
@@ -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 #
@@ -244,9 +244,9 @@ module Tinkerforge
244
244
  #
245
245
  # The errors are divided into
246
246
  #
247
- # * ack checksum errors,
247
+ # * ACK checksum errors,
248
248
  # * message checksum errors,
249
- # * frameing errors and
249
+ # * framing errors and
250
250
  # * overflow errors.
251
251
  #
252
252
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -260,7 +260,7 @@ module Tinkerforge
260
260
  #
261
261
  # You can change from bootloader mode to firmware mode and vice versa. A change
262
262
  # from bootloader mode to firmware mode will only take place if the entry function,
263
- # device identifier und crc are present and correct.
263
+ # device identifier and CRC are present and correct.
264
264
  #
265
265
  # This function is used by Brick Viewer during flashing. It should not be
266
266
  # necessary to call it in a normal user program.
@@ -0,0 +1,278 @@
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 ambient temperature with 0.2°C accuracy
14
+ class BrickletTemperatureV2 < Device
15
+ DEVICE_IDENTIFIER = 2113 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'Temperature Bricklet 2.0' # :nodoc:
17
+
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletTemperatureV2#set_temperature_callback_configuration.
20
+ #
21
+ # The parameter is the same as BrickletTemperatureV2#get_temperature.
22
+ CALLBACK_TEMPERATURE = 4
23
+
24
+ FUNCTION_GET_TEMPERATURE = 1 # :nodoc:
25
+ FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION = 2 # :nodoc:
26
+ FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION = 3 # :nodoc:
27
+ FUNCTION_SET_HEATER_CONFIGURATION = 5 # :nodoc:
28
+ FUNCTION_GET_HEATER_CONFIGURATION = 6 # :nodoc:
29
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
30
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
31
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
32
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
33
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
34
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
35
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
36
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
37
+ FUNCTION_RESET = 243 # :nodoc:
38
+ FUNCTION_WRITE_UID = 248 # :nodoc:
39
+ FUNCTION_READ_UID = 249 # :nodoc:
40
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
41
+
42
+ THRESHOLD_OPTION_OFF = 'x' # :nodoc:
43
+ THRESHOLD_OPTION_OUTSIDE = 'o' # :nodoc:
44
+ THRESHOLD_OPTION_INSIDE = 'i' # :nodoc:
45
+ THRESHOLD_OPTION_SMALLER = '<' # :nodoc:
46
+ THRESHOLD_OPTION_GREATER = '>' # :nodoc:
47
+ HEATER_CONFIG_DISABLED = 0 # :nodoc:
48
+ HEATER_CONFIG_ENABLED = 1 # :nodoc:
49
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
50
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
51
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
52
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
53
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
54
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
55
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
56
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
57
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
58
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
59
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
60
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
61
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
62
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
63
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
64
+
65
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
66
+ # the IP Connection <tt>ipcon</tt>.
67
+ def initialize(uid, ipcon)
68
+ super uid, ipcon
69
+
70
+ @api_version = [2, 0, 0]
71
+
72
+ @response_expected[FUNCTION_GET_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
73
+ @response_expected[FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
74
+ @response_expected[FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
75
+ @response_expected[FUNCTION_SET_HEATER_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
76
+ @response_expected[FUNCTION_GET_HEATER_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
77
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
78
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
79
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
80
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
81
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
82
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
83
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
84
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
85
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
86
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
87
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
88
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
89
+
90
+ @callback_formats[CALLBACK_TEMPERATURE] = 's'
91
+
92
+ end
93
+
94
+ # Returns the temperature measured by the sensor. The value
95
+ # has a range of -4500 to 13000 and is given in °C/100,
96
+ # i.e. a value of 3200 means that a temperature of 32.00 °C is measured.
97
+ #
98
+ #
99
+ # If you want to get the value periodically, it is recommended to use the
100
+ # CALLBACK_TEMPERATURE callback. You can set the callback configuration
101
+ # with BrickletTemperatureV2#set_temperature_callback_configuration.
102
+ def get_temperature
103
+ send_request FUNCTION_GET_TEMPERATURE, [], '', 2, 's'
104
+ end
105
+
106
+ # The period in ms is the period with which the CALLBACK_TEMPERATURE callback is triggered
107
+ # periodically. A value of 0 turns the callback off.
108
+ #
109
+ # If the `value has to change`-parameter is set to true, the callback is only
110
+ # triggered after the value has changed. If the value didn't change
111
+ # within the period, the callback is triggered immediately on change.
112
+ #
113
+ # If it is set to false, the callback is continuously triggered with the period,
114
+ # independent of the value.
115
+ #
116
+ # It is furthermore possible to constrain the callback with thresholds.
117
+ #
118
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_TEMPERATURE callback.
119
+ #
120
+ # The following options are possible:
121
+ #
122
+ # "Option", "Description"
123
+ #
124
+ # "'x'", "Threshold is turned off"
125
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
126
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
127
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
128
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
129
+ #
130
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
131
+ #
132
+ # The default value is (0, false, 'x', 0, 0).
133
+ def set_temperature_callback_configuration(period, value_has_to_change, option, min, max)
134
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k s s', 0, ''
135
+ end
136
+
137
+ # Returns the callback configuration as set by BrickletTemperatureV2#set_temperature_callback_configuration.
138
+ def get_temperature_callback_configuration
139
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k s s'
140
+ end
141
+
142
+ # Enables/disables the heater. The heater can be used to test the sensor.
143
+ #
144
+ # By default the heater is disabled.
145
+ def set_heater_configuration(heater_config)
146
+ send_request FUNCTION_SET_HEATER_CONFIGURATION, [heater_config], 'C', 0, ''
147
+ end
148
+
149
+ # Returns the heater configuration as set by BrickletTemperatureV2#set_heater_configuration.
150
+ def get_heater_configuration
151
+ send_request FUNCTION_GET_HEATER_CONFIGURATION, [], '', 1, 'C'
152
+ end
153
+
154
+ # Returns the error count for the communication between Brick and Bricklet.
155
+ #
156
+ # The errors are divided into
157
+ #
158
+ # * ACK checksum errors,
159
+ # * message checksum errors,
160
+ # * framing errors and
161
+ # * overflow errors.
162
+ #
163
+ # The errors counts are for errors that occur on the Bricklet side. All
164
+ # Bricks have a similar function that returns the errors on the Brick side.
165
+ def get_spitfp_error_count
166
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
167
+ end
168
+
169
+ # Sets the bootloader mode and returns the status after the requested
170
+ # mode change was instigated.
171
+ #
172
+ # You can change from bootloader mode to firmware mode and vice versa. A change
173
+ # from bootloader mode to firmware mode will only take place if the entry function,
174
+ # device identifier and CRC are present and correct.
175
+ #
176
+ # This function is used by Brick Viewer during flashing. It should not be
177
+ # necessary to call it in a normal user program.
178
+ def set_bootloader_mode(mode)
179
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
180
+ end
181
+
182
+ # Returns the current bootloader mode, see BrickletTemperatureV2#set_bootloader_mode.
183
+ def get_bootloader_mode
184
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
185
+ end
186
+
187
+ # Sets the firmware pointer for BrickletTemperatureV2#write_firmware. The pointer has
188
+ # to be increased by chunks of size 64. The data is written to flash
189
+ # every 4 chunks (which equals to one page of size 256).
190
+ #
191
+ # This function is used by Brick Viewer during flashing. It should not be
192
+ # necessary to call it in a normal user program.
193
+ def set_write_firmware_pointer(pointer)
194
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
195
+ end
196
+
197
+ # Writes 64 Bytes of firmware at the position as written by
198
+ # BrickletTemperatureV2#set_write_firmware_pointer before. The firmware is written
199
+ # to flash every 4 chunks.
200
+ #
201
+ # You can only write firmware in bootloader mode.
202
+ #
203
+ # This function is used by Brick Viewer during flashing. It should not be
204
+ # necessary to call it in a normal user program.
205
+ def write_firmware(data)
206
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
207
+ end
208
+
209
+ # Sets the status LED configuration. By default the LED shows
210
+ # communication traffic between Brick and Bricklet, it flickers once
211
+ # for every 10 received data packets.
212
+ #
213
+ # You can also turn the LED permanently on/off or show a heartbeat.
214
+ #
215
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
216
+ def set_status_led_config(config)
217
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
218
+ end
219
+
220
+ # Returns the configuration as set by BrickletTemperatureV2#set_status_led_config
221
+ def get_status_led_config
222
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
223
+ end
224
+
225
+ # Returns the temperature in °C as measured inside the microcontroller. The
226
+ # value returned is not the ambient temperature!
227
+ #
228
+ # The temperature is only proportional to the real temperature and it has bad
229
+ # accuracy. Practically it is only useful as an indicator for
230
+ # temperature changes.
231
+ def get_chip_temperature
232
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
233
+ end
234
+
235
+ # Calling this function will reset the Bricklet. All configurations
236
+ # will be lost.
237
+ #
238
+ # After a reset you have to create new device objects,
239
+ # calling functions on the existing ones will result in
240
+ # undefined behavior!
241
+ def reset
242
+ send_request FUNCTION_RESET, [], '', 0, ''
243
+ end
244
+
245
+ # Writes a new UID into flash. If you want to set a new UID
246
+ # you have to decode the Base58 encoded UID string into an
247
+ # integer first.
248
+ #
249
+ # We recommend that you use Brick Viewer to change the UID.
250
+ def write_uid(uid)
251
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
252
+ end
253
+
254
+ # Returns the current UID as an integer. Encode as
255
+ # Base58 to get the usual string version.
256
+ def read_uid
257
+ send_request FUNCTION_READ_UID, [], '', 4, 'L'
258
+ end
259
+
260
+ # Returns the UID, the UID where the Bricklet is connected to,
261
+ # the position, the hardware and firmware version as well as the
262
+ # device identifier.
263
+ #
264
+ # The position can be 'a', 'b', 'c' or 'd'.
265
+ #
266
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
267
+ # |device_identifier_constant|
268
+ def get_identity
269
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
270
+ end
271
+
272
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
273
+ def register_callback(id, &block)
274
+ callback = block
275
+ @registered_callbacks[id] = callback
276
+ end
277
+ end
278
+ 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 #
@@ -332,9 +332,9 @@ module Tinkerforge
332
332
  #
333
333
  # The errors are divided into
334
334
  #
335
- # * ack checksum errors,
335
+ # * ACK checksum errors,
336
336
  # * message checksum errors,
337
- # * frameing errors and
337
+ # * framing errors and
338
338
  # * overflow errors.
339
339
  #
340
340
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -348,7 +348,7 @@ module Tinkerforge
348
348
  #
349
349
  # You can change from bootloader mode to firmware mode and vice versa. A change
350
350
  # from bootloader mode to firmware mode will only take place if the entry function,
351
- # device identifier und crc are present and correct.
351
+ # device identifier and CRC are present and correct.
352
352
  #
353
353
  # This function is used by Brick Viewer during flashing. It should not be
354
354
  # necessary to call it in a normal user program.
@@ -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 #
@@ -217,9 +217,9 @@ module Tinkerforge
217
217
  #
218
218
  # The errors are divided into
219
219
  #
220
- # * ack checksum errors,
220
+ # * ACK checksum errors,
221
221
  # * message checksum errors,
222
- # * frameing errors and
222
+ # * framing errors and
223
223
  # * overflow errors.
224
224
  #
225
225
  # The errors counts are for errors that occur on the Bricklet side. All
@@ -233,7 +233,7 @@ module Tinkerforge
233
233
  #
234
234
  # You can change from bootloader mode to firmware mode and vice versa. A change
235
235
  # from bootloader mode to firmware mode will only take place if the entry function,
236
- # device identifier und crc are present and correct.
236
+ # device identifier and CRC are present and correct.
237
237
  #
238
238
  # This function is used by Brick Viewer during flashing. It should not be
239
239
  # necessary to call it in a normal user program.
@@ -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 #
@@ -68,10 +68,11 @@ module Tinkerforge
68
68
  end
69
69
 
70
70
  # Returns the UV light intensity of the sensor, the intensity is given
71
- # in µW/cm².
71
+ # in 1/10 mW/m². The sensor has already weighted the intensity with the erythemal
72
+ # action spectrum to get the skin-affecting irradiation.
72
73
  #
73
- # To get UV Index you have to divide the value by 250. For example, a UV Light
74
- # intensity of 500µW/cm² is equivalent to an UV Index of 2.
74
+ # To get UV index you just have to divide the value by 250. For example, a UV
75
+ # light intensity of 500 is equivalent to an UV index of 2.
75
76
  #
76
77
  # If you want to get the intensity periodically, it is recommended to use the
77
78
  # CALLBACK_UV_LIGHT callback and set the period with