Sha256: 365d81cf900ef9820f0c931672e7fa9ab6ffbce87679878b992cf6e4f60c1417

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

module Twib
  class Interface
    def initialize(connection, device_id, object_id)
      @connection = connection
      @device_id = device_id
      @object_id = object_id

      # object id 0 is special
      #if @object_id != 0 then
      #  ObjectSpace.define_finalizer(self, self.class.finalize(connection, device_id, object_id))
      #end
    end

    def self.finalize(connection, device_id, object_id)
      # send close request
      #connection.send_sync(device_id, object_id, 0xffffffff, String.new)
    end

    def send(command_id, payload=String.new, &block)
      @connection.send(@device_id, @object_id, command_id, payload, &block)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twib-0.1.0 lib/twib/interface.rb