| 229 | } |
| 230 | |
| 231 | void LedDevice::enable() |
| 232 | { |
| 233 | if (!_signalTerminate) |
| 234 | { |
| 235 | _pauseRetryTimer = -1; |
| 236 | stopRetryTimer(); |
| 237 | |
| 238 | if (!_isDeviceInitialised && init(_devConfig)) |
| 239 | { |
| 240 | Debug(_log, "First enable the device"); |
| 241 | _isDeviceInitialised = true; |
| 242 | } |
| 243 | |
| 244 | if (_isDeviceInitialised) |
| 245 | { |
| 246 | Debug(_log, "Enable the device"); |
| 247 | enableDevice(true); |
| 248 | } |
| 249 | else |
| 250 | Error(_log, "Could not initialize the device before enabling"); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | void LedDevice::enableDevice(bool toEmit) |
| 255 | { |