1f3df6b4fSBrad Bishop #pragma once 2f3df6b4fSBrad Bishop 3f3df6b4fSBrad Bishop class SensorSet; 4f3df6b4fSBrad Bishop 5*049e0dd2SMatt Spinler /** @brief Reads an environment variable 6*049e0dd2SMatt Spinler * 7*049e0dd2SMatt Spinler * Reads <prefix>_<sensor.first><sensor.second> 8*049e0dd2SMatt Spinler * 9*049e0dd2SMatt Spinler * @param[in] prefix - the variable prefix 10*049e0dd2SMatt Spinler * @param[in] sensor - Sensor details 11*049e0dd2SMatt Spinler * 12*049e0dd2SMatt Spinler * @return string - the env var value 13*049e0dd2SMatt Spinler */ 14f3df6b4fSBrad Bishop std::string getEnv( 15f3df6b4fSBrad Bishop const char* prefix, const SensorSet::key_type& sensor); 161f8a9586STom Joseph 17*049e0dd2SMatt Spinler /** @brief Reads an environment variable, and takes type and id separately 18*049e0dd2SMatt Spinler * 19*049e0dd2SMatt Spinler * @param[in] prefix - the variable prefix 20*049e0dd2SMatt Spinler * @param[in] type - sensor type, like 'temp' 21*049e0dd2SMatt Spinler * @param[in] id - sensor ID, like '5' 22*049e0dd2SMatt Spinler * 23*049e0dd2SMatt Spinler * @return string - the env var value 24*049e0dd2SMatt Spinler */ 25*049e0dd2SMatt Spinler std::string getEnv( 26*049e0dd2SMatt Spinler const char* prefix, 27*049e0dd2SMatt Spinler const std::string& type, 28*049e0dd2SMatt Spinler const std::string& id); 29*049e0dd2SMatt Spinler 301f8a9586STom Joseph /** @brief Get the label for the sensor with a level of indirection. 311f8a9586STom Joseph * 321f8a9586STom Joseph * Read the sensor number from the <path>/<item><X>_label file.<item> & <X> is 331f8a9586STom Joseph * populated from the sensor key. The sensor label is read from the environment 341f8a9586STom Joseph * variable <prefix>_<item><sensorNum>. 351f8a9586STom Joseph * 361f8a9586STom Joseph * @param[in] prefix - Prefix of the environment variable. 371f8a9586STom Joseph * @param[in] path - Directory path of the label file. 381f8a9586STom Joseph * @param[in] sensor - Sensor details. 391f8a9586STom Joseph * 401f8a9586STom Joseph * @return On success return the sensor label, in case of failure return empty 411f8a9586STom Joseph * string. 421f8a9586STom Joseph */ 431f8a9586STom Joseph std::string getIndirectLabelEnv( 441f8a9586STom Joseph const char* prefix, std::string path, const SensorSet::key_type& sensor); 45