I have a test application that has two buttons one is to start Wifi Tracking and one to to stop. When I start the Wifi tracking, if there is an access point in range and entry event is not fired so I am not aware of being in the fence. Is there a way that when tracking starts that I can be notified that I am within a fence?
function startWifiTracking() {
//create the geofences and triggers
var triggers = {
Wifi : {
fc_entry : { type : 'Enter',
areaAccessPoints : [{SSID: 'test', MAC: '12:12:12:12:12:12'}],
callback : entry1,
otherAccessPointsAllowed : true},
fc_exit : { type : 'Exit',
areaAccessPoints : [{SSID: 'test', MAC: '12:12:12:12:12:12'}],
callback : exited1,
otherAccessPointsAllowed : true}
}};
//create the wifi policy for the wifi access points to be monitored
var policy = {
Wifi : {
interval : 3000,
signalStrengthThreshold : 15,
accessPointFilters : [{SSID: 'test', MAC: '*'}]
}};
WL.Device.startAcquisition(policy, triggers, acquisitionFailure);
}
//trigger callbacks for each wifi fence
function entry1() { alert('entered'); }
function exited1() { alert('exited'); }
function acquisitionFailure() {alert('failed');}
$(function() {
$('#btnStart').click( function(){
startWifiTracking();
});
});
$(function() {
$('#btnStop').click( function(){
WL.Device.stopAcquisition();
});
});