Created
August 12, 2009 20:55
-
-
Save lantins/166756 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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