tinkerforge 2.1.13 → 2.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/lib/tinkerforge/brick_dc.rb +122 -34
  2. data/lib/tinkerforge/brick_imu.rb +135 -49
  3. data/lib/tinkerforge/brick_imu_v2.rb +137 -54
  4. data/lib/tinkerforge/brick_master.rb +206 -120
  5. data/lib/tinkerforge/brick_red.rb +64 -69
  6. data/lib/tinkerforge/brick_servo.rb +133 -44
  7. data/lib/tinkerforge/brick_silent_stepper.rb +151 -65
  8. data/lib/tinkerforge/brick_stepper.rb +139 -51
  9. data/lib/tinkerforge/bricklet_accelerometer.rb +17 -18
  10. data/lib/tinkerforge/bricklet_ambient_light.rb +16 -19
  11. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +13 -14
  12. data/lib/tinkerforge/bricklet_analog_in.rb +20 -23
  13. data/lib/tinkerforge/bricklet_analog_in_v2.rb +18 -21
  14. data/lib/tinkerforge/bricklet_analog_out.rb +8 -7
  15. data/lib/tinkerforge/bricklet_analog_out_v2.rb +7 -6
  16. data/lib/tinkerforge/bricklet_barometer.rb +21 -24
  17. data/lib/tinkerforge/bricklet_can.rb +14 -14
  18. data/lib/tinkerforge/bricklet_co2.rb +11 -12
  19. data/lib/tinkerforge/bricklet_color.rb +22 -25
  20. data/lib/tinkerforge/bricklet_current12.rb +18 -22
  21. data/lib/tinkerforge/bricklet_current25.rb +18 -22
  22. data/lib/tinkerforge/bricklet_distance_ir.rb +18 -21
  23. data/lib/tinkerforge/bricklet_distance_us.rb +13 -14
  24. data/lib/tinkerforge/bricklet_dual_button.rb +8 -8
  25. data/lib/tinkerforge/bricklet_dual_relay.rb +9 -9
  26. data/lib/tinkerforge/bricklet_dust_detector.rb +13 -14
  27. data/lib/tinkerforge/bricklet_gps.rb +21 -25
  28. data/lib/tinkerforge/bricklet_gps_v2.rb +56 -41
  29. data/lib/tinkerforge/bricklet_hall_effect.rb +13 -13
  30. data/lib/tinkerforge/bricklet_humidity.rb +16 -19
  31. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +13 -12
  32. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +15 -15
  33. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +12 -12
  34. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +13 -14
  35. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +16 -17
  36. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +12 -12
  37. data/lib/tinkerforge/bricklet_io16.rb +18 -19
  38. data/lib/tinkerforge/bricklet_io4.rb +18 -19
  39. data/lib/tinkerforge/bricklet_joystick.rb +18 -23
  40. data/lib/tinkerforge/bricklet_laser_range_finder.rb +26 -29
  41. data/lib/tinkerforge/bricklet_lcd_16x2.rb +14 -15
  42. data/lib/tinkerforge/bricklet_lcd_20x4.rb +18 -19
  43. data/lib/tinkerforge/bricklet_led_strip.rb +20 -20
  44. data/lib/tinkerforge/bricklet_line.rb +11 -12
  45. data/lib/tinkerforge/bricklet_linear_poti.rb +16 -19
  46. data/lib/tinkerforge/bricklet_load_cell.rb +20 -21
  47. data/lib/tinkerforge/bricklet_moisture.rb +13 -14
  48. data/lib/tinkerforge/bricklet_motion_detector.rb +7 -8
  49. data/lib/tinkerforge/bricklet_multi_touch.rb +10 -10
  50. data/lib/tinkerforge/bricklet_nfc_rfid.rb +11 -11
  51. data/lib/tinkerforge/bricklet_oled_128x64.rb +10 -9
  52. data/lib/tinkerforge/bricklet_oled_64x48.rb +10 -9
  53. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +6 -7
  54. data/lib/tinkerforge/bricklet_piezo_speaker.rb +7 -8
  55. data/lib/tinkerforge/bricklet_ptc.rb +23 -26
  56. data/lib/tinkerforge/bricklet_real_time_clock.rb +13 -14
  57. data/lib/tinkerforge/bricklet_remote_switch.rb +12 -12
  58. data/lib/tinkerforge/bricklet_rgb_led.rb +6 -5
  59. data/lib/tinkerforge/bricklet_rotary_encoder.rb +12 -15
  60. data/lib/tinkerforge/bricklet_rotary_poti.rb +16 -19
  61. data/lib/tinkerforge/bricklet_rs232.rb +12 -13
  62. data/lib/tinkerforge/bricklet_rs485.rb +1373 -0
  63. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +8 -8
  64. data/lib/tinkerforge/bricklet_solid_state_relay.rb +8 -8
  65. data/lib/tinkerforge/bricklet_sound_intensity.rb +11 -12
  66. data/lib/tinkerforge/bricklet_temperature.rb +13 -14
  67. data/lib/tinkerforge/bricklet_temperature_ir.rb +18 -21
  68. data/lib/tinkerforge/bricklet_thermocouple.rb +14 -16
  69. data/lib/tinkerforge/bricklet_tilt.rb +8 -8
  70. data/lib/tinkerforge/bricklet_uv_light.rb +11 -12
  71. data/lib/tinkerforge/bricklet_voltage.rb +16 -19
  72. data/lib/tinkerforge/bricklet_voltage_current.rb +25 -30
  73. data/lib/tinkerforge/ip_connection.rb +207 -138
  74. data/lib/tinkerforge/version.rb +1 -1
  75. metadata +3 -2
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -37,10 +37,10 @@ module Tinkerforge
37
37
  @response_expected[FUNCTION_GET_SEGMENTS] = RESPONSE_EXPECTED_ALWAYS_TRUE
