Skip to content

Instantly share code, notes, and snippets.

@benbahrenburg
Created January 30, 2012 01:02
Show Gist options
  • Save benbahrenburg/1701720 to your computer and use it in GitHub Desktop.
Save benbahrenburg/1701720 to your computer and use it in GitHub Desktop.
Referencing the bencoding.network module
var benCodingNetwork = require('bencoding.network');
Ti.API.info("Create a new Carrier Info Object");
var carrierInfo = benCodingNetwork.createCarrierInfo();
Ti.API.info("Get carrier name => " + carrierInfo.carrierName);
Ti.API.info("Get mobile country code => " + carrierInfo.mobileCountryCode);
Ti.API.info("Get mobile network code => " + carrierInfo.mobileNetworkCode);
Ti.API.info("Get ISO country code for cellular service provider => " + carrierInfo.isoCountryCode);
Ti.API.info("Mobile service provider supports VOIP => " + carrierInfo.allowsVOIP);
Ti.API.info("Create a new Current Network Info Object");
var currentNetwork = benCodingNetwork.createCurrentNetwork();
Ti.API.info("Get SSID => " + currentNetwork.SSID);
Ti.API.info("Get BSSID => " + currentNetwork.BSSID);
Ti.API.info("Create a new Reachability Object");
var reachability = benCodingNetwork.createReachability();
Ti.API.info("Get reachabilityWithHostName => " + reachability.reachabilityWithHostName("www.apple.com"));
Ti.API.info("Get reachabilityForLocalWiFi => " + reachability.reachabilityForLocalWiFi());
var hostReachableByType = reachability.hostNameReachableBy("www.apple.com");
function getReachableType(findType){
var results = "Oops something went wrong";
if(findType==reachability.NETWORK_STATUS_NOT_REACHABLE){
results="Not Reachable";
}
if(findType==reachability.NETWORK_STATUS_WIFI){
results="WiFi Network";
}
if(findType==reachability.NEWORK_STATUS_WWAN){
results="Mobile Network";
}
return results;
};
var reachableType=getReachableType(hostReachableByType);
Ti.API.info("Reachable via => " + reachableType);
@albert0m
Copy link

same thing here. I recompiled it from the sources but the problem above is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment