Then, which device do you have? The Core or the Photon? Unless you tell us that, there's little we can do but guess.
As far as I'm aware WiFi.RSSI(); is documented for both the photon and the Core, thus should work on either.
Have you given that a try already?
Try the example from @Aurelian, looks like it should work.
I think we are confused by your question–do you have a Particle Core or Photon? In either case you do not need the Adafruit CC3000 Library. It will not be useful and everything in that library and more is already in the system firmware for a Core. In particular, the WiFi.RSSI method.
If you do not have a Particle Photon or Core, then I can tell you that wlan_ioctl_get_scan_results is a library function provided by the TI CC3000 driver that fetches infomation about all the current WiFi networks from the TI part. There is no other WiFi scanning API in the TI driver. In order to find the RSSI of the current network, you first have to get the current network SSID and then look though the data table returned by the TI driver function wlan_ioctl_get_scan_results to find the entry that matches your SSID. There is no other way that I know of to get that information.
@jaed1990, I believe you are in the wrong community for your questions. You need to go to the Adafruit forum under “Other Arduino products from Adafruit” and search for CC3000 there.
We can’t help you here since this is the Particle (formerly Spark) product support community. The first generation Spark Core used the TI CC3000 but the newer Photon no longer does.
I used the following code and it worked, however I get a crazy number returned (536901568). What do I need to do to get it into the correct RSSI range?
Are you using the same code that @Exit2Studios posted? I tested that code, and it works fine for me (though the Particle.variable syntax should be changed to the current version). Which device are you running your code on?
I don't see anything wrong with that, in fact, that's the way I would do it. When I test your first version, it works fine for me. Can you post the whole code, so I can see it in its context?
WiFi.RSSI() doesn’t return an int but an object like this
class WiFiSignal : public particle::Signal {
public:
// In order to be compatible with CellularSignal
int rssi = 2;
int qual = 0;
WiFiSignal() {}
WiFiSignal(const wlan_connected_info_t& inf);
virtual ~WiFiSignal() {};
operator int8_t() const;
bool fromConnectedInfo(const wlan_connected_info_t& sig);
virtual hal_net_access_tech_t getAccessTechnology() const;
virtual float getStrength() const;
virtual float getStrengthValue() const;
virtual float getQuality() const;
virtual float getQualityValue() const;
// virtual size_t printTo(Print& p) const;
private:
wlan_connected_info_t inf_ = {0};
};
Since sprintf() does only take pointers to the provided parameter and does the type casting based on the format string the compiler doesn’t help selecting the correct overload, but if you use (int8_t) cast overload you should get what you want.
WiFi.RSSI() returns the signal strength of a Wi-Fi network from -127 (weak) to -1dB (strong) as an int. Positive return values indicate an error with 1 indicating a Wi-Fi chip error and 2 indicating a time-out error.
Doesn't that seem to indicate that WiFi.RSSI() returns an int?