Permalink
Browse files

interface getter API.

  • Loading branch information...
akzhan committed Apr 11, 2012
1 parent 7cfb117 commit 298a807c49e7e2209c08fa0d3c171c7b7b536b9b
Showing with 7 additions and 0 deletions.
  1. +6 −0 lib/ftdi.rb
  2. +1 −0 test.rb
View
@@ -269,6 +269,12 @@ def write_data(bytes)
r
end
+ # Gets used interface of the device.
+ # @return [Interface] Used interface of the device.
+ def interface
+ Interface[self[:interface]]
+ end
+
# Open selected channels on a chip, otherwise use first channel.
# @param [Interface] new_interface Interface to use for FT2232C/2232H/4232H chips.
# @raise [StatusCodeError] libftdi reports error.
View
@@ -26,6 +26,7 @@ def dmx_write(ctx, bytes)
begin
ctx.usb_open(0x0403, 0x6001)
begin
+ puts ctx.interface
ctx.baudrate = BAUD_RATE
ctx.set_line_property(:bits_8, :stop_bit_2, :none)
ctx.flowctrl = Ftdi::SIO_DISABLE_FLOW_CTRL

0 comments on commit 298a807

Please sign in to comment.