moved no comamnd and raw command to device handler IF

This commit is contained in:
Robin Müller 2020-12-23 20:17:10 +01:00
parent e94238762f
commit dcc111e4fa
3 changed files with 4 additions and 5 deletions

View File

@ -693,7 +693,7 @@ void DeviceHandlerBase::doGetRead() {
void DeviceHandlerBase::parseReply(const uint8_t* receivedData,
size_t receivedDataLen) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
DeviceCommandId_t foundId = DeviceHandlerIF::NO_COMMAND;
DeviceCommandId_t foundId = DeviceHandlerIF::NO_COMMAND_ID;
size_t foundLen = 0;
// The loop may not execute more often than the number of received bytes
// (worst case). This approach avoids infinite loops due to buggy
@ -1452,7 +1452,7 @@ DeviceCommandId_t DeviceHandlerBase::getPendingCommand() const {
if(cookieInfo.pendingCommand != deviceCommandMap.end()) {
return cookieInfo.pendingCommand->first;
}
return DeviceHandlerIF::NO_COMMAND;
return DeviceHandlerIF::NO_COMMAND_ID;
}
void DeviceHandlerBase::setNormalDatapoolEntriesInvalid() {

View File

@ -575,8 +575,6 @@ protected:
static const ReturnValue_t CHILD_TIMEOUT = MAKE_RETURN_CODE(0xE0);
static const ReturnValue_t SWITCH_FAILED = MAKE_RETURN_CODE(0xE1);
static const DeviceCommandId_t RAW_COMMAND_ID = -1;
static const DeviceCommandId_t NO_COMMAND_ID = -2;
static const MessageQueueId_t NO_COMMANDER = 0;
/** Pointer to the raw packet that will be sent.*/

View File

@ -22,7 +22,8 @@ using DeviceCommandId_t = uint32_t;
*/
class DeviceHandlerIF {
public:
static constexpr DeviceCommandId_t NO_COMMAND = -1;
static const DeviceCommandId_t RAW_COMMAND_ID = -1;
static const DeviceCommandId_t NO_COMMAND_ID = -2;
static constexpr uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20;
static constexpr uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10;