38
38
  @response_expected[FUNCTION_START_COUNTER] = RESPONSE_EXPECTED_FALSE
39
39
  @response_expected[FUNCTION_GET_COUNTER_VALUE] = RESPONSE_EXPECTED_ALWAYS_TRUE
40
- @response_expected[CALLBACK_COUNTER_FINISHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
41
40
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
42
41
 
43
42
  @callback_formats[CALLBACK_COUNTER_FINISHED] = ''
43
+
44
44
  end
45
45
 
46
46
  # The 7-segment display can be set with bitmaps. Every bit controls one
@@ -57,13 +57,13 @@ module Tinkerforge
57
57
  # The brightness can be set between 0 (dark) and 7 (bright). The colon
58
58
  # parameter turns the colon of the display on or off.
59
59
  def set_segments(segments, brightness, colon)
60
- send_request(FUNCTION_SET_SEGMENTS, [segments, brightness, colon], 'C4 C ?', 0, '')
60
+ send_request FUNCTION_SET_SEGMENTS, [segments, brightness, colon], 'C4 C ?', 0, ''
61
61
  end
62
62
 
63
63
  # Returns the segment, brightness and color data as set by
64
64
  # BrickletSegmentDisplay4x7#set_segments.
65
65
  def get_segments
66
- send_request(FUNCTION_GET_SEGMENTS, [], '', 6, 'C4 C ?')
66
+ send_request FUNCTION_GET_SEGMENTS, [], '', 6, 'C4 C ?'
67
67
  end
68
68
 
69
69
  # Starts a counter with the *from* value that counts to the *to*
@@ -81,14 +81,14 @@ module Tinkerforge
81
81
  #
82
82
  # You can stop the counter at every time by calling BrickletSegmentDisplay4x7#set_segments.
83
83
  def start_counter(value_from, value_to, increment, length)
84
- send_request(FUNCTION_START_COUNTER, [value_from, value_to, increment, length], 's s s L', 0, '')
84
+ send_request FUNCTION_START_COUNTER, [value_from, value_to, increment, length], 's s s L', 0, ''
85
85
  end
86
86
 
87
87
  # Returns the counter value that is currently shown on the display.
88
88
  #
89
89
  # If there is no counter running a 0 will be returned.
90
90
  def get_counter_value
91
- send_request(FUNCTION_GET_COUNTER_VALUE, [], '', 2, 'S')
91
+ send_request FUNCTION_GET_COUNTER_VALUE, [], '', 2, 'S'
92
92
  end
93
93
 
94
94
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -100,7 +100,7 @@ module Tinkerforge
100
100
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
101
101
  # |device_identifier_constant|
102
102
  def get_identity
103
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
103
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
104
104
  end
105
105
 
106
106
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -38,10 +38,10 @@ module Tinkerforge
38
38
  @response_expected[FUNCTION_GET_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
39
39
  @response_expected[FUNCTION_SET_MONOFLOP] = RESPONSE_EXPECTED_FALSE
40
40
  @response_expected[FUNCTION_GET_MONOFLOP] = RESPONSE_EXPECTED_ALWAYS_TRUE
41
- @response_expected[CALLBACK_MONOFLOP_DONE] = RESPONSE_EXPECTED_ALWAYS_FALSE
42
41
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
43
42
 
44
43
  @callback_formats[CALLBACK_MONOFLOP_DONE] = '?'
44
+
45
45
  end
46
46
 
47
47
  # Sets the state of the relays *true* means on and *false* means off.
@@ -50,12 +50,12 @@ module Tinkerforge
50
50
  #
51
51
  # The default value is *false*.
52
52
  def set_state(state)
53
- send_request(FUNCTION_SET_STATE, [state], '?', 0, '')
53
+ send_request FUNCTION_SET_STATE, [state], '?', 0, ''
54
54
  end
55
55
 
56
56
  # Returns the state of the relay, *true* means on and *false* means off.
57
57
  def get_state
58
- send_request(FUNCTION_GET_STATE, [], '', 1, '?')
58
+ send_request FUNCTION_GET_STATE, [], '', 1, '?'
59
59
  end
60
60
 
61
61
  # The first parameter is the desired state of the relay (*true* means on
@@ -71,7 +71,7 @@ module Tinkerforge
71
71
  # of two seconds. The relay will be on all the time. If now the RS485
72
72
  # connection is lost, the relay will turn off in at most two seconds.
73
73
  def set_monoflop(state, time)
74
- send_request(FUNCTION_SET_MONOFLOP, [state, time], '? L', 0, '')
74
+ send_request FUNCTION_SET_MONOFLOP, [state, time], '? L', 0, ''
75
75
  end
76
76
 
77
77
  # Returns the current state and the time as set by
@@ -80,7 +80,7 @@ module Tinkerforge
80
80
  # If the timer is not running currently, the remaining time will be returned
81
81
  # as 0.
82
82
  def get_monoflop
83
- send_request(FUNCTION_GET_MONOFLOP, [], '', 9, '? L L')
83
+ send_request FUNCTION_GET_MONOFLOP, [], '', 9, '? L L'
84
84
  end
85
85
 
86
86
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -92,7 +92,7 @@ module Tinkerforge
92
92
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
93
93
  # |device_identifier_constant|
94
94
  def get_identity
95
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
95
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
96
96
  end
97
97
 
98
98
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -60,12 +60,11 @@ module Tinkerforge
60
60
  @response_expected[FUNCTION_GET_INTENSITY_CALLBACK_THRESHOLD] = RESPONSE_EXPECTED_ALWAYS_TRUE
61
61
  @response_expected[FUNCTION_SET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_TRUE
62
62
  @response_expected[FUNCTION_GET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
63
- @response_expected[CALLBACK_INTENSITY] = RESPONSE_EXPECTED_ALWAYS_FALSE
64
- @response_expected[CALLBACK_INTENSITY_REACHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
65
63
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
66
64
 
67
65
  @callback_formats[CALLBACK_INTENSITY] = 'S'
68
66
  @callback_formats[CALLBACK_INTENSITY_REACHED] = 'S'
67
+
69
68
  end
70
69
 
71
70
  # Returns the current sound intensity. The value has a range of
@@ -79,7 +78,7 @@ module Tinkerforge
79
78
  # CALLBACK_INTENSITY callback and set the period with
80
79
  # BrickletSoundIntensity#set_intensity_callback_period.
81
80
  def get_intensity
82
- send_request(FUNCTION_GET_INTENSITY, [], '', 2, 'S')
81
+ send_request FUNCTION_GET_INTENSITY, [], '', 2, 'S'
83
82
  end
84
83
 
85
84
  # Sets the period in ms with which the CALLBACK_INTENSITY callback is triggered
@@ -90,12 +89,12 @@ module Tinkerforge
90
89
  #
91
90
  # The default value is 0.
92
91
  def set_intensity_callback_period(period)
93
- send_request(FUNCTION_SET_INTENSITY_CALLBACK_PERIOD, [period], 'L', 0, '')
92
+ send_request FUNCTION_SET_INTENSITY_CALLBACK_PERIOD, [period], 'L', 0, ''
94
93
  end
95
94
 
96
95
  # Returns the period as set by BrickletSoundIntensity#set_intensity_callback_period.
97
96
  def get_intensity_callback_period
98
- send_request(FUNCTION_GET_INTENSITY_CALLBACK_PERIOD, [], '', 4, 'L')
97
+ send_request FUNCTION_GET_INTENSITY_CALLBACK_PERIOD, [], '', 4, 'L'
99
98
  end
100
99
 
101
100
  # Sets the thresholds for the CALLBACK_INTENSITY_REACHED callback.
@@ -112,12 +111,12 @@ module Tinkerforge
112
111
  #
113
112
  # The default value is ('x', 0, 0).
114
113
  def set_intensity_callback_threshold(option, min, max)
115
- send_request(FUNCTION_SET_INTENSITY_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, '')
114
+ send_request FUNCTION_SET_INTENSITY_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, ''
116
115
  end
117
116
 
118
117
  # Returns the threshold as set by BrickletSoundIntensity#set_intensity_callback_threshold.
119
118
  def get_intensity_callback_threshold
120
- send_request(FUNCTION_GET_INTENSITY_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
119
+ send_request FUNCTION_GET_INTENSITY_CALLBACK_THRESHOLD, [], '', 5, 'k S S'
121
120
  end
122
121
 
123
122
  # Sets the period in ms with which the threshold callback
@@ -132,12 +131,12 @@ module Tinkerforge
132
131
  #
133
132
  # The default value is 100.
134
133
  def set_debounce_period(debounce)
135
- send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')
134
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
136
135
  end
137
136
 
138
137
  # Returns the debounce period as set by BrickletSoundIntensity#set_debounce_period.
139
138
  def get_debounce_period
140
- send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
139
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
141
140
  end
142
141
 
143
142
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -149,7 +148,7 @@ module Tinkerforge
149
148
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
150
149
  # |device_identifier_constant|
151
150
  def get_identity
152
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
151
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
153
152
  end
154
153
 
155
154
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -64,14 +64,13 @@ module Tinkerforge
64
64
  @response_expected[FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD] = RESPONSE_EXPECTED_ALWAYS_TRUE
65
65
  @response_expected[FUNCTION_SET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_TRUE
66
66
  @response_expected[FUNCTION_GET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
67
- @response_expected[CALLBACK_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_FALSE
68
- @response_expected[CALLBACK_TEMPERATURE_REACHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
69
67
  @response_expected[FUNCTION_SET_I2C_MODE] = RESPONSE_EXPECTED_FALSE
70
68
  @response_expected[FUNCTION_GET_I2C_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
71
69
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
72
70
 
73
71
  @callback_formats[CALLBACK_TEMPERATURE] = 's'
74
72
  @callback_formats[CALLBACK_TEMPERATURE_REACHED] = 's'
73
+
75
74
  end
76
75
 
77
76
  # Returns the temperature of the sensor. The value
@@ -82,7 +81,7 @@ module Tinkerforge
82
81
  # to use the CALLBACK_TEMPERATURE callback and set the period with
83
82
  # BrickletTemperature#set_temperature_callback_period.
84
83
  def get_temperature
85
- send_request(FUNCTION_GET_TEMPERATURE, [], '', 2, 's')
84
+ send_request FUNCTION_GET_TEMPERATURE, [], '', 2, 's'
86
85
  end
87
86
 
88
87
  # Sets the period in ms with which the CALLBACK_TEMPERATURE callback is triggered
@@ -93,12 +92,12 @@ module Tinkerforge
93
92
  #
94
93
  # The default value is 0.
95
94
  def set_temperature_callback_period(period)
96
- send_request(FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, '')
95
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, ''
97
96
  end
98
97
 
99
98
  # Returns the period as set by BrickletTemperature#set_temperature_callback_period.
100
99
  def get_temperature_callback_period
101
- send_request(FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L')
100
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L'
102
101
  end
103
102
 
104
103
  # Sets the thresholds for the CALLBACK_TEMPERATURE_REACHED callback.
@@ -115,12 +114,12 @@ module Tinkerforge
115
114
  #
116
115
  # The default value is ('x', 0, 0).
117
116
  def set_temperature_callback_threshold(option, min, max)
118
- send_request(FUNCTION_SET_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, '')
117
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, ''
119
118
  end
120
119
 
121
120
  # Returns the threshold as set by BrickletTemperature#set_temperature_callback_threshold.
122
121
  def get_temperature_callback_threshold
123
- send_request(FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s')
122
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s'
124
123
  end
125
124
 
126
125
  # Sets the period in ms with which the threshold callback
@@ -135,12 +134,12 @@ module Tinkerforge
135
134
  #
136
135
  # The default value is 100.
137
136
  def set_debounce_period(debounce)
138
- send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')
137
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
139
138
  end
140
139
 
141
140
  # Returns the debounce period as set by BrickletTemperature#set_debounce_period.
142
141
  def get_debounce_period
143
- send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
142
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
144
143
  end
145
144
 
146
145
  # Sets the I2C mode. Possible modes are:
@@ -157,14 +156,14 @@ module Tinkerforge
157
156
  #
158
157
  # .. versionadded:: 2.0.1$nbsp;(Plugin)
159
158
  def set_i2c_mode(mode)
160
- send_request(FUNCTION_SET_I2C_MODE, [mode], 'C', 0, '')
159
+ send_request FUNCTION_SET_I2C_MODE, [mode], 'C', 0, ''
161
160
  end
162
161
 
163
162
  # Returns the I2C mode as set by BrickletTemperature#set_i2c_mode.
164
163
  #
165
164
  # .. versionadded:: 2.0.1$nbsp;(Plugin)
166
165
  def get_i2c_mode
167
- send_request(FUNCTION_GET_I2C_MODE, [], '', 1, 'C')
166
+ send_request FUNCTION_GET_I2C_MODE, [], '', 1, 'C'
168
167
  end
169
168
 
170
169
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -176,7 +175,7 @@ module Tinkerforge
176
175
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
177
176
  # |device_identifier_constant|
178
177
  def get_identity
179
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
178
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
180
179
  end
181
180
 
182
181
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -90,16 +90,13 @@ module Tinkerforge
90
90
  @response_expected[FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD] = RESPONSE_EXPECTED_ALWAYS_TRUE
91
91
  @response_expected[FUNCTION_SET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_TRUE
92
92
  @response_expected[FUNCTION_GET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
93
- @response_expected[CALLBACK_AMBIENT_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_FALSE
94
- @response_expected[CALLBACK_OBJECT_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_FALSE
95
- @response_expected[CALLBACK_AMBIENT_TEMPERATURE_REACHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
96
- @response_expected[CALLBACK_OBJECT_TEMPERATURE_REACHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
97
93
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
98
94
 
99
95
  @callback_formats[CALLBACK_AMBIENT_TEMPERATURE] = 's'
100
96
  @callback_formats[CALLBACK_OBJECT_TEMPERATURE] = 's'
101
97
  @callback_formats[CALLBACK_AMBIENT_TEMPERATURE_REACHED] = 's'
102
98
  @callback_formats[CALLBACK_OBJECT_TEMPERATURE_REACHED] = 's'
99
+
103
100
  end
104
101
 
105
102
  # Returns the ambient temperature of the sensor. The value
@@ -111,7 +108,7 @@ module Tinkerforge
111
108
  # to use the CALLBACK_AMBIENT_TEMPERATURE callback and set the period with
112
109
  # BrickletTemperatureIR#set_ambient_temperature_callback_period.
113
110
  def get_ambient_temperature
114
- send_request(FUNCTION_GET_AMBIENT_TEMPERATURE, [], '', 2, 's')
111
+ send_request FUNCTION_GET_AMBIENT_TEMPERATURE, [], '', 2, 's'
115
112
  end
116
113
 
117
114
  # Returns the object temperature of the sensor, i.e. the temperature
@@ -128,7 +125,7 @@ module Tinkerforge
128
125
  # to use the CALLBACK_OBJECT_TEMPERATURE callback and set the period with
129
126
  # BrickletTemperatureIR#set_object_temperature_callback_period.
130
127
  def get_object_temperature
131
- send_request(FUNCTION_GET_OBJECT_TEMPERATURE, [], '', 2, 's')
128
+ send_request FUNCTION_GET_OBJECT_TEMPERATURE, [], '', 2, 's'
132
129
  end
133
130
 
134
131
  # Sets the `emissivity <https://en.wikipedia.org/wiki/Emissivity>`__ that is
@@ -150,12 +147,12 @@ module Tinkerforge
150
147
  # The default emissivity is 1.0 (value of 65535) and the minimum emissivity the
151
148
  # sensor can handle is 0.1 (value of 6553).
152
149
  def set_emissivity(emissivity)
153
- send_request(FUNCTION_SET_EMISSIVITY, [emissivity], 'S', 0, '')
150
+ send_request FUNCTION_SET_EMISSIVITY, [emissivity], 'S', 0, ''
154
151
  end
155
152
 
156
153
  # Returns the emissivity as set by BrickletTemperatureIR#set_emissivity.
157
154
  def get_emissivity
158
- send_request(FUNCTION_GET_EMISSIVITY, [], '', 2, 'S')
155
+ send_request FUNCTION_GET_EMISSIVITY, [], '', 2, 'S'
159
156
  end
160
157
 
161
158
  # Sets the period in ms with which the CALLBACK_AMBIENT_TEMPERATURE callback is
@@ -166,12 +163,12 @@ module Tinkerforge
166
163
  #
167
164
  # The default value is 0.
168
165
  def set_ambient_temperature_callback_period(period)
169
- send_request(FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, '')
166
+ send_request FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, ''
170
167
  end
171
168
 
172
169
  # Returns the period as set by BrickletTemperatureIR#set_ambient_temperature_callback_period.
173
170
  def get_ambient_temperature_callback_period
174
- send_request(FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L')
171
+ send_request FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L'
175
172
  end
176
173
 
177
174
  # Sets the period in ms with which the CALLBACK_OBJECT_TEMPERATURE callback is
@@ -182,12 +179,12 @@ module Tinkerforge
182
179
  #
183
180
  # The default value is 0.
184
181
  def set_object_temperature_callback_period(period)
185
- send_request(FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, '')
182
+ send_request FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, ''
186
183
  end
187
184
 
188
185
  # Returns the period as set by BrickletTemperatureIR#set_object_temperature_callback_period.
189
186
  def get_object_temperature_callback_period
190
- send_request(FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L')
187
+ send_request FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L'
191
188
  end
192
189
 
193
190
  # Sets the thresholds for the CALLBACK_AMBIENT_TEMPERATURE_REACHED callback.
@@ -204,12 +201,12 @@ module Tinkerforge
204
201
  #
205
202
  # The default value is ('x', 0, 0).
206
203
  def set_ambient_temperature_callback_threshold(option, min, max)
207
- send_request(FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, '')
204
+ send_request FUNCTION_SET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, ''
208
205
  end
209
206
 
210
207
  # Returns the threshold as set by BrickletTemperatureIR#set_ambient_temperature_callback_threshold.
211
208
  def get_ambient_temperature_callback_threshold
212
- send_request(FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s')
209
+ send_request FUNCTION_GET_AMBIENT_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s'
213
210
  end
214
211
 
215
212
  # Sets the thresholds for the CALLBACK_OBJECT_TEMPERATURE_REACHED callback.
@@ -226,12 +223,12 @@ module Tinkerforge
226
223
  #
227
224
  # The default value is ('x', 0, 0).
228
225
  def set_object_temperature_callback_threshold(option, min, max)
229
- send_request(FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, '')
226
+ send_request FUNCTION_SET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k s s', 0, ''
230
227
  end
231
228
 
232
229
  # Returns the threshold as set by BrickletTemperatureIR#set_object_temperature_callback_threshold.
233
230
  def get_object_temperature_callback_threshold
234
- send_request(FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s')
231
+ send_request FUNCTION_GET_OBJECT_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 5, 'k s s'
235
232
  end
236
233
 
237
234
  # Sets the period in ms with which the threshold callbacks
@@ -248,12 +245,12 @@ module Tinkerforge
248
245
  #
249
246
  # The default value is 100.
250
247
  def set_debounce_period(debounce)
251
- send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')
248
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
252
249
  end
253
250
 
254
251
  # Returns the debounce period as set by BrickletTemperatureIR#set_debounce_period.
255
252
  def get_debounce_period
256
- send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
253
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
257
254
  end
258
255
 
259
256
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -265,7 +262,7 @@ module Tinkerforge
265
262
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
266
263
  # |device_identifier_constant|
267
264
  def get_identity
268
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
265
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
269
266
  end
270
267
 
271
268
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -84,17 +84,15 @@ module Tinkerforge
84
84
  @response_expected[FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD] = RESPONSE_EXPECTED_ALWAYS_TRUE
85
85
  @response_expected[FUNCTION_SET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_TRUE
86
86
  @response_expected[FUNCTION_GET_DEBOUNCE_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
87
- @response_expected[CALLBACK_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_FALSE
88
- @response_expected[CALLBACK_TEMPERATURE_REACHED] = RESPONSE_EXPECTED_ALWAYS_FALSE
89
87
  @response_expected[FUNCTION_SET_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
90
88
  @response_expected[FUNCTION_GET_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
91
89
  @response_expected[FUNCTION_GET_ERROR_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
92
- @response_expected[CALLBACK_ERROR_STATE] = RESPONSE_EXPECTED_ALWAYS_FALSE
93
90
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
94
91
 
95
92
  @callback_formats[CALLBACK_TEMPERATURE] = 'l'
96
93
  @callback_formats[CALLBACK_TEMPERATURE_REACHED] = 'l'
97
94
  @callback_formats[CALLBACK_ERROR_STATE] = '? ?'
95
+
98
96
  end
99
97
 
100
98
  # Returns the temperature of the thermocouple. The value is given in °C/100,
@@ -104,7 +102,7 @@ module Tinkerforge
104
102
  # to use the CALLBACK_TEMPERATURE callback and set the period with
105
103
  # BrickletThermocouple#set_temperature_callback_period.
106
104
  def get_temperature
107
- send_request(FUNCTION_GET_TEMPERATURE, [], '', 4, 'l')
105
+ send_request FUNCTION_GET_TEMPERATURE, [], '', 4, 'l'
108
106
  end
109
107
 
110
108
  # Sets the period in ms with which the CALLBACK_TEMPERATURE callback is triggered
@@ -115,12 +113,12 @@ module Tinkerforge
115
113
  #
116
114
  # The default value is 0.
117
115
  def set_temperature_callback_period(period)
118
- send_request(FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, '')
116
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_PERIOD, [period], 'L', 0, ''
119
117
  end
120
118
 
121
119
  # Returns the period as set by BrickletThermocouple#set_temperature_callback_period.
122
120
  def get_temperature_callback_period
123
- send_request(FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L')
121
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_PERIOD, [], '', 4, 'L'
124
122
  end
125
123
 
126
124
  # Sets the thresholds for the CALLBACK_TEMPERATURE_REACHED callback.
@@ -137,12 +135,12 @@ module Tinkerforge
137
135
  #
138
136
  # The default value is ('x', 0, 0).
139
137
  def set_temperature_callback_threshold(option, min, max)
140
- send_request(FUNCTION_SET_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k l l', 0, '')
138
+ send_request FUNCTION_SET_TEMPERATURE_CALLBACK_THRESHOLD, [option, min, max], 'k l l', 0, ''
141
139
  end
142
140
 
143
141
  # Returns the threshold as set by BrickletThermocouple#set_temperature_callback_threshold.
144
142
  def get_temperature_callback_threshold
145
- send_request(FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 9, 'k l l')
143
+ send_request FUNCTION_GET_TEMPERATURE_CALLBACK_THRESHOLD, [], '', 9, 'k l l'
146
144
  end
147
145
 
148
146
  # Sets the period in ms with which the threshold callback
@@ -157,12 +155,12 @@ module Tinkerforge
157
155
  #
158
156
  # The default value is 100.
159
157
  def set_debounce_period(debounce)
160
- send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')
158
+ send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
161
159
  end
162
160
 
163
161
  # Returns the debounce period as set by BrickletThermocouple#set_debounce_period.
164
162
  def get_debounce_period
165
- send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
163
+ send_request FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L'
166
164
  end
167
165
 
168
166
  # You can configure averaging size, thermocouple type and frequency
@@ -191,12 +189,12 @@ module Tinkerforge
191
189
  #
192
190
  # The default configuration is 16 samples, K type and 50Hz.
193
191
  def set_configuration(averaging, thermocouple_type, filter)
194
- send_request(FUNCTION_SET_CONFIGURATION, [averaging, thermocouple_type, filter], 'C C C', 0, '')
192
+ send_request FUNCTION_SET_CONFIGURATION, [averaging, thermocouple_type, filter], 'C C C', 0, ''
195
193
  end
196
194
 
197
195
  # Returns the configuration as set by BrickletThermocouple#set_configuration.
198
196
  def get_configuration
199
- send_request(FUNCTION_GET_CONFIGURATION, [], '', 3, 'C C C')
197
+ send_request FUNCTION_GET_CONFIGURATION, [], '', 3, 'C C C'
200
198
  end
201
199
 
202
200
  # Returns the current error state. There are two possible errors:
@@ -211,7 +209,7 @@ module Tinkerforge
211
209
  # You can use the func:`ErrorState` callback to automatically get triggered
212
210
  # when the error state changes.
213
211
  def get_error_state
214
- send_request(FUNCTION_GET_ERROR_STATE, [], '', 2, '? ?')
212
+ send_request FUNCTION_GET_ERROR_STATE, [], '', 2, '? ?'
215
213
  end
216
214
 
217
215
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -223,7 +221,7 @@ module Tinkerforge
223
221
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
224
222
  # |device_identifier_constant|
225
223
  def get_identity
226
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
224
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
227
225
  end
228
226
 
229
227
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-05-11. #
3
+ # This file was automatically generated on 2017-07-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.13 #
5
+ # Ruby Bindings Version 2.1.14 #
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 #
@@ -42,10 +42,10 @@ module Tinkerforge
42
42
  @response_expected[FUNCTION_ENABLE_TILT_STATE_CALLBACK] = RESPONSE_EXPECTED_TRUE
43
43
  @response_expected[FUNCTION_DISABLE_TILT_STATE_CALLBACK] = RESPONSE_EXPECTED_TRUE
44
44
  @response_expected[FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
45
- @response_expected[CALLBACK_TILT_STATE] = RESPONSE_EXPECTED_ALWAYS_FALSE
46
45
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
47
46
 
48
47
  @callback_formats[CALLBACK_TILT_STATE] = 'C'
48
+
49
49
  end
50
50
 
51
51
  # Returns the current tilt state. The state can either be
@@ -60,22 +60,22 @@ module Tinkerforge
60
60
  # :align: center
61
61
  # :target: ../../_images/Bricklets/bricklet_tilt_mechanics.jpg
62
62
  def get_tilt_state
63
- send_request(FUNCTION_GET_TILT_STATE, [], '', 1, 'C')
63
+ send_request FUNCTION_GET_TILT_STATE, [], '', 1, 'C'
64
64
  end
65
65
 
66
66
  # Enables the CALLBACK_TILT_STATE callback.
67
67
  def enable_tilt_state_callback
68
- send_request(FUNCTION_ENABLE_TILT_STATE_CALLBACK, [], '', 0, '')
68
+ send_request FUNCTION_ENABLE_TILT_STATE_CALLBACK, [], '', 0, ''
69
69
  end
70
70
 
71
71
  # Disables the CALLBACK_TILT_STATE callback.
72
72
  def disable_tilt_state_callback
73
- send_request(FUNCTION_DISABLE_TILT_STATE_CALLBACK, [], '', 0, '')
73
+ send_request FUNCTION_DISABLE_TILT_STATE_CALLBACK, [], '', 0, ''
74
74
  end
75
75
 
76
76
  # Returns *true* if the CALLBACK_TILT_STATE callback is enabled.
77
77
  def is_tilt_state_callback_enabled
78
- send_request(FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED, [], '', 1, '?')
78
+ send_request FUNCTION_IS_TILT_STATE_CALLBACK_ENABLED, [], '', 1, '?'
79
79
  end
80
80
 
81
81
  # Returns the UID, the UID where the Bricklet is connected to,
@@ -87,7 +87,7 @@ module Tinkerforge
87
87
  # The device identifier numbers can be found :ref:`here <device_identifier>`.
88
88
  # |device_identifier_constant|
89
89
  def get_identity
90
- send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
90
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
91
91
  end
92
92
 
93
93
  # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.