diff --git a/action/HasActionsIF.h b/action/HasActionsIF.h index f30fcb45..4d66ad1f 100644 --- a/action/HasActionsIF.h +++ b/action/HasActionsIF.h @@ -7,8 +7,10 @@ #include #include /** - * \brief Interface for component which uses actions + * @brief + * Interface for component which uses actions * + * @details * This interface is used to execute actions in the component. Actions, in the sense of this interface, are activities with a well-defined beginning and * end in time. They may adjust sub-states of components, but are not supposed to change * the main mode of operation, which is handled with the HasModesIF described below. @@ -23,6 +25,8 @@ * parameters and immediately start execution of the action. It is, however, not required to * immediately finish execution. Instead, this may be deferred to a later point in time, at * which the component needs to inform the caller about finished or failed execution. + * + * \ingroup interfaces */ class HasActionsIF { public: diff --git a/devicehandlers/DeviceHandlerBase.cpp b/devicehandlers/DeviceHandlerBase.cpp index def9a724..35a987f3 100644 --- a/devicehandlers/DeviceHandlerBase.cpp +++ b/devicehandlers/DeviceHandlerBase.cpp @@ -834,8 +834,9 @@ ReturnValue_t DeviceHandlerBase::getStateOfSwitches(void) { ReturnValue_t result = getSwitches(&switches, &numberOfSwitches); if ((result == RETURN_OK) && (numberOfSwitches != 0)) { while (numberOfSwitches > 0) { - if (powerSwitcher->getSwitchState(switches[numberOfSwitches - 1]) - == PowerSwitchIF::SWITCH_OFF) { + if (powerSwitcher-> getSwitchState(switches[numberOfSwitches - 1]) + == PowerSwitchIF::SWITCH_OFF) + { return PowerSwitchIF::SWITCH_OFF; } numberOfSwitches--; @@ -1267,4 +1268,7 @@ void DeviceHandlerBase::setTaskIF(PeriodicTaskIF* task_){ executingTask = task_; } +void DeviceHandlerBase::debugInterface(uint8_t positionTracker) { +} + diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 03e35727..4938e019 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -553,6 +553,18 @@ protected: */ virtual void fillCommandAndReplyMap() = 0; + + /** + * @brief Can be implemented by child handler to + * perform debugging + * @details Example: Calling this in performOperation + * to track values like mode. An optional position tracker can be supplied + * to provide the child handler a way to know where the debugInterface was called + * + * Please delete all debugInterface calls in DHB after debugging is finished ! + */ + virtual void debugInterface(uint8_t positionTracker = 0); + /** * This is a helper method to facilitate inserting entries in the command map. * @param deviceCommand Identifier of the command to add. diff --git a/events/EventManager.cpp b/events/EventManager.cpp index 01334bac..46c53752 100644 --- a/events/EventManager.cpp +++ b/events/EventManager.cpp @@ -137,9 +137,10 @@ void EventManager::printEvent(EventMessage* message) { error << "0x" << std::hex << message->getReporter() << std::dec; } error << " reported " << translateEvents(message->getEvent()) << " (" - << std::dec << message->getEventId() << std::hex << ") P1: 0x" - << message->getParameter1() << " P2: 0x" - << message->getParameter2() << std::dec << std::endl; + << std::dec << message->getEventId() << ") " << std::endl; + + error << std::hex << "P1 Hex: 0x" << message->getParameter1() << ", P1 Dec: " << std::dec << message->getParameter1() << std::endl; + error << std::hex << "P2 Hex: 0x" << message->getParameter2() << ", P2 Dec: " << std::dec << message->getParameter2() << std::endl; break; } diff --git a/modes/ModeHelper.cpp b/modes/ModeHelper.cpp index 7b98bdc6..d9266c35 100644 --- a/modes/ModeHelper.cpp +++ b/modes/ModeHelper.cpp @@ -1,6 +1,7 @@ #include #include #include +#include ModeHelper::ModeHelper(HasModesIF *owner) : theOneWhoCommandedAMode(0), commandedMode(HasModesIF::MODE_OFF), commandedSubmode( @@ -42,7 +43,6 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* message) { } countdown.setTimeout(timeout); - owner->startTransition(mode, submode); } break; diff --git a/power/PowerSwitchIF.h b/power/PowerSwitchIF.h index 1c4c06f7..f25589c4 100644 --- a/power/PowerSwitchIF.h +++ b/power/PowerSwitchIF.h @@ -11,8 +11,13 @@ #include #include /** - * This interface defines a connection to a device that is capable of turning on and off - * switches of devices identified by a switch ID. + * + * @brief This interface defines a connection to a device that is capable of turning on and off + * switches of devices identified by a switch ID. + * @details The virtual functions of this interface do not allow to make any assignments + * because they can be called asynchronosuly (const ending). + * + * @ingroup interfaces */ class PowerSwitchIF : public HasReturnvaluesIF { public: