Skip to content

Instantly share code, notes, and snippets.

@lantins
Created August 12, 2009 20:55
Show Gist options
  • Select an option

  • Save lantins/166756 to your computer and use it in GitHub Desktop.

Select an option

Save lantins/166756 to your computer and use it in GitHub Desktop.
# When a connection has identified it should let us know using this method.
#
# @param [IRIS::IPGateway::Connection] connection
# @param [String] serial_number serial number of the unit.
# @return [true, false]
def identified(connection, serial_number)
return false unless known_connection?(connection)
if @identified_connections.has_key?(serial_number) # check if we already have a connection for this serial number?
@identified_connections[serial_number].connection_stale! # close the stale connection.
end
# move from unidentified to identified.
@unidentified_connections.delete(connection)
@identified_connections[serial_number] = connection
return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment