Skip to main content

Boot-time Device Information

Log Useful Hardware Details At Start-up

When an imp-enabled development is powered up or restarts, it does not present any information about the device state, such as which impOS™ version it is running, how it is connected to the Internet, or what event may have prompted the restart.

All of this information is available to Squirrel, via a number of imp API methods. The following code uses these methods to provide useful device information at start-up. Typically you will place the code toward the top of your device code listing.

Here is a typical log output from the code for a WiFi device:

2018-01-15 12:47:38.766 +01:00 "Wiffy": [Device] impOS version 36.13 
2018-01-15 12:47:38.773 +01:00 "Wiffy": [Device] Running 'Experimental' (bb62683f-d8d4-7aaf-fa4e-5c4796105507)
2018-01-15 12:47:38.776 +01:00 "Wiffy": [Device] SHA d36dcd27034fa4d270c75abb82c0aaea5910df70f19301491e8e4edab79015e1
2018-01-15 12:47:38.778 +01:00 "Wiffy": [Device] Connected by WiFi on SSID "darkmatter" with IP address 192.168.0.4
2018-01-15 12:47:38.779 +01:00 "Wiffy": [Device] Device restarted: Application code updated

and for a cellular imp:

2018-10-02 12:09:29.901 +01:00 "CellySavalas": [Device] impOS version 39.12 
2018-10-02 12:09:29.901 +01:00 "CellySavalas": [Device] Running 'Experimental' (bb62683f-d8d4-7aaf-fa4e-5c4796105507)
2018-10-02 12:09:29.909 +01:00 "CellySavalas": [Device] SHA c0dab2f96175790f8d90cfad90296971f3c4daa91d26572ed4ed0710ded85766
2018-10-02 12:09:29.909 +01:00 "CellySavalas": [Device] Connected by cellular (IMEI xxxxxxxxxxxxxxxx)
2018-10-02 12:09:29.909 +01:00 "CellySavalas": [Device] Device restarted: Application code updated

Sample Code

API Methods Used