Internal Workings

This page contains various sections about internals of AIRS, supported sensors, how to extend AIRS etc. This page is under constant development, being extended over time with more and more information. If you have suggestions as to what needs documentation, please drop me an email!

Format of the Stored File in Local Sensing

Note that since V2.2, AIRS does not use text files anymore but utilises the internal SQLlite system!

AIRS stores locally sensed values in a text file under the /AIRS_values directory within the user space of the SD card (often at /mnt/sdcard).

The format of the file is rather simple:

The first line is the timestamp of starting the local sensing session

Fri Jul 15 14:09:32 GMT+01:00 2011

Following this initial line, you will find the following structure for each sensor value measurement

#4;PR;5.0

The ‘#’ character is a marker for the beginning of the line. The ‘;’ is a delimiter between the sections of the entry. The first entry is the time in milliseconds from the original timestamp, as described above. Here the value was sensed 4 milliseconds after starting. The second entry is the sensor symbol that was sensed (here ‘PR’ for proximity sensor). The third entry is the value for this sensor (here a float of 5.0) – see list of supported sensors below for the description of values for each sensor!

Some sensors, like GI, BT or WF, can have multi-line entries (e.g., when sensing several Bluetooth devices). Each value here is separated with a new line character. A parser can use the new line followed by ‘#’ as a delimiter.

Supported Sensors

Here is a list of currently supported sensors in AIRS with a brief description. Most of these sensors can be adjusted to some extent in through their own configuration for handlers. Many of the handlers are implemented through Android listeners or receivers, which reduces necessary polling and therefore improves overall battery lifetime.

  1. AS: Average audio amplitude in dB (sound pressure level), providing surrounding noise level with adjustable sampling rate and interval of sensing (note that the sensor needs one second to sample so that values are read roughly every interval+1 seconds!). In the preferences, a setting can be defined to adjust the sound level in dB in order to accommodate possible differences in phone hardware. (NOTE: the old AA sensor has been deprecated since V2.0.4)
  2. AF: Estimated audio frequency in Hertz, measured based on an assumed sinus input into the microphone. Sampling rate and interval of sensing can be adjusted.
  3. BT: Bluetooth devices around with MAC and Bluetooth name being sensed. Interval of sensing can be adjusted.
  4. BN: Number of Bluetooth devices around with interval of sensing being adjustable.
  5. CA: Calendar event from one of the selected calendars (currently, only Honeycomb and above supports selection of calendars!). The value is stored as “title:location:begin:end” with begin and end counted as milliseconds from epoch.
  6. CR: Cellular roaming with 0 (not roaming) and 1 (roaming) value (only GSM phones are supported!)
  7. CD: Cellular data being connected with 1 (connected) and 0 (not connected) value (only GSM phones are supported!)
  8. CS: Cellular signal strength in dBm (only GSM phones are supported!)
  9. CB: Cellular signal strength in bars (only GSM phones are supported!)
  10. CI: Cellular cell identifier as integer (only GSM phones are supported!)
  11. CL: Cellular location area code as integer (only GSM phones are supported!)
  12. CC: Cellular network code as integer (only GSM phones are supported!)
  13. EB: Event button signal with 1 (pressed) and 0 (not pressed). For this, the AIRS event button widget needs to be added to the launcher screen. When pressing, a haptic feedback is given.
  14. MO: Mood button signal with strings like “Happy”, “Content”, “Surprised”, “Angry” and “Sad” being stored. For this, the AIRS mood button widget needs to be added to the launcher screen. When pressing, a haptic feedback is given.
  15. GO: GPS longitude in degrees as float value with GPS polling interval and accuracy adjustable
  16. GL: GPS latitude in degrees as float value with GPS polling interval and accuracy adjustable
  17. GA: GPS altitude in meters as float value with GPS polling interval and accuracy adjustable
  18. GI: GPS information as string with format “longitude:latitude:altitude” with GPS polling interval and accuracy adjustable
  19. GS: GPS speed in meters/s with GPS polling interval and accuracy adjustable
  20. GC: GPS heading in degrees (0 to 360) with GPS polling interval and accuracy adjustable
  21. HB: Event button of the AliveTech heart monitor with 0 (not pressed) and 1 (pressed) values
  22. HL: Battery level of the AliveTech heart monitor in %
  23. HE: Array of ECG values per second of the AliveTech heart monitor (this value is not stored in the local text file!)
  24. HP: Pulse determined through the ECG values of the AliveTech heart monitor
  25. HX: x-acceleration of the AliveTech heart monitor in m/s
  26. HY: y-acceleration of the AliveTech heart monitor in m/s
  27. HZ: z-acceleration of the AliveTech heart monitor in m/s
  28. HA: combined HX, HZ, HZ values as strings
  29. IH: heart rate in beats per minute, measured through the camera and flash light. You need to add a widget to the launcher screen in order to start the measurement screen.
  30. Az: Azimuth of the orientation sensor from 0 to 360 in degrees with polling interval being adjustable
  31. Ro: Roll of the device in degrees from -90 to 90 with polling interval being adjustable
  32. Pi: Pitch of the device in degrees from -180 to 180 with polling interval being adjustable
  33. LI: Light sensor in Lux with polling interval being adjustable
  34. PR: Proximity sensor in meter distance (most devices only support far/near values) with polling interval being adjustable
  35. PU: Pressure (barometer) sensor for devices like the Galaxy Nexus, measured in hPa
  36. PS: Proximity sampling when BT devices defined in /AIRS_values/PS.conf have been found. The sound clips are stored in the /NORS_values directory with filename ‘timestamp.3gp‘ with polling interval and sampling frequency being adjustable
  37. TR: list of running tasks with suffix of package name (such as airs) being stored in each line of the sensor value
  38. Ba: Battery level of the device in %
  39. BV: Battery voltage in mV
  40. Bc: Battery charging status with 0 (not charging) and 1 (charging)
  41. BM: Battery temperature in Celsius
  42. Rm: available RAM
  43. Sc: Screen on with 0 (off) and 1 (on) values
  44. HS: Headset plugged (value 1) or not (value 0)
  45. IC: Incoming phone call with number (and contact name, if available) being stored
  46. OC: Outgoing call being placed with number (and contact name, if available) being stored
  47. SR: SMS being received with string ‘number:name:message text‘ being stored (name being “—“, if not available)
  48. SS: SMS being sent with string ‘number:name:message text‘ being stored (name being “—“, if not available)
  49. WI: Wifi SSID of all scanned WLAN networks as a string with each network separated by new line with scanning interval being adjustable
  50. WS: Wifi signal strength of all scanned WLAN networks as a string with each network separated by new line with scanning interval being adjustable
  51. WM: Wifi MAC address of all scanned WLAN networks as a string with each network separated by new line with scanning interval being adjustable
  52. WF: Wifi information (SSID, MAC, signal strength) of all scanned WLAN networks as a string with each network separated by new line with scanning interval being adjustable
  53. WC: Wifi connected with 0 (not connected) and 1 (connected)
  54. VT: Temperature at current location in Celcius – this sensor uses the Google weather API (connectivity required)
  55. VF: Temperature at current location in Fahrenheit – this sensor uses the Google weather API (connectivity required)
  56. VH: Humidity at current location in % – this sensor uses the Google weather API (connectivity required)
  57. VC: Conditions (like sunny, cloudy) at current location – this sensor uses the Google weather API (connectivity required)
  58. VW: Wind at current location – this sensor uses the Google weather API (connectivity required)
  59. VI: combined weather information in the form “lat:long:value of VC:value of VF:value of VH:value of VC:value of VW” – this allows parsing in one go with a single timestamp. The (lat,long) pair is the one used for current location – this sensor uses the Google weather API (connectivity required)
  60. MP: Currently playing music with artist, album and track (‘currently playing’ means that it has been selected by the media player – although the player might not  be playing it anymore!)
  61. MA: Currently playing artist (‘currently playing’ means that it has been selected by the media player – although the player might not  be playing it anymore!)
  62. ML: Currently playing album (‘currently playing’ means that it has been selected by the media player – although the player might not  be playing it anymore!)
  63. MT: Currently playing track (‘currently playing’ means that it has been selected by the media player – although the player might not  be playing it anymore!)
  64. MW: Watches defined folders for camera, pictures, music and videos. Readings contain the type of media (currently camera, pictures, videos and music) and the file being created
  65. Rd: Random number generator for testing purposes with values between 0 and 65535

 

Implementing an own AIRS Sensor Handler

Coming soon!

Implementing an own AIRS Sensor Configuration

Coming soon!

Leave a Reply

Your email address will not be published. Required fields are marked *

43 − = 34
Powered by MathCaptcha