blob: e14dd1763ed7d3a44eaae1a6d00f7f1dfae7bb11 [file] [log] [blame]
Brad Bishopf3df6b42017-01-06 10:14:09 -05001#pragma once
2
Patrick Venture9331ab72018-01-29 09:48:47 -08003#include <string>
4
5#include "sensorset.hpp"
Brad Bishopf3df6b42017-01-06 10:14:09 -05006
Matt Spinler049e0dd2017-10-12 16:33:22 -05007/** @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 Bishopf3df6b42017-01-06 10:14:09 -050016std::string getEnv(
17 const char* prefix, const SensorSet::key_type& sensor);
Tom Joseph1f8a9582017-06-12 20:10:59 +053018
Matt Spinler049e0dd2017-10-12 16:33:22 -050019/** @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 */
27std::string getEnv(
28 const char* prefix,
29 const std::string& type,
30 const std::string& id);
31
Matt Spinler82d507d2017-10-12 16:36:57 -050032/** @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 */
40std::string getIndirectID(
41 std::string path,
42 const SensorSet::key_type& sensor);