tinkerforge 2.1.4 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/lib/tinkerforge/brick_dc.rb +42 -4
  2. data/lib/tinkerforge/brick_imu.rb +49 -11
  3. data/lib/tinkerforge/brick_imu_v2.rb +506 -0
  4. data/lib/tinkerforge/brick_master.rb +86 -46
  5. data/lib/tinkerforge/brick_red.rb +36 -5
  6. data/lib/tinkerforge/brick_servo.rb +53 -15
  7. data/lib/tinkerforge/brick_stepper.rb +43 -14
  8. data/lib/tinkerforge/bricklet_accelerometer.rb +229 -0
  9. data/lib/tinkerforge/bricklet_ambient_light.rb +10 -9
  10. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +216 -0
  11. data/lib/tinkerforge/bricklet_analog_in.rb +13 -12
  12. data/lib/tinkerforge/bricklet_analog_in_v2.rb +259 -0
  13. data/lib/tinkerforge/bricklet_analog_out.rb +5 -4
  14. data/lib/tinkerforge/bricklet_analog_out_v2.rb +66 -0
  15. data/lib/tinkerforge/bricklet_barometer.rb +11 -9
  16. data/lib/tinkerforge/bricklet_color.rb +11 -9
  17. data/lib/tinkerforge/bricklet_current12.rb +5 -4
  18. data/lib/tinkerforge/bricklet_current25.rb +5 -4
  19. data/lib/tinkerforge/bricklet_distance_ir.rb +8 -7
  20. data/lib/tinkerforge/bricklet_distance_us.rb +9 -8
  21. data/lib/tinkerforge/bricklet_dual_button.rb +5 -4
  22. data/lib/tinkerforge/bricklet_dual_relay.rb +5 -4
  23. data/lib/tinkerforge/bricklet_dust_detector.rb +178 -0
  24. data/lib/tinkerforge/bricklet_gps.rb +6 -5
  25. data/lib/tinkerforge/bricklet_hall_effect.rb +5 -4
  26. data/lib/tinkerforge/bricklet_humidity.rb +8 -7
  27. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +137 -0
  28. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +8 -7
  29. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +5 -4
  30. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +6 -5
  31. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +209 -0
  32. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +5 -4
  33. data/lib/tinkerforge/bricklet_io16.rb +8 -7
  34. data/lib/tinkerforge/bricklet_io4.rb +8 -7
  35. data/lib/tinkerforge/bricklet_joystick.rb +5 -4
  36. data/lib/tinkerforge/bricklet_laser_range_finder.rb +324 -0
  37. data/lib/tinkerforge/bricklet_lcd_16x2.rb +7 -6
  38. data/lib/tinkerforge/bricklet_lcd_20x4.rb +11 -10
  39. data/lib/tinkerforge/bricklet_led_strip.rb +12 -10
  40. data/lib/tinkerforge/bricklet_line.rb +5 -4
  41. data/lib/tinkerforge/bricklet_linear_poti.rb +8 -7
  42. data/lib/tinkerforge/bricklet_load_cell.rb +261 -0
  43. data/lib/tinkerforge/bricklet_moisture.rb +6 -5
  44. data/lib/tinkerforge/bricklet_motion_detector.rb +5 -4
  45. data/lib/tinkerforge/bricklet_multi_touch.rb +5 -4
  46. data/lib/tinkerforge/bricklet_nfc_rfid.rb +38 -46
  47. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +5 -4
  48. data/lib/tinkerforge/bricklet_piezo_speaker.rb +6 -5
  49. data/lib/tinkerforge/bricklet_ptc.rb +5 -4
  50. data/lib/tinkerforge/bricklet_remote_switch.rb +9 -8
  51. data/lib/tinkerforge/bricklet_rotary_encoder.rb +5 -4
  52. data/lib/tinkerforge/bricklet_rotary_poti.rb +5 -4
  53. data/lib/tinkerforge/bricklet_rs232.rb +183 -0
  54. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +8 -5
  55. data/lib/tinkerforge/bricklet_solid_state_relay.rb +5 -4
  56. data/lib/tinkerforge/bricklet_sound_intensity.rb +6 -5
  57. data/lib/tinkerforge/bricklet_temperature.rb +7 -6
  58. data/lib/tinkerforge/bricklet_temperature_ir.rb +7 -6
  59. data/lib/tinkerforge/bricklet_tilt.rb +5 -4
  60. data/lib/tinkerforge/bricklet_voltage.rb +8 -7
  61. data/lib/tinkerforge/bricklet_voltage_current.rb +5 -4
  62. data/lib/tinkerforge/version.rb +1 -1
  63. metadata +13 -2
@@ -1,18 +1,19 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2014-12-10. #
3
+ # This file was automatically generated on 2015-11-17. #
4
4
  # #
5
- # Bindings Version 2.1.4 #
5
+ # Bindings Version 2.1.6 #
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 #
9
- # to the generator git on tinkerforge.com #
9
+ # to the generators git repository on tinkerforge.com #
10
10
  #############################################################
11
11
 
12
12
  module Tinkerforge
13
- # Device for controlling Stacks and four Bricklets
13
+ # Basis to build stacks and has 4 Bricklet ports
14
14
  class BrickMaster < Device
15
15
  DEVICE_IDENTIFIER = 13 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'Master Brick' # :nodoc:
16
17
 
17
18
  # This callback is triggered periodically with the period that is set by
18
19
  # BrickMaster#set_stack_current_callback_period. The parameter is the current of the
@@ -21,7 +22,7 @@ module Tinkerforge
21
22
  # CALLBACK_STACK_CURRENT is only triggered if the current has changed since the
22
23
  # last triggering.
23
24
  #
24
- # .. versionadded:: 2.0.5~(Firmware)
25
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
25
26
  CALLBACK_STACK_CURRENT = 59
26
27
 
27
28
  # This callback is triggered periodically with the period that is set by
@@ -31,7 +32,7 @@ module Tinkerforge
31
32
  # CALLBACK_STACK_VOLTAGE is only triggered if the voltage has changed since the
32
33
  # last triggering.
33
34
  #
34
- # .. versionadded:: 2.0.5~(Firmware)
35
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
35
36
  CALLBACK_STACK_VOLTAGE = 60
36
37
 
37
38
  # This callback is triggered periodically with the period that is set by
@@ -41,7 +42,9 @@ module Tinkerforge
41
42
  # CALLBACK_USB_VOLTAGE is only triggered if the USB voltage has changed since the
42
43
  # last triggering.
43
44
  #
44
- # .. versionadded:: 2.0.5~(Firmware)
45
+ # Does not work with hardware version 2.1.
46
+ #
47
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
45
48
  CALLBACK_USB_VOLTAGE = 61
46
49
 
47
50
  # This callback is triggered when the threshold as set by
@@ -51,7 +54,7 @@ module Tinkerforge
51
54
  # If the threshold keeps being reached, the callback is triggered periodically
52
55
  # with the period as set by BrickMaster#set_debounce_period.
53
56
  #
54
- # .. versionadded:: 2.0.5~(Firmware)
57
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
55
58
  CALLBACK_STACK_CURRENT_REACHED = 62
56
59
 
57
60
  # This callback is triggered when the threshold as set by
@@ -61,7 +64,7 @@ module Tinkerforge
61
64
  # If the threshold keeps being reached, the callback is triggered periodically
62
65
  # with the period as set by BrickMaster#set_debounce_period.
63
66
  #
64
- # .. versionadded:: 2.0.5~(Firmware)
67
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
65
68
  CALLBACK_STACK_VOLTAGE_REACHED = 63
66
69
 
67
70
  # This callback is triggered when the threshold as set by
@@ -71,7 +74,7 @@ module Tinkerforge
71
74
  # If the threshold keeps being reached, the callback is triggered periodically
72
75
  # with the period as set by BrickMaster#set_debounce_period.
73
76
  #
74
- # .. versionadded:: 2.0.5~(Firmware)
77
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
75
78
  CALLBACK_USB_VOLTAGE_REACHED = 64
76
79
 
77
80
  FUNCTION_GET_STACK_VOLTAGE = 1 # :nodoc:
@@ -144,6 +147,9 @@ module Tinkerforge
144
147
  FUNCTION_GET_ETHERNET_AUTHENTICATION_SECRET = 74 # :nodoc:
145
148
  FUNCTION_SET_WIFI_AUTHENTICATION_SECRET = 75 # :nodoc:
146
149
  FUNCTION_GET_WIFI_AUTHENTICATION_SECRET = 76 # :nodoc:
150
+ FUNCTION_ENABLE_STATUS_LED = 238 # :nodoc:
151
+ FUNCTION_DISABLE_STATUS_LED = 239 # :nodoc:
152
+ FUNCTION_IS_STATUS_LED_ENABLED = 240 # :nodoc:
147
153
  FUNCTION_GET_PROTOCOL1_BRICKLET_NAME = 241 # :nodoc:
148
154
  FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
149
155
  FUNCTION_RESET = 243 # :nodoc:
@@ -280,6 +286,9 @@ module Tinkerforge
280
286
  @response_expected[FUNCTION_GET_ETHERNET_AUTHENTICATION_SECRET] = RESPONSE_EXPECTED_ALWAYS_TRUE
281
287
  @response_expected[FUNCTION_SET_WIFI_AUTHENTICATION_SECRET] = RESPONSE_EXPECTED_FALSE
282
288
  @response_expected[FUNCTION_GET_WIFI_AUTHENTICATION_SECRET] = RESPONSE_EXPECTED_ALWAYS_TRUE
289
+ @response_expected[FUNCTION_ENABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
290
+ @response_expected[FUNCTION_DISABLE_STATUS_LED] = RESPONSE_EXPECTED_FALSE
291
+ @response_expected[FUNCTION_IS_STATUS_LED_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
283
292
  @response_expected[FUNCTION_GET_PROTOCOL1_BRICKLET_NAME] = RESPONSE_EXPECTED_ALWAYS_TRUE
284
293
  @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
285
294
  @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
@@ -600,7 +609,7 @@ module Tinkerforge
600
609
  # The values are stored in the EEPROM and only applied on startup. That means
601
610
  # you have to restart the Master Brick after configuration.
602
611
  #
603
- # It is recommended to use the Brick Viewer to set the WIFI encryption.
612
+ # It is recommended to use the Brick Viewer to set the Wi-Fi encryption.
604
613
  def set_wifi_encryption(encryption, key, key_index, eap_options, ca_certificate_length, client_certificate_length, private_key_length)
605
614
  send_request(FUNCTION_SET_WIFI_ENCRYPTION, [encryption, key, key_index, eap_options, ca_certificate_length, client_certificate_length, private_key_length], 'C Z50 C C S S S', 0, '')
606
615
  end
@@ -627,8 +636,8 @@ module Tinkerforge
627
636
  send_request(FUNCTION_GET_WIFI_STATUS, [], '', 36, 'C6 C6 C s C4 C4 C4 L L C')
628
637
  end
629
638
 
630
- # Refreshes the WIFI status (see BrickMaster#get_wifi_status). To read the status
631
- # of the WIFI module, the Master Brick has to change from data mode to
639
+ # Refreshes the Wi-Fi status (see BrickMaster#get_wifi_status). To read the status
640
+ # of the Wi-Fi module, the Master Brick has to change from data mode to
632
641
  # command mode and back. This transaction and the readout itself is
633
642
  # unfortunately time consuming. This means, that it might take some ms
634
643
  # until the stack with attached WIFI Extension reacts again after this
@@ -681,7 +690,7 @@ module Tinkerforge
681
690
  send_request(FUNCTION_GET_WIFI_POWER_MODE, [], '', 1, 'C')
682
691
  end
683
692
 
684
- # Returns informations about the WIFI receive buffer. The WIFI
693
+ # Returns informations about the Wi-Fi receive buffer. The Wi-Fi
685
694
  # receive buffer has a max size of 1500 byte and if data is transfered
686
695
  # too fast, it might overflow.
687
696
  #
@@ -717,12 +726,12 @@ module Tinkerforge
717
726
  send_request(FUNCTION_GET_WIFI_REGULATORY_DOMAIN, [], '', 1, 'C')
718
727
  end
719
728
 
720
- # Returns the USB voltage in mV.
729
+ # Returns the USB voltage in mV. Does not work with hardware version 2.1.
721
730
  def get_usb_voltage
722
731
  send_request(FUNCTION_GET_USB_VOLTAGE, [], '', 2, 'S')
723
732
  end
724
733
 
725
- # Sets a long WIFI key (up to 63 chars, at least 8 chars) for WPA encryption.
734
+ # Sets a long Wi-Fi key (up to 63 chars, at least 8 chars) for WPA encryption.
726
735
  # This key will be used
727
736
  # if the key in BrickMaster#set_wifi_encryption is set to "-". In the old protocol,
728
737
  # a payload of size 63 was not possible, so the maximum key length was 50 chars.
@@ -730,14 +739,14 @@ module Tinkerforge
730
739
  # With the new protocol this is possible, since we didn't want to break API,
731
740
  # this function was added additionally.
732
741
  #
733
- # .. versionadded:: 2.0.2~(Firmware)
742
+ # .. versionadded:: 2.0.2$nbsp;(Firmware)
734
743
  def set_long_wifi_key(key)
735
744
  send_request(FUNCTION_SET_LONG_WIFI_KEY, [key], 'Z64', 0, '')
736
745
  end
737
746
 
738
747
  # Returns the encryption key as set by BrickMaster#set_long_wifi_key.
739
748
  #
740
- # .. versionadded:: 2.0.2~(Firmware)
749
+ # .. versionadded:: 2.0.2$nbsp;(Firmware)
741
750
  def get_long_wifi_key
742
751
  send_request(FUNCTION_GET_LONG_WIFI_KEY, [], '', 64, 'Z64')
743
752
  end
@@ -747,7 +756,7 @@ module Tinkerforge
747
756
  #
748
757
  # Setting an empty String will restore the default hostname.
749
758
  #
750
- # .. versionadded:: 2.0.5~(Firmware)
759
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
751
760
  def set_wifi_hostname(hostname)
752
761
  send_request(FUNCTION_SET_WIFI_HOSTNAME, [hostname], 'Z16', 0, '')
753
762
  end
@@ -756,7 +765,7 @@ module Tinkerforge
756
765
  #
757
766
  # An empty String means, that the default hostname is used.
758
767
  #
759
- # .. versionadded:: 2.0.5~(Firmware)
768
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
760
769
  def get_wifi_hostname
761
770
  send_request(FUNCTION_GET_WIFI_HOSTNAME, [], '', 16, 'Z16')
762
771
  end
@@ -769,14 +778,14 @@ module Tinkerforge
769
778
  #
770
779
  # The default value is 0.
771
780
  #
772
- # .. versionadded:: 2.0.5~(Firmware)
781
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
773
782
  def set_stack_current_callback_period(period)
774
783
  send_request(FUNCTION_SET_STACK_CURRENT_CALLBACK_PERIOD, [period], 'L', 0, '')
775
784
  end
776
785
 
777
786
  # Returns the period as set by :func:`SetCurrentCallbackPeriod`.
778
787
  #
779
- # .. versionadded:: 2.0.5~(Firmware)
788
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
780
789
  def get_stack_current_callback_period
781
790
  send_request(FUNCTION_GET_STACK_CURRENT_CALLBACK_PERIOD, [], '', 4, 'L')
782
791
  end
@@ -789,14 +798,14 @@ module Tinkerforge
789
798
  #
790
799
  # The default value is 0.
791
800
  #
792
- # .. versionadded:: 2.0.5~(Firmware)
801
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
793
802
  def set_stack_voltage_callback_period(period)
794
803
  send_request(FUNCTION_SET_STACK_VOLTAGE_CALLBACK_PERIOD, [period], 'L', 0, '')
795
804
  end
796
805
 
797
806
  # Returns the period as set by BrickMaster#set_stack_voltage_callback_period.
798
807
  #
799
- # .. versionadded:: 2.0.5~(Firmware)
808
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
800
809
  def get_stack_voltage_callback_period
801
810
  send_request(FUNCTION_GET_STACK_VOLTAGE_CALLBACK_PERIOD, [], '', 4, 'L')
802
811
  end
@@ -809,14 +818,14 @@ module Tinkerforge
809
818
  #
810
819
  # The default value is 0.
811
820
  #
812
- # .. versionadded:: 2.0.5~(Firmware)
821
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
813
822
  def set_usb_voltage_callback_period(period)
814
823
  send_request(FUNCTION_SET_USB_VOLTAGE_CALLBACK_PERIOD, [period], 'L', 0, '')
815
824
  end
816
825
 
817
826
  # Returns the period as set by BrickMaster#set_usb_voltage_callback_period.
818
827
  #
819
- # .. versionadded:: 2.0.5~(Firmware)
828
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
820
829
  def get_usb_voltage_callback_period
821
830
  send_request(FUNCTION_GET_USB_VOLTAGE_CALLBACK_PERIOD, [], '', 4, 'L')
822
831
  end
@@ -835,14 +844,14 @@ module Tinkerforge
835
844
  #
836
845
  # The default value is ('x', 0, 0).
837
846
  #
838
- # .. versionadded:: 2.0.5~(Firmware)
847
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
839
848
  def set_stack_current_callback_threshold(option, min, max)
840
849
  send_request(FUNCTION_SET_STACK_CURRENT_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, '')
841
850
  end
842
851
 
843
852
  # Returns the threshold as set by BrickMaster#set_stack_current_callback_threshold.
844
853
  #
845
- # .. versionadded:: 2.0.5~(Firmware)
854
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
846
855
  def get_stack_current_callback_threshold
847
856
  send_request(FUNCTION_GET_STACK_CURRENT_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
848
857
  end
@@ -861,14 +870,14 @@ module Tinkerforge
861
870
  #
862
871
  # The default value is ('x', 0, 0).
863
872
  #
864
- # .. versionadded:: 2.0.5~(Firmware)
873
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
865
874
  def set_stack_voltage_callback_threshold(option, min, max)
866
875
  send_request(FUNCTION_SET_STACK_VOLTAGE_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, '')
867
876
  end
868
877
 
869
878
  # Returns the threshold as set by BrickMaster#set_stack_voltage_callback_threshold.
870
879
  #
871
- # .. versionadded:: 2.0.5~(Firmware)
880
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
872
881
  def get_stack_voltage_callback_threshold
873
882
  send_request(FUNCTION_GET_STACK_VOLTAGE_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
874
883
  end
@@ -887,14 +896,14 @@ module Tinkerforge
887
896
  #
888
897
  # The default value is ('x', 0, 0).
889
898
  #
890
- # .. versionadded:: 2.0.5~(Firmware)
899
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
891
900
  def set_usb_voltage_callback_threshold(option, min, max)
892
901
  send_request(FUNCTION_SET_USB_VOLTAGE_CALLBACK_THRESHOLD, [option, min, max], 'k S S', 0, '')
893
902
  end
894
903
 
895
904
  # Returns the threshold as set by BrickMaster#set_usb_voltage_callback_threshold.
896
905
  #
897
- # .. versionadded:: 2.0.5~(Firmware)
906
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
898
907
  def get_usb_voltage_callback_threshold
899
908
  send_request(FUNCTION_GET_USB_VOLTAGE_CALLBACK_THRESHOLD, [], '', 5, 'k S S')
900
909
  end
@@ -915,14 +924,14 @@ module Tinkerforge
915
924
  #
916
925
  # The default value is 100.
917
926
  #
918
- # .. versionadded:: 2.0.5~(Firmware)
927
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
919
928
  def set_debounce_period(debounce)
920
929
  send_request(FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, '')
921
930
  end
922
931
 
923
932
  # Returns the debounce period as set by BrickMaster#set_debounce_period.
924
933
  #
925
- # .. versionadded:: 2.0.5~(Firmware)
934
+ # .. versionadded:: 2.0.5$nbsp;(Firmware)
926
935
  def get_debounce_period
927
936
  send_request(FUNCTION_GET_DEBOUNCE_PERIOD, [], '', 4, 'L')
928
937
  end
@@ -930,7 +939,7 @@ module Tinkerforge
930
939
  # Returns *true* if a Ethernet Extension is available to be used by the Master
931
940
  # Brick.
932
941
  #
933
- # .. versionadded:: 2.1.0~(Firmware)
942
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
934
943
  def is_ethernet_present
935
944
  send_request(FUNCTION_IS_ETHERNET_PRESENT, [], '', 1, '?')
936
945
  end
@@ -957,14 +966,14 @@ module Tinkerforge
957
966
  #
958
967
  # It is recommended to use the Brick Viewer to set the Ethernet configuration.
959
968
  #
960
- # .. versionadded:: 2.1.0~(Firmware)
969
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
961
970
  def set_ethernet_configuration(connection, ip, subnet_mask, gateway, port)
962
971
  send_request(FUNCTION_SET_ETHERNET_CONFIGURATION, [connection, ip, subnet_mask, gateway, port], 'C C4 C4 C4 S', 0, '')
963
972
  end
964
973
 
965
974
  # Returns the configuration as set by BrickMaster#set_ethernet_configuration.
966
975
  #
967
- # .. versionadded:: 2.1.0~(Firmware)
976
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
968
977
  def get_ethernet_configuration
969
978
  send_request(FUNCTION_GET_ETHERNET_CONFIGURATION, [], '', 15, 'C C4 C4 C4 S')
970
979
  end
@@ -979,7 +988,7 @@ module Tinkerforge
979
988
  #
980
989
  # ``hostname`` is the currently used hostname.
981
990
  #
982
- # .. versionadded:: 2.1.0~(Firmware)
991
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
983
992
  def get_ethernet_status
984
993
  send_request(FUNCTION_GET_ETHERNET_STATUS, [], '', 58, 'C6 C4 C4 C4 L L Z32')
985
994
  end
@@ -991,7 +1000,7 @@ module Tinkerforge
991
1000
  #
992
1001
  # The current hostname can be discovered with BrickMaster#get_ethernet_status.
993
1002
  #
994
- # .. versionadded:: 2.1.0~(Firmware)
1003
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
995
1004
  def set_ethernet_hostname(hostname)
996
1005
  send_request(FUNCTION_SET_ETHERNET_HOSTNAME, [hostname], 'Z32', 0, '')
997
1006
  end
@@ -1002,7 +1011,7 @@ module Tinkerforge
1002
1011
  #
1003
1012
  # The MAC address can be read out again with BrickMaster#get_ethernet_status.
1004
1013
  #
1005
- # .. versionadded:: 2.1.0~(Firmware)
1014
+ # .. versionadded:: 2.1.0$nbsp;(Firmware)
1006
1015
  def set_ethernet_mac_address(mac_address)
1007
1016
  send_request(FUNCTION_SET_ETHERNET_MAC_ADDRESS, [mac_address], 'C6', 0, '')
1008
1017
  end
@@ -1022,14 +1031,14 @@ module Tinkerforge
1022
1031
  #
1023
1032
  # The default values are 3 for the socket connections and 4280 for the port.
1024
1033
  #
1025
- # .. versionadded:: 2.2.0~(Firmware)
1034
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1026
1035
  def set_ethernet_websocket_configuration(sockets, port)
1027
1036
  send_request(FUNCTION_SET_ETHERNET_WEBSOCKET_CONFIGURATION, [sockets, port], 'C S', 0, '')
1028
1037
  end
1029
1038
 
1030
1039
  # Returns the configuration as set by BrickMaster#set_ethernet_configuration.
1031
1040
  #
1032
- # .. versionadded:: 2.2.0~(Firmware)
1041
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1033
1042
  def get_ethernet_websocket_configuration
1034
1043
  send_request(FUNCTION_GET_ETHERNET_WEBSOCKET_CONFIGURATION, [], '', 3, 'C S')
1035
1044
  end
@@ -1047,14 +1056,14 @@ module Tinkerforge
1047
1056
  #
1048
1057
  # The default value is an empty string (authentication disabled).
1049
1058
  #
1050
- # .. versionadded:: 2.2.0~(Firmware)
1059
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1051
1060
  def set_ethernet_authentication_secret(secret)
1052
1061
  send_request(FUNCTION_SET_ETHERNET_AUTHENTICATION_SECRET, [secret], 'Z64', 0, '')
1053
1062
  end
1054
1063
 
1055
1064
  # Returns the authentication secret as set by BrickMaster#set_ethernet_authentication_secret.
1056
1065
  #
1057
- # .. versionadded:: 2.2.0~(Firmware)
1066
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1058
1067
  def get_ethernet_authentication_secret
1059
1068
  send_request(FUNCTION_GET_ETHERNET_AUTHENTICATION_SECRET, [], '', 64, 'Z64')
1060
1069
  end
@@ -1072,18 +1081,49 @@ module Tinkerforge
1072
1081
  #
1073
1082
  # The default value is an empty string (authentication disabled).
1074
1083
  #
1075
- # .. versionadded:: 2.2.0~(Firmware)
1084
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1076
1085
  def set_wifi_authentication_secret(secret)
1077
1086
  send_request(FUNCTION_SET_WIFI_AUTHENTICATION_SECRET, [secret], 'Z64', 0, '')
1078
1087
  end
1079
1088
 
1080
1089
  # Returns the authentication secret as set by BrickMaster#set_wifi_authentication_secret.
1081
1090
  #
1082
- # .. versionadded:: 2.2.0~(Firmware)
1091
+ # .. versionadded:: 2.2.0$nbsp;(Firmware)
1083
1092
  def get_wifi_authentication_secret
1084
1093
  send_request(FUNCTION_GET_WIFI_AUTHENTICATION_SECRET, [], '', 64, 'Z64')
1085
1094
  end
1086
1095
 
1096
+ # Enables the status LED.
1097
+ #
1098
+ # The status LED is the blue LED next to the USB connector. If enabled is is
1099
+ # on and it flickers if data is transfered. If disabled it is always off.
1100
+ #
1101
+ # The default state is enabled.
1102
+ #
1103
+ # .. versionadded:: 2.3.2$nbsp;(Firmware)
1104
+ def enable_status_led
1105
+ send_request(FUNCTION_ENABLE_STATUS_LED, [], '', 0, '')
1106
+ end
1107
+
1108
+ # Disables the status LED.
1109
+ #
1110
+ # The status LED is the blue LED next to the USB connector. If enabled is is
1111
+ # on and it flickers if data is transfered. If disabled it is always off.
1112
+ #
1113
+ # The default state is enabled.
1114
+ #
1115
+ # .. versionadded:: 2.3.2$nbsp;(Firmware)
1116
+ def disable_status_led
1117
+ send_request(FUNCTION_DISABLE_STATUS_LED, [], '', 0, '')
1118
+ end
1119
+
1120
+ # Returns *true* if the status LED is enabled, *false* otherwise.
1121
+ #
1122
+ # .. versionadded:: 2.3.2$nbsp;(Firmware)
1123
+ def is_status_led_enabled
1124
+ send_request(FUNCTION_IS_STATUS_LED_ENABLED, [], '', 1, '?')
1125
+ end
1126
+
1087
1127
  # Returns the firmware and protocol version and the name of the Bricklet for a
1088
1128
  # given port.
1089
1129
  #
@@ -1,18 +1,19 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2014-12-10. #
3
+ # This file was automatically generated on 2015-11-17. #
4
4
  # #
5
- # Bindings Version 2.1.4 #
5
+ # Bindings Version 2.1.6 #
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 #
9
- # to the generator git on tinkerforge.com #
9
+ # to the generators git repository on tinkerforge.com #
10
10
  #############################################################
11
11
 
12
12
  module Tinkerforge
13
- # Device for running user programs standalone on the stack
13
+ # Executes user programs and controls other Bricks/Bricklets standalone
14
14
  class BrickRED < Device
15
15
  DEVICE_IDENTIFIER = 17 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'RED Brick' # :nodoc:
16
17
 
17
18
  # This callback reports the result of a call to the BrickRED#read_file_async
18
19
  # function.
@@ -96,6 +97,36 @@ module Tinkerforge
96
97
  FUNCTION_REMOVE_CUSTOM_PROGRAM_OPTION = 64 # :nodoc:
97
98
  FUNCTION_GET_IDENTITY = 255 # :nodoc:
98
99
 
100
+ ERROR_CODE_SUCCESS = 0 # :nodoc:
101
+ ERROR_CODE_UNKNOWN_ERROR = 1 # :nodoc:
102
+ ERROR_CODE_INVALID_OPERATION = 2 # :nodoc:
103
+ ERROR_CODE_OPERATION_ABORTED = 3 # :nodoc:
104
+ ERROR_CODE_INTERNAL_ERROR = 4 # :nodoc:
105
+ ERROR_CODE_UNKNOWN_SESSION_ID = 5 # :nodoc:
106
+ ERROR_CODE_NO_FREE_SESSION_ID = 6 # :nodoc:
107
+ ERROR_CODE_UNKNOWN_OBJECT_ID = 7 # :nodoc:
108
+ ERROR_CODE_NO_FREE_OBJECT_ID = 8 # :nodoc:
109
+ ERROR_CODE_OBJECT_IS_LOCKED = 9 # :nodoc:
110
+ ERROR_CODE_NO_MORE_DATA = 10 # :nodoc:
111
+ ERROR_CODE_WRONG_LIST_ITEM_TYPE = 11 # :nodoc:
112
+ ERROR_CODE_PROGRAM_IS_PURGED = 12 # :nodoc:
113
+ ERROR_CODE_INVALID_PARAMETER = 128 # :nodoc:
114
+ ERROR_CODE_NO_FREE_MEMORY = 129 # :nodoc:
115
+ ERROR_CODE_NO_FREE_SPACE = 130 # :nodoc:
116
+ ERROR_CODE_ACCESS_DENIED = 121 # :nodoc:
117
+ ERROR_CODE_ALREADY_EXISTS = 132 # :nodoc:
118
+ ERROR_CODE_DOES_NOT_EXIST = 133 # :nodoc:
119
+ ERROR_CODE_INTERRUPTED = 134 # :nodoc:
120
+ ERROR_CODE_IS_DIRECTORY = 135 # :nodoc:
121
+ ERROR_CODE_NOT_A_DIRECTORY = 136 # :nodoc:
122
+ ERROR_CODE_WOULD_BLOCK = 137 # :nodoc:
123
+ ERROR_CODE_OVERFLOW = 138 # :nodoc:
124
+ ERROR_CODE_BAD_FILE_DESCRIPTOR = 139 # :nodoc:
125
+ ERROR_CODE_OUT_OF_RANGE = 140 # :nodoc:
126
+ ERROR_CODE_NAME_TOO_LONG = 141 # :nodoc:
127
+ ERROR_CODE_INVALID_SEEK = 142 # :nodoc:
128
+ ERROR_CODE_NOT_SUPPORTED = 143 # :nodoc:
129
+ ERROR_CODE_TOO_MANY_OPEN_FILES = 144 # :nodoc:
99
130
  OBJECT_TYPE_STRING = 0 # :nodoc:
100
131
  OBJECT_TYPE_LIST = 1 # :nodoc:
101
132
  OBJECT_TYPE_FILE = 2 # :nodoc:
@@ -760,7 +791,7 @@ module Tinkerforge
760
791
  send_request(FUNCTION_GET_PROGRAM_SCHEDULE, [program_id, session_id], 'S S', 9, 'C C ? L S')
761
792
  end
762
793
 
763
- # FIXME: message is currently vaild in error-occurred state only
794
+ # FIXME: message is currently valid in error-occurred state only
764
795
  def get_program_scheduler_state(program_id, session_id)
765
796
  send_request(FUNCTION_GET_PROGRAM_SCHEDULER_STATE, [program_id, session_id], 'S S', 12, 'C C Q S')
766
797
  end