2016-04-29 33 views
0

當將目標和onboardee wifinetwork配置傳遞給入門sdk時,我看到此錯誤。配置WiFi方法AllJoy框架的錯誤

這是發生錯誤的代碼片段。

 ConfigureWifiMode res1 = this.onboardingClient.configureWiFi(this.onboardingConfiguration.getTarget().getSSID(), passForConfigureNetwork, this.onboardingConfiguration.getTarget().getAuthType()); 

     Log.i("OnboardingManager", "configureWiFi result=" + res1); 
     switch(OnboardingManager.SyntheticClass_1.$SwitchMap$org$alljoyn$onboarding$transport$OnboardingTransport$ConfigureWifiMode[res1.ordinal()]) { 
     case 1: 
      this.onboardingClient.connectWiFi(); 
      return new OnboardingManager.DeviceResponse(OnboardingManager.DeviceResponse.ResponseCode.Status_OK); 
     case 2: 
      return new OnboardingManager.DeviceResponse(OnboardingManager.DeviceResponse.ResponseCode.Status_OK_CONNECT_SECOND_PHASE); 
     default: 
      Log.e("OnboardingManager", "configureWiFi returned an unexpected result: " + res1); 
      return new OnboardingManager.DeviceResponse(OnboardingManager.DeviceResponse.ResponseCode.Status_ERROR); 
     } 

這裏是我的logcat:

04-28 21:16:35.332 2812-2982/net.holisticlabs.august E/OnboardingManager: onboarddDevice 
                      org.alljoyn.bus.BusException: ER_BUS_SECURITY_NOT_ENABLED 

任何幫助將是巨大的!謝謝!

回答

0

嘗試驗證監聽器添加到總線附件:

/* set keyListener */ 
String keyStoreFileName = getApplicationContext().getFileStreamPath("alljoyn_keystore").getAbsolutePath(); 

if (keyStoreFileName != null && keyStoreFileName.length() > 0) { 
     SrpAnonymousKeyListener authListener = new SrpAnonymousKeyListener(this, m_logger, new String[] { "ALLJOYN_SRP_KEYX", "ALLJOYN_ECDHE_PSK" }); 
     Status authStatus = m_Bus.registerAuthListener(authListener.getAuthMechanismsAsString(), authListener, keyStoreFileName); 

     if (authStatus != Status.OK) { 
      Log.d("TAG","Failed to register Auth listener status = " + authStatus.toString()); 
     } 
} 


private final GenericLogger m_logger = new GenericLogger() { 
     @Override 
     public void debug(String TAG, String msg) { 
      Logg.d(msg); 
    } 

    @Override 
    public void info(String TAG, String msg) { 
     Logg.i(msg); 
    } 

    @Override 
    public void warn(String TAG, String msg) { 
     Logg.w(msg); 
    } 

    @Override 
    public void error(String TAG, String msg) { 
     Logg.e(msg); 
    } 

    @Override 
    public void fatal(String TAG, String msg) { 
     Logg.d(msg); 
    } 
}; 
+0

由於一噸!這解決了它。 – teemo91