MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / begin

Method begin

src/Hal/SensorDataProvider.cpp:150–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 *****************************************************************************/
149
150void 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
181void SensorDataProvider::end()
182{

Callers

nothing calls this directly

Calls 5

openMethod · 0.45
getDefaultMethod · 0.45
getValueMethod · 0.45
closeMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected