Last active
November 5, 2017 12:52
-
-
Save misternay/ec3d73546aace7a3af279840808c5d03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String setJsonString(int counts) { | |
String jsonS = "{\n"; | |
jsonS += "\"homeMobileCountryCode\": 234,\n"; // this is a real UK MCC | |
jsonS += "\"homeMobileNetworkCode\": 27,\n"; // and a real UK MNC | |
jsonS += "\"radioType\": \"gsm\",\n"; // for gsm | |
jsonS += "\"carrier\": \"Vodafone\",\n"; // associated with Vodafone | |
jsonS += "\"wifiAccessPoints\": [\n"; | |
for (int j = 0; j < counts; ++j) | |
{ | |
jsonS += "{\n"; | |
jsonS += "\"macAddress\" : \""; | |
jsonS += (WiFi.BSSIDstr(j)); | |
jsonS += "\",\n"; | |
jsonS += "\"signalStrength\": "; | |
jsonS += WiFi.RSSI(j); | |
jsonS += "\n"; | |
if (j < counts - 1) | |
{ | |
jsonS += "},\n"; | |
} | |
else | |
{ | |
jsonS += "}\n"; | |
} | |
} | |
jsonS += ("]\n"); | |
jsonS += ("}\n"); | |
return jsonS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment