Brad Bishop | f3df6b4 | 2017-01-06 10:14:09 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 9331ab7 | 2018-01-29 09:48:47 -0800 | [diff] [blame] | 3 | #include <string> |
| 4 | |
| 5 | #include "sensorset.hpp" |
Brad Bishop | f3df6b4 | 2017-01-06 10:14:09 -0500 | [diff] [blame] | 6 | |
Matt Spinler | 049e0dd | 2017-10-12 16:33:22 -0500 | [diff] [blame] | 7 | /** @brief Reads an environment variable |
| 8 | * |
| 9 | * Reads <prefix>_<sensor.first><sensor.second> |
| 10 | * |
| 11 | * @param[in] prefix - the variable prefix |
| 12 | * @param[in] sensor - Sensor details |
| 13 | * |
| 14 | * @return string - the env var value |
| 15 | */ |
Brad Bishop | f3df6b4 | 2017-01-06 10:14:09 -0500 | [diff] [blame] | 16 | std::string getEnv( |
| 17 | const char* prefix, const SensorSet::key_type& sensor); |
Tom Joseph | 1f8a958 | 2017-06-12 20:10:59 +0530 | [diff] [blame] | 18 | |
Matt Spinler | 049e0dd | 2017-10-12 16:33:22 -0500 | [diff] [blame] | 19 | /** @brief Reads an environment variable, and takes type and id separately |
| 20 | * |
| 21 | * @param[in] prefix - the variable prefix |
| 22 | * @param[in] type - sensor type, like 'temp' |
| 23 | * @param[in] id - sensor ID, like '5' |
| 24 | * |
| 25 | * @return string - the env var value |
| 26 | */ |
| 27 | std::string getEnv( |
| 28 | const char* prefix, |
| 29 | const std::string& type, |
| 30 | const std::string& id); |
| 31 | |
Matt Spinler | 82d507d | 2017-10-12 16:36:57 -0500 | [diff] [blame] | 32 | /** @brief Gets the ID for the sensor with a level of indirection |
| 33 | * |
| 34 | * Read the sensor number/ID from the <path>/<item><X>_label file. |
| 35 | * <item> & <X> are populated from the sensor key. |
| 36 | * |
| 37 | * @param[in] path - Directory path of the label file |
| 38 | * @param[in] sensor - Sensor details |
| 39 | */ |
| 40 | std::string getIndirectID( |
| 41 | std::string path, |
| 42 | const SensorSet::key_type& sensor); |