       throw new Error 'Contains query is only possible on buffered ports'
     @buffer.filter((packet) -> return true if packet.event is 'data').length
 
-  getBuffer: (scope) ->
+  getBuffer: (scope, idx) ->
     if scope?
       return undefined unless scope of @scopedBuffer
       buf = @scopedBuffer[scope]

    return if @process
    return if @options.control and ip.type isnt 'data'
    ip.owner = @nodeInstance
    ip.index = id

    if ip.scope?
      @scopedBuffer[ip.scope] = [] unless ip.scope of @scopedBuffer
      buf = @scopedBuffer[ip.scope]
    else
      buf = @buffer
    buf.push ip
    buf.shift() if @options.control and buf.length > 1



  prepareBuffer: ->
    @buffer = []
    @indexedBuffer = {} if @isAddressable()
    @scopedBuffer = {}

  prepareBufferForIP: (ip) ->
    if @isAddressable()
      if ip.scope?
        @scopedBuffer[ip.scope] = [] unless ip.scope of @scopedBuffer
        @scopedBuffer[ip.scope][ip.index] = [] unless ip.index of @scopedBuffer[ip.scope]
        return @scopedBuffer[ip.scope][ip.index]
      @indexedBuffer[ip.index] = [] unless ip.index of @indexedBuffer
      return @indexedBuffer[ip.index]
    if ip.scope?
      @scopedBuffer[ip.scope] = [] unless ip.scope of @scopedBuffer
      return @scopedBuffer[ip.scope]
    return @buffer

  validateData: (data) ->
    return unless @options.values
