blob: 1b64a93de2c277e54d11e187f3949fb73965f864 [file] [log] [blame]
Brad Bishopf3df6b42017-01-06 10:14:09 -05001#pragma once
2
3class SensorSet;
4
Matt Spinler049e0dd2017-10-12 16:33:22 -05005/** @brief Reads an environment variable
6 *
7 * Reads <prefix>_<sensor.first><sensor.second>
8 *
9 * @param[in] prefix - the variable prefix
10 * @param[in] sensor - Sensor details
11 *
12 * @return string - the env var value
13 */
Brad Bishopf3df6b42017-01-06 10:14:09 -050014std::string getEnv(
15 const char* prefix, const SensorSet::key_type& sensor);
Tom Joseph1f8a9582017-06-12 20:10:59 +053016
Matt Spinler049e0dd2017-10-12 16:33:22 -050017/** @brief Reads an environment variable, and takes type and id separately
18 *
19 * @param[in] prefix - the variable prefix
20 * @param[in] type - sensor type, like 'temp'
21 * @param[in] id - sensor ID, like '5'
22 *
23 * @return string - the env var value
24 */
25std::string getEnv(
26 const char* prefix,
27 const std::string& type,
28 const std::string& id);
29
Matt Spinler82d507d2017-10-12 16:36:57 -050030/** @brief Gets the ID for the sensor with a level of indirection
31 *
32 * Read the sensor number/ID from the <path>/<item><X>_label file.
33 * <item> & <X> are populated from the sensor key.
34 *
35 * @param[in] path - Directory path of the label file
36 * @param[in] sensor - Sensor details
37 */
38std::string getIndirectID(
39 std::string path,
40 const SensorSet::key_type& sensor);