forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecurity.cpp
More file actions
58 lines (41 loc) · 1.45 KB
/
Security.cpp
File metadata and controls
58 lines (41 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// matth-x/MicroOcpp
// Copyright Matthias Akstaller 2019 - 2024
// MIT License
#include <MicroOcpp/Version.h>
#if MO_ENABLE_V201
#include <MicroOcpp.h>
#include <MicroOcpp/Core/Connection.h>
#include <MicroOcpp/Core/Context.h>
#include <MicroOcpp/Core/Request.h>
#include <MicroOcpp/Model/Model.h>
#include <MicroOcpp/Model/Transactions/TransactionService.h>
#include <MicroOcpp/Operations/CustomOperation.h>
#include <MicroOcpp/Operations/SecurityEventNotification.h>
#include <MicroOcpp/Debug.h>
#include <catch2/catch.hpp>
#include "./helpers/testHelper.h"
#define BASE_TIME "2023-01-01T00:00:00.000Z"
using namespace MicroOcpp;
TEST_CASE( "Security" ) {
printf("\nRun %s\n", "Security");
mocpp_set_timer(custom_timer_cb);
//initialize Context with dummy socket
LoopbackConnection loopback;
auto filesystem = makeDefaultFilesystemAdapter(FilesystemOpt::Use_Mount_FormatOnFail);
mocpp_initialize(loopback,
ChargerCredentials(),
filesystem,
false,
ProtocolVersion(2,0,1));
SECTION("Manual SecurityEventNotification") {
loop();
MO_MEM_RESET();
getOcppContext()->initiateRequest(makeRequest(new Ocpp201::SecurityEventNotification(
"ReconfigurationOfSecurityParameters",
getOcppContext()->getModel().getClock().now())));
loop();
MO_MEM_PRINT_STATS();
}
mocpp_deinitialize();
}
#endif // MO_ENABLE_V201