Skip to content

Commit bb15a2e

Browse files
committed
WIP
1 parent 2195ed1 commit bb15a2e

5 files changed

Lines changed: 62 additions & 56 deletions

File tree

sources/plugins/EnOcean/message/LearnMode.h

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,56 @@
55

66
namespace message
77
{
8-
enum class LearnMode
9-
{
10-
SimpleLearnMode,
11-
AdvancedLearnMode,
12-
AdvancedLearnModeSelectRepeater,
13-
};
8+
enum class LearnMode
9+
{
10+
SimpleLearnMode,
11+
AdvancedLearnMode,
12+
AdvancedLearnModeSelectRepeater,
13+
};
1414

15-
static std::string ToString(LearnMode learnMode)
16-
{
17-
switch (learnMode)
18-
{
19-
case LearnMode::SimpleLearnMode:
20-
return "Simple";
21-
case LearnMode::AdvancedLearnMode:
22-
return "Advanced";
23-
case LearnMode::AdvancedLearnModeSelectRepeater:
24-
return "Advanced, select repeater";
25-
default: // NOLINT(clang-diagnostic-covered-switch-default)
26-
return "Unknown";
27-
}
28-
}
15+
static std::string ToString(LearnMode learnMode)
16+
{
17+
switch (learnMode)
18+
{
19+
case LearnMode::SimpleLearnMode:
20+
return "Simple";
21+
case LearnMode::AdvancedLearnMode:
22+
return "Advanced";
23+
case LearnMode::AdvancedLearnModeSelectRepeater:
24+
return "Advanced, select repeater";
25+
default: // NOLINT(clang-diagnostic-covered-switch-default)
26+
return "Unknown";
27+
}
28+
}
2929

30-
static unsigned char ToProtocolValue(const LearnMode learnMode)
31-
{
32-
switch (learnMode)
33-
{
34-
case LearnMode::SimpleLearnMode:
35-
return 0;
36-
case LearnMode::AdvancedLearnMode:
37-
return 1;
38-
case LearnMode::AdvancedLearnModeSelectRepeater:
39-
return 2;
40-
default: // NOLINT(clang-diagnostic-covered-switch-default)
41-
throw std::invalid_argument("LeanMode invalid value"); // NOLINT(clang-diagnostic-covered-switch-default)
42-
}
43-
}
30+
static unsigned char ToProtocolValue(const LearnMode learnMode)
31+
{
32+
switch (learnMode)
33+
{
34+
case LearnMode::SimpleLearnMode:
35+
return 0;
36+
case LearnMode::AdvancedLearnMode:
37+
return 1;
38+
case LearnMode::AdvancedLearnModeSelectRepeater:
39+
return 2;
40+
default: // NOLINT(clang-diagnostic-covered-switch-default)
41+
throw std::invalid_argument("LeanMode invalid value"); // NOLINT(clang-diagnostic-covered-switch-default)
42+
}
43+
}
4444

45-
static LearnMode ToLearnMode(const unsigned char protocolValue)
46-
{
47-
switch (protocolValue)
48-
{
49-
case 0:
50-
return LearnMode::SimpleLearnMode;
51-
case 1:
52-
return LearnMode::AdvancedLearnMode;
53-
case 2:
54-
return LearnMode::AdvancedLearnModeSelectRepeater;
55-
default:
56-
YADOMS_LOG(error) << boost::format("Smart Ack response : unsupported LearnModeExtended value %1%") % protocolValue;
57-
return LearnMode::SimpleLearnMode;
58-
}
59-
}
45+
static LearnMode ToLearnMode(const unsigned char protocolValue)
46+
{
47+
switch (protocolValue)
48+
{
49+
case 0:
50+
return LearnMode::SimpleLearnMode;
51+
case 1:
52+
return LearnMode::AdvancedLearnMode;
53+
case 2:
54+
return LearnMode::AdvancedLearnModeSelectRepeater;
55+
default:
56+
YADOMS_LOG(error) << "Smart Ack response : unsupported LearnModeExtended value " << static_cast<int>(protocolValue);
57+
return LearnMode::SimpleLearnMode;
58+
}
59+
}
6060
} // namespace message

sources/plugins/EnOcean/message/MessageHelpers.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ namespace message
4242
{
4343
answer = std::move(esp3Packet);
4444
}))
45-
throw std::runtime_error(
46-
(boost::format("Fail to send message to %1% : no answer to \"%2%\"") % message.destinationId() % messageName).str());
45+
throw std::runtime_error(std::string("Fail to send message to ")
46+
+ message.destinationId()
47+
+ " : no answer to \""
48+
+ messageName
49+
+ "\"");
4750

4851
if (const auto response = boost::make_shared<response::CReceivedMessage>(answer);
4952
response->returnCode() != response::CReceivedMessage::RET_OK)

sources/plugins/EnOcean/message/RequestDongleVersionCommand.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ namespace message
5555

5656
static constexpr auto ExpectedDataSize = 33u;
5757
if (answer->header().dataLength() != ExpectedDataSize)
58-
throw CProtocolException(
59-
(boost::format("Invalid data length %1%, expected %2%")
60-
% answer->header().dataLength()
61-
% ExpectedDataSize).str());
58+
throw CProtocolException(std::string("Invalid data length ")
59+
+ std::to_string(answer->header().dataLength())
60+
+ ", expected "
61+
+ std::to_string(ExpectedDataSize));
6262

6363
processAnswer(response::CReceivedMessage(answer),
6464
"CO_RD_VERSION");

sources/server/pluginSystem/Factory.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#pragma once
22
#include "IFactory.h"
33
#include "InstanceStateHandler.h"
4+
#include <shared/ILocation.h>
45
#include <shared/process/IProcess.h>
56
#include <shared/process/ICommandLine.h>
67
#include <shared/process/IExternalProcessLogger.h>
8+
#include <shared/versioning/SemVer.h>
9+
#include "IPathProvider.h"
710
#include "IIpcAdapter.h"
811
#include <IPathProvider.h>
912
#include "yPluginApiImplementation.h"

sources/server/pluginSystem/internalPlugin/Information.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace pluginSystem
2020
const shared::versioning::CSemVer& getVersion() const override;
2121
const std::string& getAuthor() const override;
2222
const std::string& getUrl() const override;
23-
std::string toString() const override;
2423
std::string getIdentity() const override;
24+
std::string toString() const override;
2525
bool isSupportedOnThisPlatform() const override;
2626
bool getSupportManuallyCreatedDevice() const override;
2727
bool getSupportDeviceRemovedNotification() const override;

0 commit comments

Comments
 (0)