Skip to content

Commit 1d801a8

Browse files
authored
Merge pull request #105 from c-jimenez/dev/localcontroller
[localcontroller] Triggers a request timeout when a request cannot be forwarded to the Central System or to the Charge Point
2 parents 0948167 + 231f6db commit 1d801a8

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
"arguments": "-r",
2323
"valuesFormatting": "parseText"
2424
},
25+
{
26+
"type": "gdb",
27+
"request": "launch",
28+
"name": "x86 LC debug",
29+
"target": "${workspaceRoot}/bin/gcc_native/quick_start_localcontroller",
30+
"cwd": "${workspaceRoot}/bin/gcc_native/",
31+
"arguments": "-r",
32+
"valuesFormatting": "parseText"
33+
},
2534
{
2635
"type": "gdb",
2736
"request": "launch",

.vscode/tasks.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7-
"label": "build GCC native",
7+
"label": "build GCC",
88
"type": "shell",
99
"command": "make",
1010
"args": [
11-
"gcc-native",
11+
"gcc",
1212
"BUILD_TYPE=Debug"
1313
],
1414
"problemMatcher": "$gcc",
@@ -18,20 +18,20 @@
1818
}
1919
},
2020
{
21-
"label": "tests GCC native",
21+
"label": "tests GCC",
2222
"type": "shell",
2323
"command": "make",
2424
"args": [
25-
"tests-gcc-native"
25+
"tests-gcc"
2626
],
2727
"group": "build"
2828
},
2929
{
30-
"label": "clean GCC native",
30+
"label": "clean GCC",
3131
"type": "shell",
3232
"command": "make",
3333
"args": [
34-
"clean-gcc-native",
34+
"clean-gcc",
3535
"BUILD_TYPE=Debug"
3636
],
3737
"group": "build"

src/localcontroller/centralsystem/CentralSystemHandler.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ class CentralSystemHandler
415415
if (cs_error.empty())
416416
{
417417
LOG_WARNING << "[" << m_identifier << "] - Unable to forward [" << action << "] request";
418-
error = ocpp::rpc::IRpc::RPC_ERROR_INTERNAL;
419418
}
420419
else
421420
{
@@ -428,7 +427,6 @@ class CentralSystemHandler
428427
else
429428
{
430429
LOG_WARNING << "[" << m_identifier << "] - Unable to forward [" << action << "] request";
431-
error = ocpp::rpc::IRpc::RPC_ERROR_INTERNAL;
432430
}
433431

434432
return ret;

src/localcontroller/centralsystem/CentralSystemProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void CentralSystemProxy::rcpMessageReceived(const std::string& msg)
563563
/** @copydoc void IRpc::ISpy::rcpMessageSent(const std::string& msg) */
564564
void CentralSystemProxy::rcpMessageSent(const std::string& msg)
565565
{
566-
LOG_COM << "[" << m_identifier << "] - RX : " << msg;
566+
LOG_COM << "[" << m_identifier << "] - TX : " << msg;
567567
}
568568

569569
// RpcClient::IListener interface

src/localcontroller/chargepoint/ChargePointHandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ class ChargePointHandler
266266
if (cs_error.empty())
267267
{
268268
LOG_WARNING << "[" << m_identifier << "] - Unable to forward [" << action << "] request";
269-
error = ocpp::rpc::IRpc::RPC_ERROR_INTERNAL;
270269
}
271270
else
272271
{

src/messages/SendLocalList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool SendLocalListReqConverter::fromJson(const rapidjson::Value& json,
4646
{
4747
bool ret = true;
4848
extract(json, "listVersion", data.listVersion);
49-
if (json.HasMember(""))
49+
if (json.HasMember("localAuthorizationList"))
5050
{
5151
AuthorizationDataConverter authorization_data_converter;
5252
std::vector<AuthorizationData>& local_authorization_list = data.localAuthorizationList;

src/rpc/RpcBase.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,10 @@ void RpcBase::rxThread()
415415
else
416416
{
417417
// Error
418-
if (error_code.empty())
418+
if (!error_code.empty())
419419
{
420-
error_code = RPC_ERROR_GENERIC;
420+
sendCallError(rpc_message->unique_id, error_code.c_str(), error);
421421
}
422-
sendCallError(rpc_message->unique_id, error_code.c_str(), error);
423422
}
424423

425424
// Free resources

0 commit comments

Comments
 (0)