Skip to main content

imp.getssid()

Returns the SSID of the WiFi network for which the imp is currently configured

Availability

Device (from impOS™ 27)
DEPRECATED METHOD — DO NOT USE IN NEW CODE

Returns

String — the recorded wireless network’s SSID

Description

Note This method is now deprecated. However, removing it altogether would cause users’ existing code to stop working, so we currently have no plans to do so. The recommended means of gaining the information this method returns is to call imp.net.info().


This method returns the name of the wireless network to which the imp is configured to connect, ie. the name of the network the imp will look for when it next attempts to connect. This may not be the same as the name of the network to which the imp is currently connected: its WiFi configuration may have been modified by imp.setwificonfiguration() after the connection was made:

  1. An imp uses its stored configuration to connect to a network with SSID “AAA”
  2. imp.getssid() returns AAA
  3. The Squirrel code uses imp.setwificonfiguration() to change the imp’s stored configuration to a network with SSID “BBB”
  4. imp.getssid() returns BBB
  5. The imp is manually power-cycled
  6. An imp uses its stored configuration to connect to a network with SSID “BBB”
  7. imp.getssid() returns BBB

The SSID is returned as a string of up to 32 characters and can be used to identify a particular wireless network. If the imp has no wireless network information recorded, the returned string is empty, ie. "".

Note This method has been removed from versions of impOS running on the impC001.