tinkerforge 2.1.12 → 2.1.13

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 (74) hide show
  1. data/lib/tinkerforge/brick_dc.rb +2 -2
  2. data/lib/tinkerforge/brick_imu.rb +2 -2
  3. data/lib/tinkerforge/brick_imu_v2.rb +2 -2
  4. data/lib/tinkerforge/brick_master.rb +16 -2
  5. data/lib/tinkerforge/brick_red.rb +2 -2
  6. data/lib/tinkerforge/brick_servo.rb +2 -2
  7. data/lib/tinkerforge/brick_silent_stepper.rb +2 -2
  8. data/lib/tinkerforge/brick_stepper.rb +2 -2
  9. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  10. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  11. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  12. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  13. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  14. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  15. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  16. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  17. data/lib/tinkerforge/bricklet_can.rb +2 -2
  18. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  19. data/lib/tinkerforge/bricklet_color.rb +2 -2
  20. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  21. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  22. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  23. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  24. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  25. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  26. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  27. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  28. data/lib/tinkerforge/bricklet_gps_v2.rb +507 -0
  29. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  30. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  31. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  32. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  33. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  34. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  35. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  36. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  37. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  38. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  39. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  40. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  41. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  42. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  43. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  44. data/lib/tinkerforge/bricklet_line.rb +2 -2
  45. data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
  46. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  47. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  48. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  49. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  50. data/lib/tinkerforge/bricklet_nfc_rfid.rb +4 -4
  51. data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
  52. data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
  53. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  54. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  55. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  56. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  57. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  58. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  59. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  60. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  61. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  62. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  63. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  64. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  65. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  66. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  67. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  68. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  69. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  70. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  71. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  72. data/lib/tinkerforge/ip_connection.rb +15 -4
  73. data/lib/tinkerforge/version.rb +1 -1
  74. metadata +3 -2
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2017-04-21. #
3
+ # This file was automatically generated on 2017-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.12 #
5
+ # Ruby Bindings Version 2.1.13 #
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 #
@@ -61,8 +61,16 @@ module Tinkerforge
61
61
  r = []
62
62
 
63
63
  if f0 == '?'
64
- unpacked[0].each { |b| r << b ? 1 : 0 }
65
- data += r.pack "C#{f1}"
64
+ n1 = (Integer(f1) / 8.0).ceil
65
+ r = Array.new(n1, 0)
66
+
67
+ unpacked[0].each_with_index do |b, i|
68
+ if b
69
+ r[i / 8] |= 1 << (i % 8)
70
+ end
71
+ end
72
+
73
+ data += r.pack "C#{n1}"
66
74
  elsif f0 == 'k'
67
75
  unpacked[0].each { |c| r << c.ord }
68
76
  data += r.pack "c#{f1}"
@@ -111,7 +119,10 @@ module Tinkerforge
111
119
  r = data.unpack "C#{f1}a*"
112
120
  data = r[-1]
113
121
  r.delete_at(-1)
114
- r.each { |b| u << b != 0 }
122
+
123
+ for i in 0..Integer(f1) - 1
124
+ u << ((r[i / 8] & (1 << (i % 8))) != 0)
125
+ end
115
126
  elsif f0 == 'k'
116
127
  r = data.unpack "c#{f1}a*"
117
128
  data = r[-1]
@@ -125,7 +136,7 @@ module Tinkerforge
125
136
  end
126
137
  data = r[-1]
127
138
  r.delete_at(-1)
128
- r.each { |i| u << i }
139
+ r.each { |k| u << k }
129
140
  end
130
141
 
131
142
  if u.length == 1
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Tinkerforge
3
- VERSION = '2.1.12'
3
+ VERSION = '2.1.13'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinkerforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.12
4
+ version: 2.1.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-21 00:00:00.000000000 Z
12
+ date: 2017-05-11 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: matthias@tinkerforge.com
@@ -72,6 +72,7 @@ files:
72
72
  - lib/tinkerforge/brick_stepper.rb
73
73
  - lib/tinkerforge/bricklet_io4.rb
74
74
  - lib/tinkerforge/bricklet_analog_in.rb
75
+ - lib/tinkerforge/bricklet_gps_v2.rb
75
76
  - lib/tinkerforge/bricklet_industrial_dual_analog_in.rb
76
77
  - lib/tinkerforge/brick_red.rb
77
78
  - lib/tinkerforge/bricklet_temperature_ir.rb