| 148 | *****************************************************************************/ |
| 149 | |
| 150 | void SensorDataProvider::begin() |
| 151 | { |
| 152 | SettingsService& settings = SettingsService::getInstance(); |
| 153 | |
| 154 | if (false == settings.open(true)) |
| 155 | { |
| 156 | m_deviceId = settings.getHostname().getDefault(); |
| 157 | } |
| 158 | else |
| 159 | { |
| 160 | m_deviceId = settings.getHostname().getValue(); |
| 161 | |
| 162 | settings.close(); |
| 163 | } |
| 164 | |
| 165 | /* Initialize all sensor drivers. */ |
| 166 | m_impl->begin(); |
| 167 | |
| 168 | /* Load calibration values. If they are not available, save it with the sensor defaults. */ |
| 169 | if (false == load()) |
| 170 | { |
| 171 | createCalibrationFile(); |
| 172 | } |
| 173 | |
| 174 | logSensorAvailability(); |
| 175 | registerSensorTopics(); |
| 176 | |
| 177 | m_timer.start(SENSOR_PROCESS_PERIOD); |
| 178 | m_isInitialized = true; |
| 179 | } |
| 180 | |
| 181 | void SensorDataProvider::end() |
| 182 | { |
nothing calls this directly
no test coverage detected