tinkerforge 2.1.8 → 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tinkerforge/brick_dc.rb +2 -2
- data/lib/tinkerforge/brick_imu.rb +2 -2
- data/lib/tinkerforge/brick_imu_v2.rb +2 -2
- data/lib/tinkerforge/brick_master.rb +410 -20
- data/lib/tinkerforge/brick_red.rb +2 -2
- data/lib/tinkerforge/brick_servo.rb +2 -2
- data/lib/tinkerforge/brick_stepper.rb +2 -2
- data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
- data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
- data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
- data/lib/tinkerforge/bricklet_barometer.rb +2 -2
- data/lib/tinkerforge/bricklet_can.rb +289 -0
- data/lib/tinkerforge/bricklet_co2.rb +2 -2
- data/lib/tinkerforge/bricklet_color.rb +2 -2
- data/lib/tinkerforge/bricklet_current12.rb +2 -2
- data/lib/tinkerforge/bricklet_current25.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
- data/lib/tinkerforge/bricklet_gps.rb +2 -2
- data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
- data/lib/tinkerforge/bricklet_humidity.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_io16.rb +3 -3
- data/lib/tinkerforge/bricklet_io4.rb +2 -2
- data/lib/tinkerforge/bricklet_joystick.rb +2 -2
- data/lib/tinkerforge/bricklet_laser_range_finder.rb +3 -3
- data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
- data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
- data/lib/tinkerforge/bricklet_led_strip.rb +3 -3
- data/lib/tinkerforge/bricklet_line.rb +2 -2
- data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
- data/lib/tinkerforge/bricklet_moisture.rb +2 -2
- data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
- data/lib/tinkerforge/bricklet_multi_touch.rb +3 -3
- data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
- data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
- data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
- data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
- data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
- data/lib/tinkerforge/bricklet_ptc.rb +2 -2
- data/lib/tinkerforge/bricklet_real_time_clock.rb +96 -3
- data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
- data/lib/tinkerforge/bricklet_rgb_led.rb +59 -0
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
- data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_rs232.rb +2 -2
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
- data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
- data/lib/tinkerforge/bricklet_tilt.rb +2 -2
- data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
- data/lib/tinkerforge/version.rb +1 -1
- metadata +4 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 #
|
@@ -216,7 +216,7 @@ module Tinkerforge
|
|
216
216
|
#
|
217
217
|
# .. note::
|
218
218
|
# This function does nothing for pins that are configured as input.
|
219
|
-
# Pull-up resistors can be switched on with
|
219
|
+
# Pull-up resistors can be switched on with BrickletIO16#set_port_configuration.
|
220
220
|
def set_selected_values(port, selection_mask, value_mask)
|
221
221
|
send_request(FUNCTION_SET_SELECTED_VALUES, [port, selection_mask, value_mask], 'k C C', 0, '')
|
222
222
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 #
|
@@ -132,7 +132,7 @@ module Tinkerforge
|
|
132
132
|
send_request(FUNCTION_GET_DISTANCE, [], '', 2, 'S')
|
133
133
|
end
|
134
134
|
|
135
|
-
# Returns the measured velocity. The value has a range of
|
135
|
+
# Returns the measured velocity. The value has a range of -12800 to 12700
|
136
136
|
# and is given in 1/100 m/s.
|
137
137
|
#
|
138
138
|
# The Laser Range Finder Bricklet knows different modes. Velocity
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 #
|
@@ -103,7 +103,7 @@ module Tinkerforge
|
|
103
103
|
send_request(FUNCTION_SET_RGB_VALUES, [index, length, r, g, b], 'S C C16 C16 C16', 0, '')
|
104
104
|
end
|
105
105
|
|
106
|
-
# Returns
|
106
|
+
# Returns *rgb* values with the given *length* starting from the
|
107
107
|
# given *index*.
|
108
108
|
#
|
109
109
|
# The values are the last values that were set by BrickletLEDStrip#set_rgb_values.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 #
|
@@ -54,7 +54,7 @@ module Tinkerforge
|
|
54
54
|
# Bits 0 to 11 represent the 12 electrodes and bit 12 represents
|
55
55
|
# the proximity.
|
56
56
|
#
|
57
|
-
# If an electrode is touched, the corresponding bit is true
|
57
|
+
# If an electrode is touched, the corresponding bit is *true*. If
|
58
58
|
# a hand or similar is in proximity to the electrodes, bit 12 is
|
59
59
|
# *true*.
|
60
60
|
#
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 2016-
|
3
|
+
# This file was automatically generated on 2016-06-30. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.9 #
|
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 #
|
@@ -15,11 +15,32 @@ module Tinkerforge
|
|
15
15
|
DEVICE_IDENTIFIER = 268 # :nodoc:
|
16
16
|
DEVICE_DISPLAY_NAME = 'Real-Time Clock Bricklet' # :nodoc:
|
17
17
|
|
18
|
+
# This callback is triggered periodically with the period that is set by
|
19
|
+
# BrickletRealTimeClock#set_date_time_callback_period. The parameters are the same
|
20
|
+
# as for BrickletRealTimeClock#get_date_time and BrickletRealTimeClock#get_timestamp combined.
|
21
|
+
#
|
22
|
+
# CALLBACK_DATE_TIME is only triggered if the date or time changed since the
|
23
|
+
# last triggering.
|
24
|
+
#
|
25
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
26
|
+
CALLBACK_DATE_TIME = 10
|
27
|
+
|
28
|
+
# This callback is triggered every time the current date and time matches the
|
29
|
+
# configured alarm (see BrickletRealTimeClock#set_alarm). The parameters are the same
|
30
|
+
# as for BrickletRealTimeClock#get_date_time and BrickletRealTimeClock#get_timestamp combined.
|
31
|
+
#
|
32
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
33
|
+
CALLBACK_ALARM = 11
|
34
|
+
|
18
35
|
FUNCTION_SET_DATE_TIME = 1 # :nodoc:
|
19
36
|
FUNCTION_GET_DATE_TIME = 2 # :nodoc:
|
20
37
|
FUNCTION_GET_TIMESTAMP = 3 # :nodoc:
|
21
38
|
FUNCTION_SET_OFFSET = 4 # :nodoc:
|
22
39
|
FUNCTION_GET_OFFSET = 5 # :nodoc:
|
40
|
+
FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD = 6 # :nodoc:
|
41
|
+
FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD = 7 # :nodoc:
|
42
|
+
FUNCTION_SET_ALARM = 8 # :nodoc:
|
43
|
+
FUNCTION_GET_ALARM = 9 # :nodoc:
|
23
44
|
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
24
45
|
|
25
46
|
WEEKDAY_MONDAY = 1 # :nodoc:
|
@@ -29,21 +50,31 @@ module Tinkerforge
|
|
29
50
|
WEEKDAY_FRIDAY = 5 # :nodoc:
|
30
51
|
WEEKDAY_SATURDAY = 6 # :nodoc:
|
31
52
|
WEEKDAY_SUNDAY = 7 # :nodoc:
|
53
|
+
ALARM_MATCH_DISABLED = -1 # :nodoc:
|
54
|
+
ALARM_INTERVAL_DISABLED = -1 # :nodoc:
|
32
55
|
|
33
56
|
# Creates an object with the unique device ID <tt>uid</tt> and adds it to
|
34
57
|
# the IP Connection <tt>ipcon</tt>.
|
35
58
|
def initialize(uid, ipcon)
|
36
59
|
super uid, ipcon
|
37
60
|
|
38
|
-
@api_version = [2, 0,
|
61
|
+
@api_version = [2, 0, 1]
|
39
62
|
|
40
63
|
@response_expected[FUNCTION_SET_DATE_TIME] = RESPONSE_EXPECTED_FALSE
|
41
64
|
@response_expected[FUNCTION_GET_DATE_TIME] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
42
65
|
@response_expected[FUNCTION_GET_TIMESTAMP] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
43
66
|
@response_expected[FUNCTION_SET_OFFSET] = RESPONSE_EXPECTED_FALSE
|
44
67
|
@response_expected[FUNCTION_GET_OFFSET] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
68
|
+
@response_expected[FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
|
69
|
+
@response_expected[FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
70
|
+
@response_expected[FUNCTION_SET_ALARM] = RESPONSE_EXPECTED_TRUE
|
71
|
+
@response_expected[FUNCTION_GET_ALARM] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
72
|
+
@response_expected[CALLBACK_DATE_TIME] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
73
|
+
@response_expected[CALLBACK_ALARM] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
45
74
|
@response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
46
75
|
|
76
|
+
@callback_formats[CALLBACK_DATE_TIME] = 'S C C C C C C C q'
|
77
|
+
@callback_formats[CALLBACK_ALARM] = 'S C C C C C C C q'
|
47
78
|
end
|
48
79
|
|
49
80
|
# Sets the current date (including weekday) and the current time with hundredths
|
@@ -117,6 +148,63 @@ module Tinkerforge
|
|
117
148
|
send_request(FUNCTION_GET_OFFSET, [], '', 1, 'c')
|
118
149
|
end
|
119
150
|
|
151
|
+
# Sets the period in ms with which the CALLBACK_DATE_TIME callback is triggered
|
152
|
+
# periodically. A value of 0 turns the callback off.
|
153
|
+
#
|
154
|
+
# CALLBACK_DATE_TIME is only triggered if the date or time changed since the
|
155
|
+
# last triggering.
|
156
|
+
#
|
157
|
+
# The default value is 0.
|
158
|
+
#
|
159
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
160
|
+
def set_date_time_callback_period(period)
|
161
|
+
send_request(FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD, [period], 'L', 0, '')
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the period as set by BrickletRealTimeClock#set_date_time_callback_period.
|
165
|
+
#
|
166
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
167
|
+
def get_date_time_callback_period
|
168
|
+
send_request(FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD, [], '', 4, 'L')
|
169
|
+
end
|
170
|
+
|
171
|
+
# Configures a repeatable alarm. The CALLBACK_ALARM callback is triggered if the
|
172
|
+
# current date and time matches the configured alarm.
|
173
|
+
#
|
174
|
+
# Setting a parameter to -1 means that it should be disabled and doesn't take part
|
175
|
+
# in the match. Setting all parameters to -1 disables the alarm completely.
|
176
|
+
#
|
177
|
+
# For example, to make the alarm trigger every day at 7:30 AM it can be
|
178
|
+
# configured as (-1, -1, 7, 30, -1, -1, -1). The hour is set to match 7 and the
|
179
|
+
# minute is set to match 30. The alarm is triggered if all enabled parameters
|
180
|
+
# match.
|
181
|
+
#
|
182
|
+
# The interval has a special role. It allows to make the alarm reconfigure itself.
|
183
|
+
# This is useful if you need a repeated alarm that cannot be expressed by matching
|
184
|
+
# the current date and time. For example, to make the alarm trigger every 23
|
185
|
+
# seconds it can be configured as (-1, -1, -1, -1, -1, -1, 23). Internally the
|
186
|
+
# Bricklet will take the current date and time, add 23 seconds to it and set the
|
187
|
+
# result as its alarm. The first alarm will be triggered 23 seconds after the
|
188
|
+
# call. Because the interval is not -1, the Bricklet will do the same again
|
189
|
+
# internally, take the current date and time, add 23 seconds to it and set that
|
190
|
+
# as its alarm. This results in a repeated alarm that triggers every 23 seconds.
|
191
|
+
#
|
192
|
+
# The interval can also be used in combination with the other parameters. For
|
193
|
+
# example, configuring the alarm as (-1, -1, 7, 30, -1, -1, 300) results in an
|
194
|
+
# alarm that triggers every day at 7:30 AM and is then repeated every 5 minutes.
|
195
|
+
#
|
196
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
197
|
+
def set_alarm(month, day, hour, minute, second, weekday, interval)
|
198
|
+
send_request(FUNCTION_SET_ALARM, [month, day, hour, minute, second, weekday, interval], 'c c c c c c l', 0, '')
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the alarm configuration as set by BrickletRealTimeClock#set_alarm.
|
202
|
+
#
|
203
|
+
# .. versionadded:: 2.0.1$nbsp;(Plugin)
|
204
|
+
def get_alarm
|
205
|
+
send_request(FUNCTION_GET_ALARM, [], '', 10, 'c c c c c c l')
|
206
|
+
end
|
207
|
+
|
120
208
|
# Returns the UID, the UID where the Bricklet is connected to,
|
121
209
|
# the position, the hardware and firmware version as well as the
|
122
210
|
# device identifier.
|
@@ -129,5 +217,10 @@ module Tinkerforge
|
|
129
217
|
send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')
|
130
218
|
end
|
131
219
|
|
220
|
+
# Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
|
221
|
+
def register_callback(id, &block)
|
222
|
+
callback = block
|
223
|
+
@registered_callbacks[id] = callback
|
224
|
+
end
|
132
225
|
end
|
133
226
|
end
|