///////////////////////////////////////////////////////
| 93 | |
| 94 | //////////////////////////////////////////////////////////// |
| 95 | SensorManager::SensorManager() |
| 96 | { |
| 97 | // Global sensor initialization |
| 98 | SensorImpl::initialize(); |
| 99 | |
| 100 | // Per sensor initialization |
| 101 | for (unsigned int i = 0; i < Sensor::Count; ++i) |
| 102 | { |
| 103 | const auto sensor = static_cast<Sensor::Type>(i); |
| 104 | |
| 105 | // Check which sensors are available |
| 106 | m_sensors[sensor].available = SensorImpl::isAvailable(sensor); |
| 107 | |
| 108 | // Open the available sensors |
| 109 | if (m_sensors[sensor].available) |
| 110 | { |
| 111 | if (m_sensors[sensor].sensor.open(sensor)) |
| 112 | { |
| 113 | m_sensors[sensor].sensor.setEnabled(false); |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | m_sensors[sensor].available = false; |
| 118 | err() << "Warning: sensor " << i << " failed to open, will not be available" << std::endl; |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | //////////////////////////////////////////////////////////// |
| 125 | SensorManager::~SensorManager() |
nothing calls this directly
no test coverage detected