use of com.inceptai.dobby.model.DobbyWifiInfo in project dobby-android by InceptAi.
the class WifiAnalyzer method initializeWifiState.
private void initializeWifiState() {
Preconditions.checkNotNull(wifiManager);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
//Switch thread and do this.
wifiState.updateWifiStats(new DobbyWifiInfo(wifiInfo), null);
registerWifiStateReceiver();
//Publish detailed connection state and wifi state on the bus
updateWifiStatsDetailedState(WifiInfo.getDetailedStateOf(wifiInfo.getSupplicantState()));
processWifiStateChanged(wifiManager.getWifiState());
}
use of com.inceptai.dobby.model.DobbyWifiInfo in project dobby-android by InceptAi.
the class InferenceEngine method notifyWifiState.
public synchronized DataInterpreter.WifiGrade notifyWifiState(WifiState wifiState, @WifiState.WifiLinkMode int wifiLinkMode, @ConnectivityAnalyzer.WifiConnectivityMode int wifiConnectivityMode) {
DataInterpreter.WifiGrade wifiGrade = new DataInterpreter.WifiGrade();
if (wifiState != null) {
HashMap<Integer, WifiState.ChannelInfo> channelMap = wifiState.getChannelInfoMap();
DobbyWifiInfo wifiInfo = wifiState.getLinkInfo();
wifiGrade = DataInterpreter.interpret(channelMap, wifiInfo, wifiLinkMode, wifiConnectivityMode);
wifiGrade.errorCode = getWifiErrorCode(wifiConnectivityMode);
}
metricsDb.updateWifiGrade(wifiGrade);
PossibleConditions conditions = InferenceMap.getPossibleConditionsFor(wifiGrade);
currentConditions.mergeIn(conditions);
DobbyLog.i("InferenceEngine Wifi Grade: " + wifiGrade.toString());
DobbyLog.i("InferenceEngine which gives conditions: " + conditions.toString());
DobbyLog.i("InferenceEngine After merging: " + currentConditions.toString());
checkAndSendSuggestions();
return wifiGrade;
}
use of com.inceptai.dobby.model.DobbyWifiInfo in project dobby-android by InceptAi.
the class NetworkLayer method getCurrentWifiGrade.
public DataInterpreter.WifiGrade getCurrentWifiGrade() {
HashMap<Integer, WifiState.ChannelInfo> channelMap = getWifiState().getChannelInfoMap();
DobbyWifiInfo wifiInfo = getWifiState().getLinkInfo();
DataInterpreter.WifiGrade wifiGrade = DataInterpreter.interpret(channelMap, wifiInfo, getWifiLinkMode(), getCurrentConnectivityMode());
return wifiGrade;
}
use of com.inceptai.dobby.model.DobbyWifiInfo in project dobby-android by InceptAi.
the class WifiAnalyzer method updateWifiStatsWithWifiInfo.
protected void updateWifiStatsWithWifiInfo(WifiInfo info) {
if (info == null) {
info = wifiManager.getConnectionInfo();
}
//Convert to DobbyWifiInfo
DobbyWifiInfo dobbyWifiInfo = new DobbyWifiInfo(info);
;
wifiState.updateWifiStats(dobbyWifiInfo, null);
}
Aggregations