tinkerforge 2.1.29 → 2.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +5 -5
  2. data/lib/tinkerforge/brick_dc.rb +2 -2
  3. data/lib/tinkerforge/brick_esp32.rb +49 -0
  4. data/lib/tinkerforge/brick_esp32_ethernet.rb +49 -0
  5. data/lib/tinkerforge/brick_hat.rb +33 -3
  6. data/lib/tinkerforge/brick_hat_zero.rb +2 -2
  7. data/lib/tinkerforge/brick_imu.rb +2 -2
  8. data/lib/tinkerforge/brick_imu_v2.rb +2 -2
  9. data/lib/tinkerforge/brick_master.rb +4 -4
  10. data/lib/tinkerforge/brick_red.rb +2 -2
  11. data/lib/tinkerforge/brick_servo.rb +2 -2
  12. data/lib/tinkerforge/brick_silent_stepper.rb +2 -2
  13. data/lib/tinkerforge/brick_stepper.rb +2 -2
  14. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  15. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +2 -2
  16. data/lib/tinkerforge/bricklet_air_quality.rb +2 -2
  17. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  18. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  19. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +2 -2
  20. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  21. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  22. data/lib/tinkerforge/bricklet_analog_in_v3.rb +2 -2
  23. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  24. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  25. data/lib/tinkerforge/bricklet_analog_out_v3.rb +2 -2
  26. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  27. data/lib/tinkerforge/bricklet_barometer_v2.rb +2 -2
  28. data/lib/tinkerforge/bricklet_can.rb +2 -2
  29. data/lib/tinkerforge/bricklet_can_v2.rb +2 -2
  30. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  31. data/lib/tinkerforge/bricklet_co2_v2.rb +2 -2
  32. data/lib/tinkerforge/bricklet_color.rb +2 -2
  33. data/lib/tinkerforge/bricklet_color_v2.rb +2 -2
  34. data/lib/tinkerforge/bricklet_compass.rb +2 -2
  35. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  36. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  37. data/lib/tinkerforge/bricklet_dc_v2.rb +2 -2
  38. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  39. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +2 -2
  40. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  41. data/lib/tinkerforge/bricklet_distance_us_v2.rb +2 -2
  42. data/lib/tinkerforge/bricklet_dmx.rb +3 -3
  43. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  44. data/lib/tinkerforge/bricklet_dual_button_v2.rb +2 -2
  45. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  46. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  47. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +32 -3
  48. data/lib/tinkerforge/bricklet_energy_monitor.rb +2 -2
  49. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  50. data/lib/tinkerforge/bricklet_gps_v2.rb +3 -3
  51. data/lib/tinkerforge/bricklet_gps_v3.rb +593 -0
  52. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  53. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +2 -2
  54. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  55. data/lib/tinkerforge/bricklet_humidity_v2.rb +2 -2
  56. data/lib/tinkerforge/bricklet_imu_v3.rb +2 -2
  57. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  58. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +2 -2
  59. data/lib/tinkerforge/bricklet_industrial_counter.rb +2 -2
  60. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  61. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +2 -2
  62. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  63. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +2 -2
  64. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  65. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +2 -2
  66. data/lib/tinkerforge/bricklet_industrial_dual_ac_in.rb +332 -0
  67. data/lib/tinkerforge/bricklet_industrial_dual_ac_relay.rb +2 -2
  68. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  69. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +2 -2
  70. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +2 -2
  71. data/lib/tinkerforge/bricklet_industrial_ptc.rb +2 -2
  72. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  73. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +2 -2
  74. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  75. data/lib/tinkerforge/bricklet_io16_v2.rb +2 -2
  76. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  77. data/lib/tinkerforge/bricklet_io4_v2.rb +2 -2
  78. data/lib/tinkerforge/bricklet_isolator.rb +2 -2
  79. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  80. data/lib/tinkerforge/bricklet_joystick_v2.rb +2 -2
  81. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  82. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +2 -2
  83. data/lib/tinkerforge/bricklet_lcd_128x64.rb +4 -2
  84. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  85. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  86. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  87. data/lib/tinkerforge/bricklet_led_strip_v2.rb +2 -2
  88. data/lib/tinkerforge/bricklet_line.rb +2 -2
  89. data/lib/tinkerforge/bricklet_linear_poti.rb +3 -3
  90. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +3 -3
  91. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  92. data/lib/tinkerforge/bricklet_load_cell_v2.rb +2 -2
  93. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  94. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  95. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +2 -2
  96. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +2 -2
  97. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  98. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +2 -2
  99. data/lib/tinkerforge/bricklet_nfc.rb +21 -3
  100. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  101. data/lib/tinkerforge/bricklet_oled_128x64.rb +4 -2
  102. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +4 -2
  103. data/lib/tinkerforge/bricklet_oled_64x48.rb +4 -2
  104. data/lib/tinkerforge/bricklet_one_wire.rb +2 -2
  105. data/lib/tinkerforge/bricklet_outdoor_weather.rb +2 -2
  106. data/lib/tinkerforge/bricklet_particulate_matter.rb +2 -2
  107. data/lib/tinkerforge/bricklet_performance_dc.rb +2 -2
  108. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  109. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  110. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +2 -2
  111. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  112. data/lib/tinkerforge/bricklet_ptc_v2.rb +2 -2
  113. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  114. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +2 -2
  115. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  116. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +2 -2
  117. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  118. data/lib/tinkerforge/bricklet_rgb_led_button.rb +2 -2
  119. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  120. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +2 -2
  121. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  122. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +2 -2
  123. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  124. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +2 -2
  125. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  126. data/lib/tinkerforge/bricklet_rs232_v2.rb +2 -2
  127. data/lib/tinkerforge/bricklet_rs485.rb +2 -2
  128. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  129. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +2 -2
  130. data/lib/tinkerforge/bricklet_servo_v2.rb +2 -2
  131. data/lib/tinkerforge/bricklet_silent_stepper_v2.rb +2 -2
  132. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  133. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +2 -2
  134. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  135. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +2 -2
  136. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  137. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  138. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +2 -2
  139. data/lib/tinkerforge/bricklet_temperature_v2.rb +2 -2
  140. data/lib/tinkerforge/bricklet_thermal_imaging.rb +48 -3
  141. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  142. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +2 -2
  143. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  144. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  145. data/lib/tinkerforge/bricklet_uv_light_v2.rb +2 -2
  146. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  147. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  148. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +2 -2
  149. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +2 -2
  150. data/lib/tinkerforge/device_display_names.rb +7 -3
  151. data/lib/tinkerforge/version.rb +1 -1
  152. metadata +7 -4
@@ -0,0 +1,593 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2024-02-27. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.31 #
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
+ require_relative './ip_connection'
13
+
14
+ module Tinkerforge
15
+ # Determine position, velocity and altitude using GPS
16
+ class BrickletGPSV3 < Device
17
+ DEVICE_IDENTIFIER = 2171 # :nodoc:
18
+ DEVICE_DISPLAY_NAME = 'GPS Bricklet 3.0' # :nodoc:
19
+
20
+ # This callback is triggered precisely once per second,
21
+ # see `PPS <https://en.wikipedia.org/wiki/Pulse-per-second_signal>`__.
22
+ #
23
+ # The precision of two subsequent pulses will be skewed because
24
+ # of the latency in the USB/RS485/Ethernet connection. But in the
25
+ # long run this will be very precise. For example a count of
26
+ # 3600 pulses will take exactly 1 hour.
27
+ CALLBACK_PULSE_PER_SECOND = 21
28
+
29
+ # This callback is triggered periodically with the period that is set by
30
+ # BrickletGPSV3#set_coordinates_callback_period. The parameters are the same
31
+ # as for BrickletGPSV3#get_coordinates.
32
+ #
33
+ # The CALLBACK_COORDINATES callback is only triggered if the coordinates changed
34
+ # since the last triggering and if there is currently a fix as indicated by
35
+ # BrickletGPSV3#get_status.
36
+ CALLBACK_COORDINATES = 22
37
+
38
+ # This callback is triggered periodically with the period that is set by
39
+ # BrickletGPSV3#set_status_callback_period. The parameters are the same
40
+ # as for BrickletGPSV3#get_status.
41
+ #
42
+ # The CALLBACK_STATUS callback is only triggered if the status changed since the
43
+ # last triggering.
44
+ CALLBACK_STATUS = 23
45
+
46
+ # This callback is triggered periodically with the period that is set by
47
+ # BrickletGPSV3#set_altitude_callback_period. The parameters are the same
48
+ # as for BrickletGPSV3#get_altitude.
49
+ #
50
+ # The CALLBACK_ALTITUDE callback is only triggered if the altitude changed since the
51
+ # last triggering and if there is currently a fix as indicated by
52
+ # BrickletGPSV3#get_status.
53
+ CALLBACK_ALTITUDE = 24
54
+
55
+ # This callback is triggered periodically with the period that is set by
56
+ # BrickletGPSV3#set_motion_callback_period. The parameters are the same
57
+ # as for BrickletGPSV3#get_motion.
58
+ #
59
+ # The CALLBACK_MOTION callback is only triggered if the motion changed since the
60
+ # last triggering and if there is currently a fix as indicated by
61
+ # BrickletGPSV3#get_status.
62
+ CALLBACK_MOTION = 25
63
+
64
+ # This callback is triggered periodically with the period that is set by
65
+ # BrickletGPSV3#set_date_time_callback_period. The parameters are the same
66
+ # as for BrickletGPSV3#get_date_time.
67
+ #
68
+ # The CALLBACK_DATE_TIME callback is only triggered if the date or time changed
69
+ # since the last triggering.
70
+ CALLBACK_DATE_TIME = 26
71
+
72
+ FUNCTION_GET_COORDINATES = 1 # :nodoc:
73
+ FUNCTION_GET_STATUS = 2 # :nodoc:
74
+ FUNCTION_GET_ALTITUDE = 3 # :nodoc:
75
+ FUNCTION_GET_MOTION = 4 # :nodoc:
76
+ FUNCTION_GET_DATE_TIME = 5 # :nodoc:
77
+ FUNCTION_RESTART = 6 # :nodoc:
78
+ FUNCTION_GET_SATELLITE_SYSTEM_STATUS_LOW_LEVEL = 7 # :nodoc:
79
+ FUNCTION_GET_SATELLITE_STATUS = 8 # :nodoc:
80
+ FUNCTION_SET_FIX_LED_CONFIG = 9 # :nodoc:
81
+ FUNCTION_GET_FIX_LED_CONFIG = 10 # :nodoc:
82
+ FUNCTION_SET_COORDINATES_CALLBACK_PERIOD = 11 # :nodoc:
83
+ FUNCTION_GET_COORDINATES_CALLBACK_PERIOD = 12 # :nodoc:
84
+ FUNCTION_SET_STATUS_CALLBACK_PERIOD = 13 # :nodoc:
85
+ FUNCTION_GET_STATUS_CALLBACK_PERIOD = 14 # :nodoc:
86
+ FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD = 15 # :nodoc:
87
+ FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD = 16 # :nodoc:
88
+ FUNCTION_SET_MOTION_CALLBACK_PERIOD = 17 # :nodoc:
89
+ FUNCTION_GET_MOTION_CALLBACK_PERIOD = 18 # :nodoc:
90
+ FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD = 19 # :nodoc:
91
+ FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD = 20 # :nodoc:
92
+ FUNCTION_SET_SBAS_CONFIG = 27 # :nodoc:
93
+ FUNCTION_GET_SBAS_CONFIG = 28 # :nodoc:
94
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
95
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
96
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
97
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
98
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
99
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
100
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
101
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
102
+ FUNCTION_RESET = 243 # :nodoc:
103
+ FUNCTION_WRITE_UID = 248 # :nodoc:
104
+ FUNCTION_READ_UID = 249 # :nodoc:
105
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
106
+
107
+ RESTART_TYPE_HOT_START = 0 # :nodoc:
108
+ RESTART_TYPE_WARM_START = 1 # :nodoc:
109
+ RESTART_TYPE_COLD_START = 2 # :nodoc:
110
+ RESTART_TYPE_FACTORY_RESET = 3 # :nodoc:
111
+ SATELLITE_SYSTEM_GPS = 0 # :nodoc:
112
+ SATELLITE_SYSTEM_GLONASS = 1 # :nodoc:
113
+ SATELLITE_SYSTEM_GALILEO = 2 # :nodoc:
114
+ FIX_NO_FIX = 1 # :nodoc:
115
+ FIX_2D_FIX = 2 # :nodoc:
116
+ FIX_3D_FIX = 3 # :nodoc:
117
+ FIX_LED_CONFIG_OFF = 0 # :nodoc:
118
+ FIX_LED_CONFIG_ON = 1 # :nodoc:
119
+ FIX_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
120
+ FIX_LED_CONFIG_SHOW_FIX = 3 # :nodoc:
121
+ FIX_LED_CONFIG_SHOW_PPS = 4 # :nodoc:
122
+ SBAS_ENABLED = 0 # :nodoc:
123
+ SBAS_DISABLED = 1 # :nodoc:
124
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
125
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
126
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
127
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
128
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
129
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
130
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
131
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
132
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
133
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
134
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
135
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
136
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
137
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
138
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
139
+
140
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
141
+ # the IP Connection <tt>ipcon</tt>.
142
+ def initialize(uid, ipcon)
143
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
144
+
145
+ @api_version = [2, 0, 0]
146
+
147
+ @response_expected[FUNCTION_GET_COORDINATES] = RESPONSE_EXPECTED_ALWAYS_TRUE
148
+ @response_expected[FUNCTION_GET_STATUS] = RESPONSE_EXPECTED_ALWAYS_TRUE
149
+ @response_expected[FUNCTION_GET_ALTITUDE] = RESPONSE_EXPECTED_ALWAYS_TRUE
150
+ @response_expected[FUNCTION_GET_MOTION] = RESPONSE_EXPECTED_ALWAYS_TRUE
151
+ @response_expected[FUNCTION_GET_DATE_TIME] = RESPONSE_EXPECTED_ALWAYS_TRUE
152
+ @response_expected[FUNCTION_RESTART] = RESPONSE_EXPECTED_FALSE
153
+ @response_expected[FUNCTION_GET_SATELLITE_SYSTEM_STATUS_LOW_LEVEL] = RESPONSE_EXPECTED_ALWAYS_TRUE
154
+ @response_expected[FUNCTION_GET_SATELLITE_STATUS] = RESPONSE_EXPECTED_ALWAYS_TRUE
155
+ @response_expected[FUNCTION_SET_FIX_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
156
+ @response_expected[FUNCTION_GET_FIX_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
157
+ @response_expected[FUNCTION_SET_COORDINATES_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
158
+ @response_expected[FUNCTION_GET_COORDINATES_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
159
+ @response_expected[FUNCTION_SET_STATUS_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
160
+ @response_expected[FUNCTION_GET_STATUS_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
161
+ @response_expected[FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
162
+ @response_expected[FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
163
+ @response_expected[FUNCTION_SET_MOTION_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
164
+ @response_expected[FUNCTION_GET_MOTION_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
165
+ @response_expected[FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD] = RESPONSE_EXPECTED_TRUE
166
+ @response_expected[FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD] = RESPONSE_EXPECTED_ALWAYS_TRUE
167
+ @response_expected[FUNCTION_SET_SBAS_CONFIG] = RESPONSE_EXPECTED_FALSE
168
+ @response_expected[FUNCTION_GET_SBAS_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
169
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
170
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
171
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
172
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
173
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
174
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
175
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
176
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
177
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
178
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
179
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
180
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
181
+
182
+ @callback_formats[CALLBACK_PULSE_PER_SECOND] = [8, '']
183
+ @callback_formats[CALLBACK_COORDINATES] = [18, 'L k L k']
184
+ @callback_formats[CALLBACK_STATUS] = [10, '? C']
185
+ @callback_formats[CALLBACK_ALTITUDE] = [16, 'l l']
186
+ @callback_formats[CALLBACK_MOTION] = [16, 'L L']
187
+ @callback_formats[CALLBACK_DATE_TIME] = [16, 'L L']
188
+
189
+ @ipcon.add_device self
190
+ end
191
+
192
+ # Returns the GPS coordinates. Latitude and longitude are given in the
193
+ # ``DD.dddddd°`` format, the value 57123468 means 57.123468°.
194
+ # The parameter ``ns`` and ``ew`` are the cardinal directions for
195
+ # latitude and longitude. Possible values for ``ns`` and ``ew`` are 'N', 'S', 'E'
196
+ # and 'W' (north, south, east and west).
197
+ #
198
+ # This data is only valid if there is currently a fix as indicated by
199
+ # BrickletGPSV3#get_status.
200
+ def get_coordinates
201
+ check_validity
202
+
203
+ send_request FUNCTION_GET_COORDINATES, [], '', 18, 'L k L k'
204
+ end
205
+
206
+ # Returns if a fix is currently available as well as the number of
207
+ # satellites that are in view.
208
+ #
209
+ # There is also a :ref:`green LED <gps_v2_bricklet_fix_led>` on the Bricklet that
210
+ # indicates the fix status.
211
+ def get_status
212
+ check_validity
213
+
214
+ send_request FUNCTION_GET_STATUS, [], '', 10, '? C'
215
+ end
216
+
217
+ # Returns the current altitude and corresponding geoidal separation.
218
+ #
219
+ # This data is only valid if there is currently a fix as indicated by
220
+ # BrickletGPSV3#get_status.
221
+ def get_altitude
222
+ check_validity
223
+
224
+ send_request FUNCTION_GET_ALTITUDE, [], '', 16, 'l l'
225
+ end
226
+
227
+ # Returns the current course and speed. A course of 0° means the Bricklet is
228
+ # traveling north bound and 90° means it is traveling east bound.
229
+ #
230
+ # Please note that this only returns useful values if an actual movement
231
+ # is present.
232
+ #
233
+ # This data is only valid if there is currently a fix as indicated by
234
+ # BrickletGPSV3#get_status.
235
+ def get_motion
236
+ check_validity
237
+
238
+ send_request FUNCTION_GET_MOTION, [], '', 16, 'L L'
239
+ end
240
+
241
+ # Returns the current date and time. The date is
242
+ # given in the format ``ddmmyy`` and the time is given
243
+ # in the format ``hhmmss.sss``. For example, 140713 means
244
+ # 14.07.13 as date and 195923568 means 19:59:23.568 as time.
245
+ def get_date_time
246
+ check_validity
247
+
248
+ send_request FUNCTION_GET_DATE_TIME, [], '', 16, 'L L'
249
+ end
250
+
251
+ # Restarts the GPS Bricklet, the following restart types are available:
252
+ #
253
+ # "Value", "Description"
254
+ #
255
+ # "0", "Hot start (use all available data in the NV store)"
256
+ # "1", "Warm start (don't use ephemeris at restart)"
257
+ # "2", "Cold start (don't use time, position, almanacs and ephemeris at restart)"
258
+ # "3", "Factory reset (clear all system/user configurations at restart)"
259
+ def restart(restart_type)
260
+ check_validity
261
+
262
+ send_request FUNCTION_RESTART, [restart_type], 'C', 8, ''
263
+ end
264
+
265
+ # Returns the
266
+ #
267
+ # * satellite numbers list (up to 12 items)
268
+ # * fix value,
269
+ # * PDOP value,
270
+ # * HDOP value and
271
+ # * VDOP value
272
+ #
273
+ # for a given satellite system. Currently GPS and GLONASS are supported, Galileo
274
+ # is not yet supported.
275
+ #
276
+ # The GPS and GLONASS satellites have unique numbers and the satellite list gives
277
+ # the numbers of the satellites that are currently utilized. The number 0 is not
278
+ # a valid satellite number and can be ignored in the list.
279
+ def get_satellite_system_status_low_level(satellite_system)
280
+ check_validity
281
+
282
+ send_request FUNCTION_GET_SATELLITE_SYSTEM_STATUS_LOW_LEVEL, [satellite_system], 'C', 28, 'C C12 C S S S'
283
+ end
284
+
285
+ # Returns the current elevation, azimuth and SNR
286
+ # for a given satellite and satellite system.
287
+ #
288
+ # The satellite number here always goes from 1 to 32. For GLONASS it corresponds to
289
+ # the satellites 65-96.
290
+ #
291
+ # Galileo is not yet supported.
292
+ def get_satellite_status(satellite_system, satellite_number)
293
+ check_validity
294
+
295
+ send_request FUNCTION_GET_SATELLITE_STATUS, [satellite_system, satellite_number], 'C C', 14, 's s s'
296
+ end
297
+
298
+ # Sets the fix LED configuration. By default the LED shows if
299
+ # the Bricklet got a GPS fix yet. If a fix is established the LED turns on.
300
+ # If there is no fix then the LED is turned off.
301
+ #
302
+ # You can also turn the LED permanently on/off, show a heartbeat or let it blink
303
+ # in sync with the PPS (pulse per second) output of the GPS module.
304
+ #
305
+ # If the Bricklet is in bootloader mode, the LED is off.
306
+ def set_fix_led_config(config)
307
+ check_validity
308
+
309
+ send_request FUNCTION_SET_FIX_LED_CONFIG, [config], 'C', 8, ''
310
+ end
311
+
312
+ # Returns the configuration as set by BrickletGPSV3#set_fix_led_config
313
+ def get_fix_led_config
314
+ check_validity
315
+
316
+ send_request FUNCTION_GET_FIX_LED_CONFIG, [], '', 9, 'C'
317
+ end
318
+
319
+ # Sets the period with which the CALLBACK_COORDINATES callback is triggered
320
+ # periodically. A value of 0 turns the callback off.
321
+ #
322
+ # The CALLBACK_COORDINATES callback is only triggered if the coordinates changed
323
+ # since the last triggering.
324
+ def set_coordinates_callback_period(period)
325
+ check_validity
326
+
327
+ send_request FUNCTION_SET_COORDINATES_CALLBACK_PERIOD, [period], 'L', 8, ''
328
+ end
329
+
330
+ # Returns the period as set by BrickletGPSV3#set_coordinates_callback_period.
331
+ def get_coordinates_callback_period
332
+ check_validity
333
+
334
+ send_request FUNCTION_GET_COORDINATES_CALLBACK_PERIOD, [], '', 12, 'L'
335
+ end
336
+
337
+ # Sets the period with which the CALLBACK_STATUS callback is triggered
338
+ # periodically. A value of 0 turns the callback off.
339
+ #
340
+ # The CALLBACK_STATUS callback is only triggered if the status changed since the
341
+ # last triggering.
342
+ def set_status_callback_period(period)
343
+ check_validity
344
+
345
+ send_request FUNCTION_SET_STATUS_CALLBACK_PERIOD, [period], 'L', 8, ''
346
+ end
347
+
348
+ # Returns the period as set by BrickletGPSV3#set_status_callback_period.
349
+ def get_status_callback_period
350
+ check_validity
351
+
352
+ send_request FUNCTION_GET_STATUS_CALLBACK_PERIOD, [], '', 12, 'L'
353
+ end
354
+
355
+ # Sets the period with which the CALLBACK_ALTITUDE callback is triggered
356
+ # periodically. A value of 0 turns the callback off.
357
+ #
358
+ # The CALLBACK_ALTITUDE callback is only triggered if the altitude changed since the
359
+ # last triggering.
360
+ def set_altitude_callback_period(period)
361
+ check_validity
362
+
363
+ send_request FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD, [period], 'L', 8, ''
364
+ end
365
+
366
+ # Returns the period as set by BrickletGPSV3#set_altitude_callback_period.
367
+ def get_altitude_callback_period
368
+ check_validity
369
+
370
+ send_request FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD, [], '', 12, 'L'
371
+ end
372
+
373
+ # Sets the period with which the CALLBACK_MOTION callback is triggered
374
+ # periodically. A value of 0 turns the callback off.
375
+ #
376
+ # The CALLBACK_MOTION callback is only triggered if the motion changed since the
377
+ # last triggering.
378
+ def set_motion_callback_period(period)
379
+ check_validity
380
+
381
+ send_request FUNCTION_SET_MOTION_CALLBACK_PERIOD, [period], 'L', 8, ''
382
+ end
383
+
384
+ # Returns the period as set by BrickletGPSV3#set_motion_callback_period.
385
+ def get_motion_callback_period
386
+ check_validity
387
+
388
+ send_request FUNCTION_GET_MOTION_CALLBACK_PERIOD, [], '', 12, 'L'
389
+ end
390
+
391
+ # Sets the period with which the CALLBACK_DATE_TIME callback is triggered
392
+ # periodically. A value of 0 turns the callback off.
393
+ #
394
+ # The CALLBACK_DATE_TIME callback is only triggered if the date or time changed
395
+ # since the last triggering.
396
+ def set_date_time_callback_period(period)
397
+ check_validity
398
+
399
+ send_request FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD, [period], 'L', 8, ''
400
+ end
401
+
402
+ # Returns the period as set by BrickletGPSV3#set_date_time_callback_period.
403
+ def get_date_time_callback_period
404
+ check_validity
405
+
406
+ send_request FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD, [], '', 12, 'L'
407
+ end
408
+
409
+ # If `SBAS <https://en.wikipedia.org/wiki/GNSS_augmentation#Satellite-based_augmentation_system>`__ is enabled,
410
+ # the position accuracy increases (if SBAS satellites are in view),
411
+ # but the update rate is limited to 5Hz. With SBAS disabled the update rate is increased to 10Hz.
412
+ def set_sbas_config(sbas_config)
413
+ check_validity
414
+
415
+ send_request FUNCTION_SET_SBAS_CONFIG, [sbas_config], 'C', 8, ''
416
+ end
417
+
418
+ # Returns the SBAS configuration as set by BrickletGPSV3#set_sbas_config
419
+ def get_sbas_config
420
+ check_validity
421
+
422
+ send_request FUNCTION_GET_SBAS_CONFIG, [], '', 9, 'C'
423
+ end
424
+
425
+ # Returns the error count for the communication between Brick and Bricklet.
426
+ #
427
+ # The errors are divided into
428
+ #
429
+ # * ACK checksum errors,
430
+ # * message checksum errors,
431
+ # * framing errors and
432
+ # * overflow errors.
433
+ #
434
+ # The errors counts are for errors that occur on the Bricklet side. All
435
+ # Bricks have a similar function that returns the errors on the Brick side.
436
+ def get_spitfp_error_count
437
+ check_validity
438
+
439
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
440
+ end
441
+
442
+ # Sets the bootloader mode and returns the status after the requested
443
+ # mode change was instigated.
444
+ #
445
+ # You can change from bootloader mode to firmware mode and vice versa. A change
446
+ # from bootloader mode to firmware mode will only take place if the entry function,
447
+ # device identifier and CRC are present and correct.
448
+ #
449
+ # This function is used by Brick Viewer during flashing. It should not be
450
+ # necessary to call it in a normal user program.
451
+ def set_bootloader_mode(mode)
452
+ check_validity
453
+
454
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
455
+ end
456
+
457
+ # Returns the current bootloader mode, see BrickletGPSV3#set_bootloader_mode.
458
+ def get_bootloader_mode
459
+ check_validity
460
+
461
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
462
+ end
463
+
464
+ # Sets the firmware pointer for BrickletGPSV3#write_firmware. The pointer has
465
+ # to be increased by chunks of size 64. The data is written to flash
466
+ # every 4 chunks (which equals to one page of size 256).
467
+ #
468
+ # This function is used by Brick Viewer during flashing. It should not be
469
+ # necessary to call it in a normal user program.
470
+ def set_write_firmware_pointer(pointer)
471
+ check_validity
472
+
473
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
474
+ end
475
+
476
+ # Writes 64 Bytes of firmware at the position as written by
477
+ # BrickletGPSV3#set_write_firmware_pointer before. The firmware is written
478
+ # to flash every 4 chunks.
479
+ #
480
+ # You can only write firmware in bootloader mode.
481
+ #
482
+ # This function is used by Brick Viewer during flashing. It should not be
483
+ # necessary to call it in a normal user program.
484
+ def write_firmware(data)
485
+ check_validity
486
+
487
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
488
+ end
489
+
490
+ # Sets the status LED configuration. By default the LED shows
491
+ # communication traffic between Brick and Bricklet, it flickers once
492
+ # for every 10 received data packets.
493
+ #
494
+ # You can also turn the LED permanently on/off or show a heartbeat.
495
+ #
496
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
497
+ def set_status_led_config(config)
498
+ check_validity
499
+
500
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
501
+ end
502
+
503
+ # Returns the configuration as set by BrickletGPSV3#set_status_led_config
504
+ def get_status_led_config
505
+ check_validity
506
+
507
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
508
+ end
509
+
510
+ # Returns the temperature as measured inside the microcontroller. The
511
+ # value returned is not the ambient temperature!
512
+ #
513
+ # The temperature is only proportional to the real temperature and it has bad
514
+ # accuracy. Practically it is only useful as an indicator for
515
+ # temperature changes.
516
+ def get_chip_temperature
517
+ check_validity
518
+
519
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
520
+ end
521
+
522
+ # Calling this function will reset the Bricklet. All configurations
523
+ # will be lost.
524
+ #
525
+ # After a reset you have to create new device objects,
526
+ # calling functions on the existing ones will result in
527
+ # undefined behavior!
528
+ def reset
529
+ check_validity
530
+
531
+ send_request FUNCTION_RESET, [], '', 8, ''
532
+ end
533
+
534
+ # Writes a new UID into flash. If you want to set a new UID
535
+ # you have to decode the Base58 encoded UID string into an
536
+ # integer first.
537
+ #
538
+ # We recommend that you use Brick Viewer to change the UID.
539
+ def write_uid(uid)
540
+ check_validity
541
+
542
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
543
+ end
544
+
545
+ # Returns the current UID as an integer. Encode as
546
+ # Base58 to get the usual string version.
547
+ def read_uid
548
+ check_validity
549
+
550
+ send_request FUNCTION_READ_UID, [], '', 12, 'L'
551
+ end
552
+
553
+ # Returns the UID, the UID where the Bricklet is connected to,
554
+ # the position, the hardware and firmware version as well as the
555
+ # device identifier.
556
+ #
557
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
558
+ # A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
559
+ # position 'z'.
560
+ #
561
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
562
+ # |device_identifier_constant|
563
+ def get_identity
564
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
565
+ end
566
+
567
+ # Returns the
568
+ #
569
+ # * satellite numbers list (up to 12 items)
570
+ # * fix value,
571
+ # * PDOP value,
572
+ # * HDOP value and
573
+ # * VDOP value
574
+ #
575
+ # for a given satellite system. Currently GPS and GLONASS are supported, Galileo
576
+ # is not yet supported.
577
+ #
578
+ # The GPS and GLONASS satellites have unique numbers and the satellite list gives
579
+ # the numbers of the satellites that are currently utilized. The number 0 is not
580
+ # a valid satellite number and can be ignored in the list.
581
+ def get_satellite_system_status(satellite_system)
582
+ ret = get_satellite_system_status_low_level satellite_system
583
+
584
+ [ret[1][0, ret[0]], ret[2], ret[3], ret[4], ret[5]]
585
+ end
586
+
587
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
588
+ def register_callback(id, &block)
589
+ callback = block
590
+ @registered_callbacks[id] = callback
591
+ end
592
+ end
593
+ end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 2021-05-06. #
3
+ # This file was automatically generated on 2024-02-27. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.29 #
5
+ # Ruby Bindings Version 2.1.31 #
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 #