The clue was in my post - but here you go:
#include <SPI.h>
#include <SFE_CC3000.h>
// Pins
#define CC3000_INT 2 // Needs to be an interrupt pin (D2/D3)
#define CC3000_EN 8 // Can be any digital pin
#define CC3000_CS 10 // Preferred is pin 10 on Uno
// Global Variables
SFE_CC3000 wifi = SFE_CC3000(CC3000_INT, CC3000_EN, CC3000_CS);
void setup() {
int i;
AccessPointInfo ap_info;
// Initialize Serial port
Serial.begin(9600);
Serial.println();
Serial.println("---------------------------");
Serial.println("SparkFun CC3000 - Scan Test");
Serial.println("---------------------------");
// Initialize CC3000 (configure SPI communications)
if ( wifi.init() ) {
Serial.println("CC3000 initialization complete");
} else {
Serial.println("Something went wrong during CC3000 init!");
}
// Perform scan of nearby WAPs
Serial.println("Scanning APs. Waiting for scan to complete.");
if ( wifi.scanAccessPoints(4000) != true ) {
Serial.println("Error scanning APs");
}
// Iterate through available WAPs and print their information
Serial.println("Access Points found:");
Serial.println();
while ( wifi.getNextAccessPoint(ap_info) ) {
Serial.print("SSID: ");
Serial.println(ap_info.ssid);
Serial.print("MAC address: ");
for ( i = 0; i < BSSID_LENGTH; i++ ) {
if ( ap_info.bssid[i] < 0x10 ) {
Serial.print("0");
}
Serial.print(ap_info.bssid[i], HEX);
if ( i < BSSID_LENGTH - 1 ) {
Serial.print(":");
}
}
Serial.println();
Serial.print("RSSI: ");
Serial.println(ap_info.rssi, DEC);
Serial.print("Security: ");
switch(ap_info.security_mode) {
case WLAN_SEC_UNSEC:
Serial.println("Unsecured");
break;
case WLAN_SEC_WEP:
Serial.println("WEP");
break;
case WLAN_SEC_WPA:
Serial.println("WPA");
break;
case WLAN_SEC_WPA2:
Serial.println("WPA2");
break;
default:
break;
}
Serial.println();
}
// Done!
Serial.println("Finished scan test");
}
void loop() {
// Do nothing
delay(1000);
}
// end of program
Serial output:
---------------------------
SparkFun CC3000 - Scan Test
---------------------------
CC3000 initialization complete
Scanning APs. Waiting for scan to complete.
Access Points found:
SSID: T2 Dalkey Airport
MAC address: F8:D1:11:88:42:F8
RSSI: 61
Security: WPA2
SSID: SeeeduinoCloud-Ad637
MAC address: A8:40:41:13:A1:A4
RSSI: 43
Security: WPA2
Finished scan test