tinkerforge 2.1.10 → 2.1.11
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 +90 -3
- data/lib/tinkerforge/brick_master.rb +183 -22
- 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 +2 -2
- 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 +2 -2
- data/lib/tinkerforge/bricklet_io4.rb +2 -2
- data/lib/tinkerforge/bricklet_joystick.rb +2 -2
- data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
- 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 +2 -2
- 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 +28 -2
- data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
- 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 +2 -2
- data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
- data/lib/tinkerforge/bricklet_rgb_led.rb +3 -3
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
- data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_rs232.rb +3 -3
- 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 +3 -3
- 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 +2 -2
data/lib/tinkerforge/brick_dc.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on
|
3
|
+
# This file was automatically generated on 2017-01-25. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.11 #
|
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
|
3
|
+
# This file was automatically generated on 2017-01-25. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.11 #
|
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
|
3
|
+
# This file was automatically generated on 2017-01-25. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.11 #
|
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 #
|
@@ -91,6 +91,10 @@ module Tinkerforge
|
|
91
91
|
FUNCTION_GET_QUATERNION_PERIOD = 29 # :nodoc:
|
92
92
|
FUNCTION_SET_ALL_DATA_PERIOD = 30 # :nodoc:
|
93
93
|
FUNCTION_GET_ALL_DATA_PERIOD = 31 # :nodoc:
|
94
|
+
FUNCTION_SET_SENSOR_CONFIGURATION = 41 # :nodoc:
|
95
|
+
FUNCTION_GET_SENSOR_CONFIGURATION = 42 # :nodoc:
|
96
|
+
FUNCTION_SET_SENSOR_FUSION_MODE = 43 # :nodoc:
|
97
|
+
FUNCTION_GET_SENSOR_FUSION_MODE = 44 # :nodoc:
|
94
98
|
FUNCTION_ENABLE_STATUS_LED = 238 # :nodoc:
|
95
99
|
FUNCTION_DISABLE_STATUS_LED = 239 # :nodoc:
|
96
100
|
FUNCTION_IS_STATUS_LED_ENABLED = 240 # :nodoc:
|
@@ -99,13 +103,48 @@ module Tinkerforge
|
|
99
103
|
FUNCTION_RESET = 243 # :nodoc:
|
100
104
|
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
101
105
|
|
106
|
+
MAGNETOMETER_RATE_2HZ = 0 # :nodoc:
|
107
|
+
MAGNETOMETER_RATE_6HZ = 1 # :nodoc:
|
108
|
+
MAGNETOMETER_RATE_8HZ = 2 # :nodoc:
|
109
|
+
MAGNETOMETER_RATE_10HZ = 3 # :nodoc:
|
110
|
+
MAGNETOMETER_RATE_15HZ = 4 # :nodoc:
|
111
|
+
MAGNETOMETER_RATE_20HZ = 5 # :nodoc:
|
112
|
+
MAGNETOMETER_RATE_25HZ = 6 # :nodoc:
|
113
|
+
MAGNETOMETER_RATE_30HZ = 7 # :nodoc:
|
114
|
+
GYROSCOPE_RANGE_2000DPS = 0 # :nodoc:
|
115
|
+
GYROSCOPE_RANGE_1000DPS = 1 # :nodoc:
|
116
|
+
GYROSCOPE_RANGE_500DPS = 2 # :nodoc:
|
117
|
+
GYROSCOPE_RANGE_250DPS = 3 # :nodoc:
|
118
|
+
GYROSCOPE_RANGE_125DPS = 4 # :nodoc:
|
119
|
+
GYROSCOPE_BANDWIDTH_523HZ = 0 # :nodoc:
|
120
|
+
GYROSCOPE_BANDWIDTH_230HZ = 1 # :nodoc:
|
121
|
+
GYROSCOPE_BANDWIDTH_116HZ = 2 # :nodoc:
|
122
|
+
GYROSCOPE_BANDWIDTH_47HZ = 3 # :nodoc:
|
123
|
+
GYROSCOPE_BANDWIDTH_23HZ = 4 # :nodoc:
|
124
|
+
GYROSCOPE_BANDWIDTH_12HZ = 5 # :nodoc:
|
125
|
+
GYROSCOPE_BANDWIDTH_64HZ = 6 # :nodoc:
|
126
|
+
GYROSCOPE_BANDWIDTH_32HZ = 7 # :nodoc:
|
127
|
+
ACCELEROMETER_RANGE_2G = 0 # :nodoc:
|
128
|
+
ACCELEROMETER_RANGE_4G = 1 # :nodoc:
|
129
|
+
ACCELEROMETER_RANGE_8G = 2 # :nodoc:
|
130
|
+
ACCELEROMETER_RANGE_16G = 3 # :nodoc:
|
131
|
+
ACCELEROMETER_BANDWIDTH_7_81HZ = 0 # :nodoc:
|
132
|
+
ACCELEROMETER_BANDWIDTH_15_63HZ = 1 # :nodoc:
|
133
|
+
ACCELEROMETER_BANDWIDTH_31_25HZ = 2 # :nodoc:
|
134
|
+
ACCELEROMETER_BANDWIDTH_62_5HZ = 3 # :nodoc:
|
135
|
+
ACCELEROMETER_BANDWIDTH_125HZ = 4 # :nodoc:
|
136
|
+
ACCELEROMETER_BANDWIDTH_250HZ = 5 # :nodoc:
|
137
|
+
ACCELEROMETER_BANDWIDTH_500HZ = 6 # :nodoc:
|
138
|
+
ACCELEROMETER_BANDWIDTH_1000HZ = 7 # :nodoc:
|
139
|
+
SENSOR_FUSION_OFF = 0 # :nodoc:
|
140
|
+
SENSOR_FUSION_ON = 1 # :nodoc:
|
102
141
|
|
103
142
|
# Creates an object with the unique device ID <tt>uid</tt> and adds it to
|
104
143
|
# the IP Connection <tt>ipcon</tt>.
|
105
144
|
def initialize(uid, ipcon)
|
106
145
|
super uid, ipcon
|
107
146
|
|
108
|
-
@api_version = [2, 0,
|
147
|
+
@api_version = [2, 0, 1]
|
109
148
|
|
110
149
|
@response_expected[FUNCTION_GET_ACCELERATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
111
150
|
@response_expected[FUNCTION_GET_MAGNETIC_FIELD] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
@@ -147,6 +186,10 @@ module Tinkerforge
|
|
147
186
|
@response_expected[CALLBACK_ORIENTATION] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
148
187
|
@response_expected[CALLBACK_QUATERNION] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
149
188
|
@response_expected[CALLBACK_ALL_DATA] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
189
|
+
@response_expected[FUNCTION_SET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
|
190
|
+
@response_expected[FUNCTION_GET_SENSOR_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
191
|
+
@response_expected[FUNCTION_SET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_FALSE
|
192
|
+
@response_expected[FUNCTION_GET_SENSOR_FUSION_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
150
193
|
@response_expected[FUNCTION_ENABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
151
194
|
@response_expected[FUNCTION_DISABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
152
195
|
@response_expected[FUNCTION_IS_STATUS_LED_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
@@ -431,6 +474,50 @@ module Tinkerforge
|
|
431
474
|
send_request(FUNCTION_GET_ALL_DATA_PERIOD, [], '', 4, 'L')
|
432
475
|
end
|
433
476
|
|
477
|
+
# Sets the available sensor configuration for the Magnetometer, Gyroscope and
|
478
|
+
# Accelerometer. The Accelerometer Range is user selectable in all fusion modes,
|
479
|
+
# all other configurations are auto-controlled in fusion mode.
|
480
|
+
#
|
481
|
+
# The default values are:
|
482
|
+
#
|
483
|
+
# * Magnetometer Rate 20Hz
|
484
|
+
# * Gyroscope Range 2000°/s
|
485
|
+
# * Gyroscope Bandwidth 32Hz
|
486
|
+
# * Accelerometer Range +/-4G
|
487
|
+
# * Accelerometer Bandwidth 62.5Hz
|
488
|
+
#
|
489
|
+
#
|
490
|
+
# .. versionadded:: 2.0.5$nbsp;(Firmware)
|
491
|
+
def set_sensor_configuration(magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth)
|
492
|
+
send_request(FUNCTION_SET_SENSOR_CONFIGURATION, [magnetometer_rate, gyroscope_range, gyroscope_bandwidth, accelerometer_range, accelerometer_bandwidth], 'C C C C C', 0, '')
|
493
|
+
end
|
494
|
+
|
495
|
+
# Returns the sensor configuration as set by BrickIMUV2#set_sensor_configuration.
|
496
|
+
#
|
497
|
+
# .. versionadded:: 2.0.5$nbsp;(Firmware)
|
498
|
+
def get_sensor_configuration
|
499
|
+
send_request(FUNCTION_GET_SENSOR_CONFIGURATION, [], '', 5, 'C C C C C')
|
500
|
+
end
|
501
|
+
|
502
|
+
# If the fusion mode is turned off, the functions
|
503
|
+
# BrickIMUV2#get_acceleration, BrickIMUV2#get_magnetic_field and BrickIMUV2#get_angular_velocity
|
504
|
+
# return uncalibrated and uncompensated sensor data. All other sensor data getters
|
505
|
+
# return no data.
|
506
|
+
#
|
507
|
+
# By default sensor fusion is on.
|
508
|
+
#
|
509
|
+
# .. versionadded:: 2.0.5$nbsp;(Firmware)
|
510
|
+
def set_sensor_fusion_mode(mode)
|
511
|
+
send_request(FUNCTION_SET_SENSOR_FUSION_MODE, [mode], 'C', 0, '')
|
512
|
+
end
|
513
|
+
|
514
|
+
# Returns the sensor fusion mode as set by BrickIMUV2#set_sensor_fusion_mode.
|
515
|
+
#
|
516
|
+
# .. versionadded:: 2.0.5$nbsp;(Firmware)
|
517
|
+
def get_sensor_fusion_mode
|
518
|
+
send_request(FUNCTION_GET_SENSOR_FUSION_MODE, [], '', 1, 'C')
|
519
|
+
end
|
520
|
+
|
434
521
|
# Enables the status LED.
|
435
522
|
#
|
436
523
|
# The status LED is the blue LED next to the USB connector. If enabled is is
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on
|
3
|
+
# This file was automatically generated on 2017-01-25. #
|
4
4
|
# #
|
5
|
-
# Ruby Bindings Version 2.1.
|
5
|
+
# Ruby Bindings Version 2.1.11 #
|
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 #
|
@@ -172,6 +172,15 @@ module Tinkerforge
|
|
172
172
|
FUNCTION_ENABLE_WIFI2_STATUS_LED = 99 # :nodoc:
|
173
173
|
FUNCTION_DISABLE_WIFI2_STATUS_LED = 100 # :nodoc:
|
174
174
|
FUNCTION_IS_WIFI2_STATUS_LED_ENABLED = 101 # :nodoc:
|
175
|
+
FUNCTION_SET_WIFI2_MESH_CONFIGURATION = 102 # :nodoc:
|
176
|
+
FUNCTION_GET_WIFI2_MESH_CONFIGURATION = 103 # :nodoc:
|
177
|
+
FUNCTION_SET_WIFI2_MESH_ROUTER_SSID = 104 # :nodoc:
|
178
|
+
FUNCTION_GET_WIFI2_MESH_ROUTER_SSID = 105 # :nodoc:
|
179
|
+
FUNCTION_SET_WIFI2_MESH_ROUTER_PASSWORD = 106 # :nodoc:
|
180
|
+
FUNCTION_GET_WIFI2_MESH_ROUTER_PASSWORD = 107 # :nodoc:
|
181
|
+
FUNCTION_GET_WIFI2_MESH_COMMON_STATUS = 108 # :nodoc:
|
182
|
+
FUNCTION_GET_WIFI2_MESH_CLIENT_STATUS = 109 # :nodoc:
|
183
|
+
FUNCTION_GET_WIFI2_MESH_AP_STATUS = 110 # :nodoc:
|
175
184
|
FUNCTION_ENABLE_STATUS_LED = 238 # :nodoc:
|
176
185
|
FUNCTION_DISABLE_STATUS_LED = 239 # :nodoc:
|
177
186
|
FUNCTION_IS_STATUS_LED_ENABLED = 240 # :nodoc:
|
@@ -251,6 +260,14 @@ module Tinkerforge
|
|
251
260
|
WIFI2_AP_ENCRYPTION_WPA_PSK = 2 # :nodoc:
|
252
261
|
WIFI2_AP_ENCRYPTION_WPA2_PSK = 3 # :nodoc:
|
253
262
|
WIFI2_AP_ENCRYPTION_WPA_WPA2_PSK = 4 # :nodoc:
|
263
|
+
WIFI2_MESH_STATUS_DISABLED = 0 # :nodoc:
|
264
|
+
WIFI2_MESH_STATUS_WIFI_CONNECTING = 1 # :nodoc:
|
265
|
+
WIFI2_MESH_STATUS_GOT_IP = 2 # :nodoc:
|
266
|
+
WIFI2_MESH_STATUS_MESH_LOCAL = 3 # :nodoc:
|
267
|
+
WIFI2_MESH_STATUS_MESH_ONLINE = 4 # :nodoc:
|
268
|
+
WIFI2_MESH_STATUS_AP_AVAILABLE = 5 # :nodoc:
|
269
|
+
WIFI2_MESH_STATUS_AP_SETUP = 6 # :nodoc:
|
270
|
+
WIFI2_MESH_STATUS_LEAF_AVAILABLE = 7 # :nodoc:
|
254
271
|
|
255
272
|
# Creates an object with the unique device ID <tt>uid</tt> and adds it to
|
256
273
|
# the IP Connection <tt>ipcon</tt>.
|
@@ -360,6 +377,15 @@ module Tinkerforge
|
|
360
377
|
@response_expected[FUNCTION_ENABLE_WIFI2_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
361
378
|
@response_expected[FUNCTION_DISABLE_WIFI2_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
362
379
|
@response_expected[FUNCTION_IS_WIFI2_STATUS_LED_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
380
|
+
@response_expected[FUNCTION_SET_WIFI2_MESH_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
|
381
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
382
|
+
@response_expected[FUNCTION_SET_WIFI2_MESH_ROUTER_SSID] = RESPONSE_EXPECTED_FALSE
|
383
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_ROUTER_SSID] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
384
|
+
@response_expected[FUNCTION_SET_WIFI2_MESH_ROUTER_PASSWORD] = RESPONSE_EXPECTED_FALSE
|
385
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_ROUTER_PASSWORD] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
386
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_COMMON_STATUS] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
387
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_CLIENT_STATUS] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
388
|
+
@response_expected[FUNCTION_GET_WIFI2_MESH_AP_STATUS] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
363
389
|
@response_expected[FUNCTION_ENABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
364
390
|
@response_expected[FUNCTION_DISABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
|
365
391
|
@response_expected[FUNCTION_IS_STATUS_LED_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
@@ -858,7 +884,7 @@ module Tinkerforge
|
|
858
884
|
send_request(FUNCTION_SET_STACK_CURRENT_CALLBACK_PERIOD, [period], 'L', 0, '')
|
859
885
|
end
|
860
886
|
|
861
|
-
# Returns the period as set by
|
887
|
+
# Returns the period as set by BrickMaster#set_stack_current_callback_period.
|
862
888
|
#
|
863
889
|
# .. versionadded:: 2.0.5$nbsp;(Firmware)
|
864
890
|
def get_stack_current_callback_period
|
@@ -931,7 +957,7 @@ module Tinkerforge
|
|
931
957
|
send_request(FUNCTION_GET_STACK_CURRENT_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
|
932
958
|
end
|
933
959
|
|
934
|
-
# Sets the thresholds for the
|
960
|
+
# Sets the thresholds for the CALLBACK_STACK_VOLTAGE_REACHED callback.
|
935
961
|
#
|
936
962
|
# The following options are possible:
|
937
963
|
#
|
@@ -1240,7 +1266,7 @@ module Tinkerforge
|
|
1240
1266
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1241
1267
|
# has to be restarted afterwards.
|
1242
1268
|
#
|
1243
|
-
# It is recommended to use the Brick Viewer to
|
1269
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1244
1270
|
#
|
1245
1271
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1246
1272
|
def set_wifi2_authentication_secret(secret)
|
@@ -1269,13 +1295,21 @@ module Tinkerforge
|
|
1269
1295
|
# The ``phy_mode`` parameter sets the specific wireless network mode to be used.
|
1270
1296
|
# Possible values are B, G and N. The default value is G.
|
1271
1297
|
#
|
1272
|
-
# The ``sleep_mode``
|
1298
|
+
# The ``sleep_mode`` parameter is currently unused.
|
1299
|
+
#
|
1300
|
+
# The ``website`` parameter is used to enable or disable the web interface of
|
1301
|
+
# the WIFI Extension 2.0, which is available from firmware version 2.0.1. Note
|
1302
|
+
# that, for firmware version 2.0.3 and older, to disable the the web interface
|
1303
|
+
# the ``website_port`` parameter must be set to 1 and greater than 1 to enable
|
1304
|
+
# the web interface. For firmware version 2.0.4 and later, setting this parameter
|
1305
|
+
# to 1 will enable the web interface and setting it to 0 will disable the web
|
1306
|
+
# interface.
|
1273
1307
|
#
|
1274
1308
|
# To apply configuration changes to the WIFI Extension 2.0 the
|
1275
1309
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1276
1310
|
# has to be restarted afterwards.
|
1277
1311
|
#
|
1278
|
-
# It is recommended to use the Brick Viewer to
|
1312
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1279
1313
|
#
|
1280
1314
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1281
1315
|
def set_wifi2_configuration(port, websocket_port, website_port, phy_mode, sleep_mode, website)
|
@@ -1298,16 +1332,16 @@ module Tinkerforge
|
|
1298
1332
|
|
1299
1333
|
# Sets the client specific configuration of the WIFI Extension 2.0.
|
1300
1334
|
#
|
1301
|
-
# The ``enable`` parameter enables or disables the client part
|
1335
|
+
# The ``enable`` parameter enables or disables the client part of the
|
1302
1336
|
# WIFI Extension 2.0. The default value is *true*.
|
1303
1337
|
#
|
1304
1338
|
# The ``ssid`` parameter sets the SSID (up to 32 characters) of the access point
|
1305
1339
|
# to connect to.
|
1306
1340
|
#
|
1307
|
-
# If the ``ip
|
1308
|
-
#
|
1309
|
-
# parameters can be used to configure a static IP address.
|
1310
|
-
# configuration is DHCP.
|
1341
|
+
# If the ``ip`` parameter is set to all zero then ``subnet_mask`` and ``gateway``
|
1342
|
+
# parameters are also set to all zero and DHCP is used for IP address configuration.
|
1343
|
+
# Otherwise those three parameters can be used to configure a static IP address.
|
1344
|
+
# The default configuration is DHCP.
|
1311
1345
|
#
|
1312
1346
|
# If the ``mac_address`` parameter is set to all zero then the factory MAC
|
1313
1347
|
# address is used. Otherwise this parameter can be used to set a custom MAC
|
@@ -1322,7 +1356,7 @@ module Tinkerforge
|
|
1322
1356
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1323
1357
|
# has to be restarted afterwards.
|
1324
1358
|
#
|
1325
|
-
# It is recommended to use the Brick Viewer to
|
1359
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1326
1360
|
#
|
1327
1361
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1328
1362
|
def set_wifi2_client_configuration(enable, ssid, ip, subnet_mask, gateway, mac_address, bssid)
|
@@ -1344,7 +1378,7 @@ module Tinkerforge
|
|
1344
1378
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1345
1379
|
# has to be restarted afterwards.
|
1346
1380
|
#
|
1347
|
-
# It is recommended to use the Brick Viewer to
|
1381
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1348
1382
|
#
|
1349
1383
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1350
1384
|
def set_wifi2_client_hostname(hostname)
|
@@ -1364,7 +1398,7 @@ module Tinkerforge
|
|
1364
1398
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1365
1399
|
# has to be restarted afterwards.
|
1366
1400
|
#
|
1367
|
-
# It is recommended to use the Brick Viewer to
|
1401
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1368
1402
|
#
|
1369
1403
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1370
1404
|
def set_wifi2_client_password(password)
|
@@ -1380,15 +1414,15 @@ module Tinkerforge
|
|
1380
1414
|
|
1381
1415
|
# Sets the access point specific configuration of the WIFI Extension 2.0.
|
1382
1416
|
#
|
1383
|
-
# The ``enable`` parameter enables or disables the access point part
|
1417
|
+
# The ``enable`` parameter enables or disables the access point part of the
|
1384
1418
|
# WIFI Extension 2.0. The default value is true.
|
1385
1419
|
#
|
1386
1420
|
# The ``ssid`` parameter sets the SSID (up to 32 characters) of the access point.
|
1387
1421
|
#
|
1388
|
-
# If the ``ip
|
1389
|
-
#
|
1390
|
-
#
|
1391
|
-
# is DHCP.
|
1422
|
+
# If the ``ip`` parameter is set to all zero then ``subnet_mask`` and ``gateway``
|
1423
|
+
# parameters are also set to all zero and DHCP is used for IP address configuration.
|
1424
|
+
# Otherwise those three parameters can be used to configure a static IP address.
|
1425
|
+
# The default configuration is DHCP.
|
1392
1426
|
#
|
1393
1427
|
# The ``encryption`` parameter sets the encryption mode to be used. Possible
|
1394
1428
|
# values are Open (no encryption), WEP or WPA/WPA2 PSK. The default value is
|
@@ -1409,7 +1443,7 @@ module Tinkerforge
|
|
1409
1443
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1410
1444
|
# has to be restarted afterwards.
|
1411
1445
|
#
|
1412
|
-
# It is recommended to use the Brick Viewer to
|
1446
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1413
1447
|
#
|
1414
1448
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1415
1449
|
def set_wifi2_ap_configuration(enable, ssid, ip, subnet_mask, gateway, encryption, hidden, channel, mac_address)
|
@@ -1430,7 +1464,7 @@ module Tinkerforge
|
|
1430
1464
|
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1431
1465
|
# has to be restarted afterwards.
|
1432
1466
|
#
|
1433
|
-
# It is recommended to use the Brick Viewer to
|
1467
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1434
1468
|
#
|
1435
1469
|
# .. versionadded:: 2.4.0$nbsp;(Firmware)
|
1436
1470
|
def set_wifi2_ap_password(password)
|
@@ -1484,6 +1518,133 @@ module Tinkerforge
|
|
1484
1518
|
send_request(FUNCTION_IS_WIFI2_STATUS_LED_ENABLED, [], '', 1, '?')
|
1485
1519
|
end
|
1486
1520
|
|
1521
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1522
|
+
#
|
1523
|
+
# Sets the mesh specific configuration of the WIFI Extension 2.0.
|
1524
|
+
#
|
1525
|
+
# The ``enable`` parameter enables or disables the mesh part of the
|
1526
|
+
# WIFI Extension 2.0. The default value is *false*. The mesh part cannot be
|
1527
|
+
# enabled together with the client and access-point part.
|
1528
|
+
#
|
1529
|
+
# If the ``root_ip`` parameter is set to all zero then ``root_subnet_mask``
|
1530
|
+
# and ``root_gateway`` parameters are also set to all zero and DHCP is used for
|
1531
|
+
# IP address configuration. Otherwise those three parameters can be used to
|
1532
|
+
# configure a static IP address. The default configuration is DHCP.
|
1533
|
+
#
|
1534
|
+
# If the ``router_bssid`` parameter is set to all zero then the information is
|
1535
|
+
# taken from Wi-Fi scan when connecting the SSID as set by
|
1536
|
+
# BrickMaster#set_wifi2_mesh_router_ssid. This only works if the the SSID is not hidden.
|
1537
|
+
# In case the router has hidden SSID this parameter must be specified, otherwise
|
1538
|
+
# the node will not be able to reach the mesh router.
|
1539
|
+
#
|
1540
|
+
# The ``group_id`` and the ``group_ssid_prefix`` parameters identifies a
|
1541
|
+
# particular mesh network and nodes configured with same ``group_id`` and the
|
1542
|
+
# ``group_ssid_prefix`` are considered to be in the same mesh network.
|
1543
|
+
#
|
1544
|
+
# The ``gateway_ip`` and the ``gateway_port`` parameters specifies the location
|
1545
|
+
# of the brickd that supports mesh feature.
|
1546
|
+
#
|
1547
|
+
# To apply configuration changes to the WIFI Extension 2.0 the
|
1548
|
+
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1549
|
+
# has to be restarted afterwards.
|
1550
|
+
#
|
1551
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1552
|
+
#
|
1553
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1554
|
+
def set_wifi2_mesh_configuration(enable, root_ip, root_subnet_mask, root_gateway, router_bssid, group_id, group_ssid_prefix, gateway_ip, gateway_port)
|
1555
|
+
send_request(FUNCTION_SET_WIFI2_MESH_CONFIGURATION, [enable, root_ip, root_subnet_mask, root_gateway, router_bssid, group_id, group_ssid_prefix, gateway_ip, gateway_port], '? C4 C4 C4 C6 C6 Z16 C4 S', 0, '')
|
1556
|
+
end
|
1557
|
+
|
1558
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1559
|
+
#
|
1560
|
+
# Returns the mesh configuration as set by BrickMaster#set_wifi2_mesh_configuration.
|
1561
|
+
#
|
1562
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1563
|
+
def get_wifi2_mesh_configuration
|
1564
|
+
send_request(FUNCTION_GET_WIFI2_MESH_CONFIGURATION, [], '', 47, '? C4 C4 C4 C6 C6 Z16 C4 S')
|
1565
|
+
end
|
1566
|
+
|
1567
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1568
|
+
#
|
1569
|
+
# Sets the mesh router SSID of the WIFI Extension 2.0.
|
1570
|
+
# It is used to specify the mesh router to connect to.
|
1571
|
+
#
|
1572
|
+
# Note that even though in the argument of this function a 32 characters long SSID
|
1573
|
+
# is allowed, in practice valid SSID should have a maximum of 31 characters. This
|
1574
|
+
# is due to a bug in the mesh library that we use in the firmware of the extension.
|
1575
|
+
#
|
1576
|
+
# To apply configuration changes to the WIFI Extension 2.0 the
|
1577
|
+
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1578
|
+
# has to be restarted afterwards.
|
1579
|
+
#
|
1580
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1581
|
+
#
|
1582
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1583
|
+
def set_wifi2_mesh_router_ssid(ssid)
|
1584
|
+
send_request(FUNCTION_SET_WIFI2_MESH_ROUTER_SSID, [ssid], 'Z32', 0, '')
|
1585
|
+
end
|
1586
|
+
|
1587
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1588
|
+
#
|
1589
|
+
# Returns the mesh router SSID as set by BrickMaster#set_wifi2_mesh_router_ssid.
|
1590
|
+
#
|
1591
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1592
|
+
def get_wifi2_mesh_router_ssid
|
1593
|
+
send_request(FUNCTION_GET_WIFI2_MESH_ROUTER_SSID, [], '', 32, 'Z32')
|
1594
|
+
end
|
1595
|
+
|
1596
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1597
|
+
#
|
1598
|
+
# Sets the mesh router password (up to 64 characters) for WPA/WPA2 encryption.
|
1599
|
+
# The password will be used to connect to the mesh router.
|
1600
|
+
#
|
1601
|
+
# To apply configuration changes to the WIFI Extension 2.0 the
|
1602
|
+
# BrickMaster#save_wifi2_configuration function has to be called and the Master Brick
|
1603
|
+
# has to be restarted afterwards.
|
1604
|
+
#
|
1605
|
+
# It is recommended to use the Brick Viewer to configure the WIFI Extension 2.0.
|
1606
|
+
#
|
1607
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1608
|
+
def set_wifi2_mesh_router_password(password)
|
1609
|
+
send_request(FUNCTION_SET_WIFI2_MESH_ROUTER_PASSWORD, [password], 'Z64', 0, '')
|
1610
|
+
end
|
1611
|
+
|
1612
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1613
|
+
#
|
1614
|
+
# Returns the mesh router password as set by BrickMaster#set_wifi2_mesh_router_password.
|
1615
|
+
#
|
1616
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1617
|
+
def get_wifi2_mesh_router_password
|
1618
|
+
send_request(FUNCTION_GET_WIFI2_MESH_ROUTER_PASSWORD, [], '', 64, 'Z64')
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1622
|
+
#
|
1623
|
+
# Returns the common mesh status of the WIFI Extension 2.0.
|
1624
|
+
#
|
1625
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1626
|
+
def get_wifi2_mesh_common_status
|
1627
|
+
send_request(FUNCTION_GET_WIFI2_MESH_COMMON_STATUS, [], '', 13, 'C ? ? S L L')
|
1628
|
+
end
|
1629
|
+
|
1630
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1631
|
+
#
|
1632
|
+
# Returns the mesh client status of the WIFI Extension 2.0.
|
1633
|
+
#
|
1634
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1635
|
+
def get_wifi2_mesh_client_status
|
1636
|
+
send_request(FUNCTION_GET_WIFI2_MESH_CLIENT_STATUS, [], '', 50, 'Z32 C4 C4 C4 C6')
|
1637
|
+
end
|
1638
|
+
|
1639
|
+
# Requires WIFI Extension 2.0 firmware 2.1.0.
|
1640
|
+
#
|
1641
|
+
# Returns the mesh AP status of the WIFI Extension 2.0.
|
1642
|
+
#
|
1643
|
+
# .. versionadded:: 2.4.2$nbsp;(Firmware)
|
1644
|
+
def get_wifi2_mesh_ap_status
|
1645
|
+
send_request(FUNCTION_GET_WIFI2_MESH_AP_STATUS, [], '', 50, 'Z32 C4 C4 C4 C6')
|
1646
|
+
end
|
1647
|
+
|
1487
1648
|
# Enables the status LED.
|
1488
1649
|
#
|
1489
1650
|
# The status LED is the blue LED next to the USB connector. If enabled is is
|