com.gtosoft.libvoyager.util
Class NetDetect

java.lang.Object
  extended by com.gtosoft.libvoyager.util.NetDetect

public class NetDetect
extends java.lang.Object

The purpose of this class is to perform passive CAN network detection. A separate class will collect network data (i.e. CAN IDs) and we will look at that collected data and form a "best guess" at which datapoint Network ID to use. Each entry in the dataPoint table in the Voyager Database contains a field "Network ID" which must be set in order to decode passive network traffic. This class will provide the link (the Network ID) between the collection of [unknown] network data, and the processes which decode that data.

Author:
brad

Constructor Summary
NetDetect(DashDB d)
          Default constructor.
 
Method Summary
 java.lang.String getBestGuessNetworkID(java.util.Set<java.lang.String> newBaseSet)
          Given a base set (set of observed CAN IDs), we will compare against all available DPNs in the DB.
 GeneralStats getStats()
          returns a reference to our instance of the general stats class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetDetect

public NetDetect(DashDB d)
Default constructor.

Method Detail

getBestGuessNetworkID

public java.lang.String getBestGuessNetworkID(java.util.Set<java.lang.String> newBaseSet)
Given a base set (set of observed CAN IDs), we will compare against all available DPNs in the DB. We'll then return the DPN Network ID corresponding to the closest match.

Returns:
- if no base set elements were provided then we will return a default value. Currently that is a blank string. If you get a "" from this method, then that means you should try again later when we have more PIDs, or it could mean your network is not known.

getStats

public GeneralStats getStats()
returns a reference to our instance of the general stats class.

Returns:
- a reference to our instance of the general stats class.