2014-02-26 26 views
1

功能工作燈 - 連接觸發器在無線網絡連接拋出Error

loadWifiTracking() { 

     var policy = { 

      Wifi: { 
       interval: 3000, 
       signalStrengthThreshold: 15, 
       accessPointFilters: [{SSID:"wifiName"}] 
      } 
     }; 

     var triggers = { 

     Wifi: { 

      DwellInSide: { 
       type: "DwellInside", 
       areaAccessPoints: [{SSID: 'wifiName'}], 
       callback:function() {alert("Thank You For Being Here!");}, 
       dwellingTime: 5000 
      }, 

      Connected: { 
       type: 'Connect', 
       connectedAccessPoint:[{SSID: 'wifiName'}], 
       callback: function() {alert("Reached Here");} 
      }, 

     } 

     }; 


    WL.Device.startAcquisition(policy, triggers, acquisitionFailure); 

     var acquisitionFailure = { 

      Wifi : wifiFailure, 

    }; 

    function wifiFailure(positionError) { 

     alert("pe" + positionError); 

    } 

} 

它拋出一個錯誤:

The WIFI Connect trigger with network specification: [{"SSID":"wifiName"}] will have no affect, since this network do not appear in WIFI acquisition policy.

任何想法是確切的問題?請幫忙。

回答

2
Connected: { 
       type: 'Connect', 
       connectedAccessPoint:[{SSID: 'wifiName'}], 
       callback: function() {alert("Reached Here");} 
      }, 

正如你可以在Connect觸發的情況看,物業connectedAccessPoint,是單數。因此,您不應傳遞一組SSID,而應該傳遞一個SSID。

嘗試:

Connected: { 
        type: 'Connect', 
        connectedAccessPoint:{SSID: 'wifiName'}, 
        callback: function() {alert("Reached Here");} 
       }, 
+0

感謝名單。有效..!! – yogesh

相關問題