1 2 package com.android.server.wifi; 3 4 import java.io.FileDescriptor; 5 import java.io.PrintWriter; 6 7 /** 8 * 9 */ 10 public class BaseWifiDiagnostics { 11 public static final byte CONNECTION_EVENT_STARTED = 0; 12 public static final byte CONNECTION_EVENT_SUCCEEDED = 1; 13 public static final byte CONNECTION_EVENT_FAILED = 2; 14 15 protected final WifiNative mWifiNative; 16 17 protected String mFirmwareVersion; 18 protected String mDriverVersion; 19 protected int mSupportedFeatureSet; 20 BaseWifiDiagnostics(WifiNative wifiNative)21 public BaseWifiDiagnostics(WifiNative wifiNative) { 22 mWifiNative = wifiNative; 23 } 24 startLogging(boolean verboseEnabled)25 public synchronized void startLogging(boolean verboseEnabled) { 26 mFirmwareVersion = mWifiNative.getFirmwareVersion(); 27 mDriverVersion = mWifiNative.getDriverVersion(); 28 mSupportedFeatureSet = mWifiNative.getSupportedLoggerFeatureSet(); 29 } 30 startPacketLog()31 public synchronized void startPacketLog() { } 32 stopPacketLog()33 public synchronized void stopPacketLog() { } 34 stopLogging()35 public synchronized void stopLogging() { } 36 37 /** 38 * Inform the diagnostics module of a connection event. 39 * @param connectionId A strictly increasing, non-negative, connection identifier 40 * @param event The type of connection event (see CONNECTION_EVENT_* constants) 41 */ reportConnectionEvent(long connectionId, byte event)42 synchronized void reportConnectionEvent(long connectionId, byte event) {} 43 captureBugReportData(int reason)44 public synchronized void captureBugReportData(int reason) { } 45 captureAlertData(int errorCode, byte[] alertData)46 public synchronized void captureAlertData(int errorCode, byte[] alertData) { } 47 dump(FileDescriptor fd, PrintWriter pw, String[] args)48 public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) { 49 dump(pw); 50 pw.println("*** firmware logging disabled, no debug data ****"); 51 pw.println("set config_wifi_enable_wifi_firmware_debugging to enable"); 52 } 53 dump(PrintWriter pw)54 protected synchronized void dump(PrintWriter pw) { 55 pw.println("Chipset information :-----------------------------------------------"); 56 pw.println("FW Version is: " + mFirmwareVersion); 57 pw.println("Driver Version is: " + mDriverVersion); 58 pw.println("Supported Feature set: " + mSupportedFeatureSet); 59 } 60 }