From 960f3cf3689d21fd8c55da9e15c757b89861fd2f Mon Sep 17 00:00:00 2001 From: Github Service Account Date: Mon, 9 Dec 2024 13:29:12 +0000 Subject: [PATCH] Deploy new artifact: EVerest/libiso15118/12236600792/coverage-report --- ....cpp.a04041b57da6517d3b8b75b084ce18bb.html | 2205 ++++++++++++ ....cpp.27cbdfd04885721c77e3a9b5950d3470.html | 1051 ++++++ ....cpp.09f54039a78815b3c1e09f44d1cd23fa.html | 533 +++ ....cpp.23d59e8f0ca18d37af38b79aa9025dc9.html | 1098 ++++++ ....cpp.9612701f6a3e9fd37cda169e446c9393.html | 945 ++++++ ....cpp.d20df6b19add57685839123faa40cf00.html | 657 ++++ ....cpp.886c2dd259355f8afbda35c0afbb15ca.html | 222 ++ ....hpp.ef7fd8eb7ebe1da1cb35a2d6b89b2664.html | 778 +++++ ....cpp.4891eea45fd542f0e0f6dd7bc0e2bc1c.html | 1357 ++++++++ ....cpp.ebe0eced5db2be04723fa992faf48aec.html | 851 +++++ ....hpp.9cc455081a7ae3d917bf24cf27ed1ad4.html | 368 ++ ....cpp.9d9029180aaf032b87b8ae43a0db7c9f.html | 2482 ++++++++++++++ ....cpp.59684de05b18f7546aa963894385cc14.html | 1309 ++++++++ ....cpp.1dff5e6d0fddfed7f05f09ce50cb3617.html | 642 ++++ ....hpp.737ec5dc795108ccd72ca1aeba3102c8.html | 829 +++++ ....cpp.a6deda03a80df1dbd594e14f8adc581a.html | 812 +++++ ....hpp.68a4e1da65347a1b95edf13900cde800.html | 284 ++ ....hpp.307983a6ca397fbd15e6aae52daf0d24.html | 524 +++ ....cpp.21d1a92646e91b9088051013ee431c4d.html | 285 ++ .../12236600792/coverage-report/index.css | 620 ++++ ....cpp.4075e2e30d85444ccf61b19e881c5ff8.html | 792 +++++ ....cpp.f568fac84d18bec691ede92b6c94a36c.html | 435 +++ ....cpp.7b5387df383c056c19ab7b8b140bea74.html | 2192 ++++++++++++ ....cpp.ca2976ccf99c866876af27e0ebc46805.html | 2240 +++++++++++++ ....cpp.29560e38cc17c256e5fee4d3e5264db6.html | 1256 +++++++ ....cpp.6240861adfbe13cf74b75bfb61940024.html | 1100 ++++++ ....cpp.2361f3fdeaa3b1ea5cf5b3e7dd93375c.html | 722 ++++ ....cpp.9e46c5c49e83e576b8a1cb6b5a0aff91.html | 470 +++ ....cpp.c2431b7c857e9785e7a41b24cca25797.html | 666 ++++ ....cpp.e9ca4c4ce86ce3c1e99636800506f51f.html | 456 +++ ....cpp.9d0826502c3fd46afe84f9211e112c1a.html | 407 +++ ....cpp.4a265c70ba8c7b2922596d16b6e19f5c.html | 172 + .../coverage-report/index.functions.html | 659 ++++ ....cpp.17ed95eb78fe6481b69603a77247f5cc.html | 243 ++ ....hpp.71e61f5fe360e6a860e459e45116142f.html | 474 +++ ....cpp.33d422763233065894d4a335938eeef8.html | 307 ++ .../12236600792/coverage-report/index.html | 1165 +++++++ ....cpp.545732d18aceadd3ee4cd2e5d9b55998.html | 1779 ++++++++++ ....hpp.72a55b758a74723885ffb706ed2dd19e.html | 592 ++++ ....cpp.e18c737deda2f2ae5bf9a8c919c4548e.html | 535 +++ ....cpp.7dfc9361f01f79722522cabaaf3943af.html | 847 +++++ ....cpp.8895b00de5fe708b61fc6595820a77f2.html | 716 ++++ ....cpp.9623e1bbf468167f371343559e90db4d.html | 838 +++++ ....cpp.a8f39bba8e297c8edb55d1042988bb8f.html | 813 +++++ ....cpp.0094768003b242296011c986d1ab79e0.html | 1414 ++++++++ ....cpp.7e536b3b516e04cfd0d1689e4d094dc4.html | 2980 +++++++++++++++++ ....cpp.66409cde6ff3c9c53bdd20c4a115c795.html | 574 ++++ ....hpp.4a2d799666e9e5f6a5b671fb71e627b1.html | 617 ++++ ....cpp.50d67d7ac694fdd49ba893a76940bcd9.html | 1950 +++++++++++ ....hpp.784e270a91c2a20ac4c3a06e6507cc0c.html | 532 +++ ....cpp.03c0f56c4688729b60ff8893e5d34c8f.html | 1803 ++++++++++ ....cpp.bfd3425545a2c3cb75477d0d910e258f.html | 1321 ++++++++ ....cpp.764b98bff39ccb44191e7876cd816174.html | 638 ++++ ....cpp.d1968dcbeb5c6889be60d69278a7b64c.html | 1200 +++++++ ....cpp.4497fb73fdde99ee31cebb93f89880a5.html | 554 +++ ....cpp.a706e45f633032e0c5e83aed31b41fc0.html | 1179 +++++++ ....cpp.9632d6c8410e7ed1dda8e96b4e0c804e.html | 1416 ++++++++ ....hpp.965312f541611d2c59c62940edd7b84e.html | 918 +++++ ....cpp.a9b0b9ecd6120cd5aefbfa1852c2ad67.html | 493 +++ ....cpp.d64c55f2c033bd841d1e6911ad5297f8.html | 708 ++++ ....cpp.2452f54117a25a4c8891f2611dc56828.html | 638 ++++ ....cpp.8196559bab5822c197b34c98bed0da2e.html | 491 +++ ....cpp.f87f24b157efa97e663d931e63eb07a6.html | 1015 ++++++ ....cpp.5c75155236c2e51a5114968661fc18a2.html | 846 +++++ ....cpp.7848f76a2421b621882ce18640c2e40c.html | 636 ++++ ....cpp.ecc5dc16823604dadcf1869a4c0aa05b.html | 1019 ++++++ ....hpp.e783a5e80684898da96ecf49cd2bfb9f.html | 321 ++ ....cpp.b7f9fafab74266b0574c9458017b27e7.html | 1523 +++++++++ ....hpp.6e7c8f2f1c408f519398bf8d6f4bf466.html | 483 +++ ....hpp.205801925e6960dacea5c02b3ab543c7.html | 401 +++ 70 files changed, 63398 insertions(+) create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_loop.cpp.a04041b57da6517d3b8b75b084ce18bb.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_parameter_discovery.cpp.27cbdfd04885721c77e3a9b5950d3470.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.09f54039a78815b3c1e09f44d1cd23fa.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.23d59e8f0ca18d37af38b79aa9025dc9.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.9612701f6a3e9fd37cda169e446c9393.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.d20df6b19add57685839123faa40cf00.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.cpp.886c2dd259355f8afbda35c0afbb15ca.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.hpp.ef7fd8eb7ebe1da1cb35a2d6b89b2664.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.common_types.cpp.4891eea45fd542f0e0f6dd7bc0e2bc1c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.config.cpp.ebe0eced5db2be04723fa992faf48aec.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_abstract.hpp.9cc455081a7ae3d917bf24cf27ed1ad4.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_openssl.cpp.9d9029180aaf032b87b8ae43a0db7c9f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_plain.cpp.59684de05b18f7546aa963894385cc14.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.cpp.1dff5e6d0fddfed7f05f09ce50cb3617.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.hpp.737ec5dc795108ccd72ca1aeba3102c8.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.cpp.a6deda03a80df1dbd594e14f8adc581a.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.hpp.68a4e1da65347a1b95edf13900cde800.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event.hpp.307983a6ca397fbd15e6aae52daf0d24.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event_queue.cpp.21d1a92646e91b9088051013ee431c4d.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.css create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.4075e2e30d85444ccf61b19e881c5ff8.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.f568fac84d18bec691ede92b6c94a36c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.7b5387df383c056c19ab7b8b140bea74.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.ca2976ccf99c866876af27e0ebc46805.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.29560e38cc17c256e5fee4d3e5264db6.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.6240861adfbe13cf74b75bfb61940024.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.2361f3fdeaa3b1ea5cf5b3e7dd93375c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.9e46c5c49e83e576b8a1cb6b5a0aff91.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.c2431b7c857e9785e7a41b24cca25797.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.e9ca4c4ce86ce3c1e99636800506f51f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.feedback.cpp.9d0826502c3fd46afe84f9211e112c1a.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.fsm.cpp.4a265c70ba8c7b2922596d16b6e19f5c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.functions.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.cpp.17ed95eb78fe6481b69603a77247f5cc.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.hpp.71e61f5fe360e6a860e459e45116142f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper_openssl.cpp.33d422763233065894d4a335938eeef8.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.cpp.545732d18aceadd3ee4cd2e5d9b55998.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.hpp.72a55b758a74723885ffb706ed2dd19e.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logger.cpp.e18c737deda2f2ae5bf9a8c919c4548e.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logging.cpp.7dfc9361f01f79722522cabaaf3943af.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.poll_manager.cpp.8895b00de5fe708b61fc6595820a77f2.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.9623e1bbf468167f371343559e90db4d.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.a8f39bba8e297c8edb55d1042988bb8f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.0094768003b242296011c986d1ab79e0.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.7e536b3b516e04cfd0d1689e4d094dc4.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.cpp.66409cde6ff3c9c53bdd20c4a115c795.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.hpp.4a2d799666e9e5f6a5b671fb71e627b1.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.cpp.50d67d7ac694fdd49ba893a76940bcd9.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.hpp.784e270a91c2a20ac4c3a06e6507cc0c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.03c0f56c4688729b60ff8893e5d34c8f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.bfd3425545a2c3cb75477d0d910e258f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.764b98bff39ccb44191e7876cd816174.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.d1968dcbeb5c6889be60d69278a7b64c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.4497fb73fdde99ee31cebb93f89880a5.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.a706e45f633032e0c5e83aed31b41fc0.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.cpp.9632d6c8410e7ed1dda8e96b4e0c804e.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.hpp.965312f541611d2c59c62940edd7b84e.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.a9b0b9ecd6120cd5aefbfa1852c2ad67.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.d64c55f2c033bd841d1e6911ad5297f8.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.2452f54117a25a4c8891f2611dc56828.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.8196559bab5822c197b34c98bed0da2e.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.socket_helper.cpp.f87f24b157efa97e663d931e63eb07a6.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.5c75155236c2e51a5114968661fc18a2.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.7848f76a2421b621882ce18640c2e40c.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.tbd_controller.cpp.ecc5dc16823604dadcf1869a4c0aa05b.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.time.hpp.e783a5e80684898da96ecf49cd2bfb9f.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.cpp.b7f9fafab74266b0574c9458017b27e7.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.hpp.6e7c8f2f1c408f519398bf8d6f4bf466.html create mode 100644 docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant_access.hpp.205801925e6960dacea5c02b3ab543c7.html diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_loop.cpp.a04041b57da6517d3b8b75b084ce18bb.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_loop.cpp.a04041b57da6517d3b8b75b084ce18bb.html new file mode 100644 index 000000000..fdb1b870e --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_loop.cpp.a04041b57da6517d3b8b75b084ce18bb.html @@ -0,0 +1,2205 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/ac_charge_loop.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:01920.0%
Functions:0320.0%
Branches:01720.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2024 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/ac_charge_loop.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_AC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_AC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + template <> void convert(const struct iso20_ac_DisplayParametersType& in, datatypes::DisplayParameters& out) {
15 +
16 + CB2CPP_ASSIGN_IF_USED(in.PresentSOC, out.present_soc);
17 + CB2CPP_ASSIGN_IF_USED(in.MinimumSOC, out.min_soc);
18 + CB2CPP_ASSIGN_IF_USED(in.TargetSOC, out.target_soc);
19 + CB2CPP_ASSIGN_IF_USED(in.MaximumSOC, out.max_soc);
20 +
21 + CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToMinimumSOC, out.remaining_time_to_min_soc);
22 + CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToTargetSOC, out.remaining_time_to_target_soc);
23 + CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToMaximumSOC, out.remaining_time_to_max_soc);
24 +
25 + CB2CPP_ASSIGN_IF_USED(in.ChargingComplete, out.charging_complete);
26 + CB2CPP_CONVERT_IF_USED(in.BatteryEnergyCapacity, out.battery_energy_capacity);
27 + CB2CPP_ASSIGN_IF_USED(in.InletHot, out.inlet_hot);
28 + }
29 +
30 + // Todo(sl): this should go to common.cpp
31 + template <typename InType> void convert(const InType& in, datatypes::Scheduled_CLReqControlMode& out) {
32 + CB2CPP_CONVERT_IF_USED(in.EVTargetEnergyRequest, out.target_energy_request);
33 + CB2CPP_CONVERT_IF_USED(in.EVMaximumEnergyRequest, out.max_energy_request);
34 + CB2CPP_CONVERT_IF_USED(in.EVMinimumEnergyRequest, out.min_energy_request);
35 + }
36 +
37 + template <typename InType> void convert(const InType& in, datatypes::Scheduled_AC_CLReqControlMode& out) {
38 + static_assert(std::is_same_v<InType, iso20_ac_Scheduled_AC_CLReqControlModeType> or
39 + std::is_same_v<InType, iso20_ac_BPT_Scheduled_AC_CLReqControlModeType>);
40 + convert(in, static_cast<datatypes::Scheduled_CLReqControlMode&>(out));
41 +
42 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower, out.max_charge_power);
43 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L2, out.max_charge_power_L2);
44 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L3, out.max_charge_power_L3);
45 +
46 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower, out.min_charge_power);
47 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L2, out.min_charge_power_L2);
48 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L3, out.min_charge_power_L3);
49 +
50 + convert(in.EVPresentActivePower, out.present_active_power);
51 + CB2CPP_CONVERT_IF_USED(in.EVPresentActivePower_L2, out.present_active_power_L2);
52 + CB2CPP_CONVERT_IF_USED(in.EVPresentActivePower_L3, out.present_active_power_L3);
53 +
54 + CB2CPP_CONVERT_IF_USED(in.EVPresentReactivePower, out.present_reactive_power);
55 + CB2CPP_CONVERT_IF_USED(in.EVPresentReactivePower_L2, out.present_reactive_power_L2);
56 + CB2CPP_CONVERT_IF_USED(in.EVPresentReactivePower_L3, out.present_reactive_power_L3);
57 + }
58 +
59 + template <>
60 + void convert(const struct iso20_ac_BPT_Scheduled_AC_CLReqControlModeType& in,
61 + datatypes::BPT_Scheduled_AC_CLReqControlMode& out) {
62 + convert(in, static_cast<datatypes::Scheduled_AC_CLReqControlMode&>(out));
63 +
64 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower, out.max_discharge_power);
65 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L2, out.max_discharge_power_L2);
66 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L3, out.max_discharge_power_L3);
67 +
68 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower, out.min_discharge_power);
69 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L2, out.min_discharge_power_L2);
70 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L3, out.min_discharge_power_L3);
71 + }
72 +
73 + // Todo(sl): this should go to common.cpp
74 + template <typename InType> void convert(const InType& in, datatypes::Dynamic_CLReqControlMode& out) {
75 + CB2CPP_ASSIGN_IF_USED(in.DepartureTime, out.departure_time);
76 + convert(in.EVTargetEnergyRequest, out.target_energy_request);
77 + convert(in.EVMaximumEnergyRequest, out.max_energy_request);
78 + convert(in.EVMinimumEnergyRequest, out.min_energy_request);
79 + }
80 +
81 + template <typename InType> void convert(const InType& in, datatypes::Dynamic_AC_CLReqControlMode& out) {
82 + static_assert(std::is_same_v<InType, iso20_ac_Dynamic_AC_CLReqControlModeType> or
83 + std::is_same_v<InType, iso20_ac_BPT_Dynamic_AC_CLReqControlModeType>);
84 + convert(in, static_cast<datatypes::Dynamic_CLReqControlMode&>(out));
85 +
86 + convert(in.EVMaximumChargePower, out.max_charge_power);
87 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L2, out.max_charge_power_L2);
88 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L3, out.max_charge_power_L3);
89 +
90 + convert(in.EVMinimumChargePower, out.min_charge_power);
91 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L2, out.min_charge_power_L2);
92 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L3, out.min_charge_power_L3);
93 +
94 + convert(in.EVPresentActivePower, out.present_active_power);
95 + CB2CPP_CONVERT_IF_USED(in.EVPresentActivePower_L2, out.present_active_power_L2);
96 + CB2CPP_CONVERT_IF_USED(in.EVPresentActivePower_L3, out.present_active_power_L3);
97 +
98 + convert(in.EVPresentReactivePower, out.present_reactive_power);
99 + CB2CPP_CONVERT_IF_USED(in.EVPresentReactivePower_L2, out.present_reactive_power_L2);
100 + CB2CPP_CONVERT_IF_USED(in.EVPresentReactivePower_L3, out.present_reactive_power_L3);
101 + }
102 +
103 + template <>
104 + void convert(const struct iso20_ac_BPT_Dynamic_AC_CLReqControlModeType& in,
105 + datatypes::BPT_Dynamic_AC_CLReqControlMode& out) {
106 + convert(in, static_cast<datatypes::Dynamic_AC_CLReqControlMode&>(out));
107 +
108 + convert(in.EVMaximumDischargePower, out.max_discharge_power);
109 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L2, out.max_discharge_power_L2);
110 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L3, out.max_discharge_power_L3);
111 +
112 + convert(in.EVMinimumDischargePower, out.min_discharge_power);
113 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L2, out.min_discharge_power_L2);
114 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L3, out.min_discharge_power_L3);
115 +
116 + CB2CPP_CONVERT_IF_USED(in.EVMaximumV2XEnergyRequest, out.max_v2x_energy_request);
117 + CB2CPP_CONVERT_IF_USED(in.EVMinimumV2XEnergyRequest, out.min_v2x_energy_request);
118 + }
119 +
120 + template <> void convert(const struct iso20_ac_AC_ChargeLoopReqType& in, AC_ChargeLoopRequest& out) {
121 + convert(in.Header, out.header);
122 +
123 + CB2CPP_CONVERT_IF_USED(in.DisplayParameters, out.display_parameters);
124 +
125 + out.meter_info_requested = in.MeterInfoRequested;
126 +
127 + if (in.Scheduled_AC_CLReqControlMode_isUsed) {
128 + convert(in.Scheduled_AC_CLReqControlMode, out.control_mode.emplace<datatypes::Scheduled_AC_CLReqControlMode>());
129 + } else if (in.BPT_Scheduled_AC_CLReqControlMode_isUsed) {
130 + convert(in.BPT_Scheduled_AC_CLReqControlMode,
131 + out.control_mode.emplace<datatypes::BPT_Scheduled_AC_CLReqControlMode>());
132 + } else if (in.Dynamic_AC_CLReqControlMode_isUsed) {
133 + convert(in.Dynamic_AC_CLReqControlMode, out.control_mode.emplace<datatypes::Dynamic_AC_CLReqControlMode>());
134 + } else if (in.BPT_Dynamic_AC_CLReqControlMode_isUsed) {
135 + convert(in.BPT_Dynamic_AC_CLReqControlMode,
136 + out.control_mode.emplace<datatypes::BPT_Dynamic_AC_CLReqControlMode>());
137 + } else {
138 + // should not happen
139 + assert(false);
140 + }
141 + }
142 +
143 + template <> void insert_type(VariantAccess& va, const struct iso20_ac_AC_ChargeLoopReqType& in) {
144 + va.insert_type<AC_ChargeLoopRequest>(in);
145 + }
146 +
147 + template <> void convert(const datatypes::DetailedCost& in, struct iso20_ac_DetailedCostType& out) {
148 + init_iso20_ac_DetailedCostType(&out);
149 + convert(in.amount, out.Amount);
150 + convert(in.cost_per_unit, out.CostPerUnit);
151 + }
152 +
153 + template <> void convert(const datatypes::DetailedTax& in, struct iso20_ac_DetailedTaxType& out) {
154 + init_iso20_ac_DetailedTaxType(&out);
155 + out.TaxRuleID = in.tax_rule_id;
156 + convert(in.amount, out.Amount);
157 + }
158 +
159 + template <> void convert(const datatypes::Receipt& in, struct iso20_ac_ReceiptType& out) {
160 + init_iso20_ac_ReceiptType(&out);
161 +
162 + out.TimeAnchor = in.time_anchor;
163 + CPP2CB_CONVERT_IF_USED(in.energy_costs, out.EnergyCosts);
164 + CPP2CB_CONVERT_IF_USED(in.occupany_costs, out.OccupancyCosts);
165 + CPP2CB_CONVERT_IF_USED(in.additional_service_costs, out.AdditionalServicesCosts);
166 + CPP2CB_CONVERT_IF_USED(in.overstay_costs, out.OverstayCosts);
167 +
168 + if (sizeof(out.TaxCosts.array) < in.tax_costs.size()) {
169 + throw std::runtime_error("tax costs array is too large");
170 + }
171 + for (std::size_t i = 0; i < in.tax_costs.size(); ++i) {
172 + convert(in.tax_costs[i], out.TaxCosts.array[i]);
173 + }
174 + out.TaxCosts.arrayLen = in.tax_costs.size();
175 + }
176 +
177 + template <typename cb_Type> void convert(const datatypes::Scheduled_AC_CLResControlMode& in, cb_Type& out) {
178 + CPP2CB_CONVERT_IF_USED(in.target_active_power, out.EVSETargetActivePower);
179 + CPP2CB_CONVERT_IF_USED(in.target_active_power_L2, out.EVSETargetActivePower_L2);
180 + CPP2CB_CONVERT_IF_USED(in.target_active_power_L2, out.EVSETargetActivePower_L3);
181 +
182 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power, out.EVSETargetReactivePower);
183 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power_L2, out.EVSETargetReactivePower_L2);
184 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power_L2, out.EVSETargetReactivePower_L3);
185 +
186 + CPP2CB_CONVERT_IF_USED(in.present_active_power, out.EVSEPresentActivePower);
187 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L2, out.EVSEPresentActivePower_L2);
188 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L3, out.EVSEPresentActivePower_L3);
189 + }
190 +
191 + template <>
192 + void convert(const datatypes::BPT_Scheduled_AC_CLResControlMode& in,
193 + struct iso20_ac_BPT_Scheduled_AC_CLResControlModeType& out) {
194 + convert(static_cast<const datatypes::Scheduled_AC_CLResControlMode&>(in), out);
195 + }
196 +
197 + template <typename cb_Type> void convert(const datatypes::Dynamic_CLResControlMode& in, cb_Type& out) {
198 + CPP2CB_ASSIGN_IF_USED(in.departure_time, out.DepartureTime);
199 + CPP2CB_ASSIGN_IF_USED(in.minimum_soc, out.MinimumSOC);
200 + CPP2CB_ASSIGN_IF_USED(in.target_soc, out.TargetSOC);
201 + CPP2CB_ASSIGN_IF_USED(in.ack_max_delay, out.AckMaxDelay);
202 + }
203 +
204 + template <typename cb_Type> void convert(const datatypes::Dynamic_AC_CLResControlMode& in, cb_Type& out) {
205 + convert(static_cast<const datatypes::Dynamic_CLResControlMode&>(in), out);
206 +
207 + convert(in.target_active_power, out.EVSETargetActivePower);
208 + CPP2CB_CONVERT_IF_USED(in.target_active_power_L2, out.EVSETargetActivePower_L2);
209 + CPP2CB_CONVERT_IF_USED(in.target_active_power_L3, out.EVSETargetActivePower_L3);
210 +
211 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power, out.EVSETargetReactivePower);
212 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power_L2, out.EVSETargetReactivePower_L2);
213 + CPP2CB_CONVERT_IF_USED(in.target_reactive_power_L3, out.EVSETargetReactivePower_L3);
214 +
215 + CPP2CB_CONVERT_IF_USED(in.present_active_power, out.EVSEPresentActivePower);
216 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L2, out.EVSEPresentActivePower_L2);
217 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L3, out.EVSEPresentActivePower_L3);
218 + }
219 +
220 + template <>
221 + void convert(const datatypes::BPT_Dynamic_AC_CLResControlMode& in,
222 + struct iso20_ac_BPT_Dynamic_AC_CLResControlModeType& out) {
223 + convert(static_cast<const datatypes::Dynamic_AC_CLResControlMode&>(in), out);
224 + }
225 +
226 + struct ControlModeVisitor {
227 + using ScheduledCM = datatypes::Scheduled_AC_CLResControlMode;
228 + using BPT_ScheduledCM = datatypes::BPT_Scheduled_AC_CLResControlMode;
229 + using DynamicCM = datatypes::Dynamic_AC_CLResControlMode;
230 + using BPT_DynamicCM = datatypes::BPT_Dynamic_AC_CLResControlMode;
231 +
232 + ControlModeVisitor(iso20_ac_AC_ChargeLoopResType& res_) : res(res_){};
233 +
234 + void operator()(const ScheduledCM& in) {
235 + auto& out = res.Scheduled_AC_CLResControlMode;
236 + init_iso20_ac_Scheduled_AC_CLResControlModeType(&out);
237 + convert(in, out);
238 + CB_SET_USED(res.Scheduled_AC_CLResControlMode);
239 + }
240 +
241 + void operator()(const BPT_ScheduledCM& in) {
242 + auto& out = res.BPT_Scheduled_AC_CLResControlMode;
243 + init_iso20_ac_BPT_Scheduled_AC_CLResControlModeType(&out);
244 + convert(in, out);
245 + CB_SET_USED(res.BPT_Scheduled_AC_CLResControlMode);
246 + }
247 +
248 + void operator()(const DynamicCM& in) {
249 + auto& out = res.Dynamic_AC_CLResControlMode;
250 + init_iso20_ac_Dynamic_AC_CLResControlModeType(&out);
251 + convert(in, out);
252 + CB_SET_USED(res.Dynamic_AC_CLResControlMode);
253 + }
254 +
255 + void operator()(const BPT_DynamicCM& in) {
256 + auto& out = res.BPT_Dynamic_AC_CLResControlMode;
257 + init_iso20_ac_BPT_Dynamic_AC_CLResControlModeType(&out);
258 + convert(in, out);
259 + CB_SET_USED(res.BPT_Dynamic_AC_CLResControlMode);
260 + }
261 +
262 + private:
263 + iso20_ac_AC_ChargeLoopResType& res;
264 + };
265 +
266 + template <> void convert(const AC_ChargeLoopResponse& in, struct iso20_ac_AC_ChargeLoopResType& out) {
267 + init_iso20_ac_AC_ChargeLoopResType(&out);
268 +
269 + convert(in.header, out.Header);
270 + cb_convert_enum(in.response_code, out.ResponseCode);
271 +
272 + CPP2CB_CONVERT_IF_USED(in.status, out.EVSEStatus);
273 + CPP2CB_CONVERT_IF_USED(in.meter_info, out.MeterInfo);
274 + CPP2CB_CONVERT_IF_USED(in.receipt, out.Receipt);
275 +
276 + CPP2CB_CONVERT_IF_USED(in.target_frequency, out.EVSETargetFrequency);
277 +
278 + std::visit(ControlModeVisitor(out), in.control_mode);
279 + }
280 +
281 + template <> int serialize_to_exi(const AC_ChargeLoopResponse& in, exi_bitstream_t& out) {
282 + iso20_ac_exiDocument doc;
283 + init_iso20_ac_exiDocument(&doc);
284 +
285 + CB_SET_USED(doc.AC_ChargeLoopRes);
286 +
287 + convert(in, doc.AC_ChargeLoopRes);
288 +
289 + return encode_iso20_ac_exiDocument(&out, &doc);
290 + }
291 +
292 + template <> size_t serialize(const AC_ChargeLoopResponse& in, const io::StreamOutputView& out) {
293 + return serialize_helper(in, out);
294 + }
295 +
296 + } // namespace iso15118::message_20
297 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_parameter_discovery.cpp.27cbdfd04885721c77e3a9b5950d3470.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_parameter_discovery.cpp.27cbdfd04885721c77e3a9b5950d3470.html new file mode 100644 index 000000000..5e4a8aedb --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.ac_charge_parameter_discovery.cpp.27cbdfd04885721c77e3a9b5950d3470.html @@ -0,0 +1,1051 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/ac_charge_parameter_discovery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0790.0%
Functions:0120.0%
Branches:0620.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2024 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/ac_charge_parameter_discovery.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_AC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_AC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + using AC_ModeReq = datatypes::AC_CPDReqEnergyTransferMode;
15 + using BPT_AC_ModeReq = datatypes::BPT_AC_CPDReqEnergyTransferMode;
16 +
17 + using AC_ModeRes = datatypes::AC_CPDResEnergyTransferMode;
18 + using BPT_AC_ModeRes = datatypes::BPT_AC_CPDResEnergyTransferMode;
19 +
20 + template <> void convert(const struct iso20_ac_AC_CPDReqEnergyTransferModeType& in, AC_ModeReq& out) {
21 + convert(in.EVMaximumChargePower, out.max_charge_power);
22 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L2, out.max_charge_power_L2);
23 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L3, out.max_charge_power_L3);
24 + convert(in.EVMinimumChargePower, out.min_charge_power);
25 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L2, out.min_charge_power_L2);
26 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L3, out.min_charge_power_L3);
27 + }
28 +
29 + template <> void convert(const struct iso20_ac_BPT_AC_CPDReqEnergyTransferModeType& in, BPT_AC_ModeReq& out) {
30 + convert(in.EVMaximumChargePower, out.max_charge_power);
31 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L2, out.max_charge_power_L2);
32 + CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower_L3, out.max_charge_power_L3);
33 + convert(in.EVMinimumChargePower, out.min_charge_power);
34 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L2, out.min_charge_power_L2);
35 + CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower_L3, out.min_charge_power_L3);
36 +
37 + convert(in.EVMaximumDischargePower, out.max_discharge_power);
38 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L2, out.max_discharge_power_L2);
39 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower_L3, out.max_discharge_power_L3);
40 + convert(in.EVMinimumDischargePower, out.min_discharge_power);
41 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L2, out.min_discharge_power_L2);
42 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower_L3, out.min_discharge_power_L3);
43 + }
44 +
45 + template <>
46 + void convert(const struct iso20_ac_AC_ChargeParameterDiscoveryReqType& in, AC_ChargeParameterDiscoveryRequest& out) {
47 + convert(in.Header, out.header);
48 + if (in.AC_CPDReqEnergyTransferMode_isUsed) {
49 + auto& mode_out = out.transfer_mode.emplace<AC_ModeReq>();
50 + convert(in.AC_CPDReqEnergyTransferMode, mode_out);
51 + } else if (in.BPT_AC_CPDReqEnergyTransferMode_isUsed) {
52 + auto& mode_out = out.transfer_mode.emplace<BPT_AC_ModeReq>();
53 + convert(in.BPT_AC_CPDReqEnergyTransferMode, mode_out);
54 + }
55 + }
56 +
57 + template <> void insert_type(VariantAccess& va, const struct iso20_ac_AC_ChargeParameterDiscoveryReqType& in) {
58 + va.insert_type<AC_ChargeParameterDiscoveryRequest>(in);
59 + }
60 +
61 + struct ModeResponseVisitor {
62 + public:
63 + ModeResponseVisitor(iso20_ac_AC_ChargeParameterDiscoveryResType& res_) : res(res_){};
64 + void operator()(const AC_ModeRes& in) {
65 + init_iso20_ac_AC_CPDResEnergyTransferModeType(&res.AC_CPDResEnergyTransferMode);
66 +
67 + CB_SET_USED(res.AC_CPDResEnergyTransferMode);
68 + convert_common(in, res.AC_CPDResEnergyTransferMode);
69 + }
70 +
71 + void operator()(const BPT_AC_ModeRes& in) {
72 + init_iso20_ac_BPT_AC_CPDResEnergyTransferModeType(&res.BPT_AC_CPDResEnergyTransferMode);
73 +
74 + CB_SET_USED(res.BPT_AC_CPDResEnergyTransferMode);
75 +
76 + auto& out = res.BPT_AC_CPDResEnergyTransferMode;
77 + convert_common(in, out);
78 +
79 + convert(in.max_discharge_power, out.EVSEMaximumDischargePower);
80 + CPP2CB_CONVERT_IF_USED(in.max_charge_power_L2, out.EVSEMaximumDischargePower_L2);
81 + CPP2CB_CONVERT_IF_USED(in.max_charge_power_L3, out.EVSEMaximumDischargePower_L3);
82 +
83 + convert(in.min_discharge_power, out.EVSEMinimumDischargePower);
84 + CPP2CB_CONVERT_IF_USED(in.min_charge_power_L2, out.EVSEMinimumDischargePower_L2);
85 + CPP2CB_CONVERT_IF_USED(in.min_charge_power_L3, out.EVSEMinimumDischargePower_L3);
86 + }
87 +
88 + template <typename ModeResTypeIn, typename ModeResTypeOut>
89 + static void convert_common(const ModeResTypeIn& in, ModeResTypeOut& out) {
90 + convert(in.max_charge_power, out.EVSEMaximumChargePower);
91 + CPP2CB_CONVERT_IF_USED(in.max_charge_power_L2, out.EVSEMaximumChargePower_L2);
92 + CPP2CB_CONVERT_IF_USED(in.max_charge_power_L3, out.EVSEMaximumChargePower_L3);
93 + convert(in.min_charge_power, out.EVSEMinimumChargePower);
94 + CPP2CB_CONVERT_IF_USED(in.min_charge_power_L2, out.EVSEMinimumChargePower_L2);
95 + CPP2CB_CONVERT_IF_USED(in.min_charge_power_L3, out.EVSEMinimumChargePower_L3);
96 + convert(in.nominal_frequency, out.EVSENominalFrequency);
97 + CPP2CB_CONVERT_IF_USED(in.max_power_asymmetry, out.MaximumPowerAsymmetry);
98 + CPP2CB_CONVERT_IF_USED(in.power_ramp_limitation, out.EVSEPowerRampLimitation);
99 + CPP2CB_CONVERT_IF_USED(in.present_active_power, out.EVSEPresentActivePower);
100 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L2, out.EVSEPresentActivePower_L2);
101 + CPP2CB_CONVERT_IF_USED(in.present_active_power_L3, out.EVSEPresentActivePower_L3);
102 + }
103 +
104 + private:
105 + iso20_ac_AC_ChargeParameterDiscoveryResType& res;
106 + };
107 +
108 + template <>
109 + void convert(const AC_ChargeParameterDiscoveryResponse& in, struct iso20_ac_AC_ChargeParameterDiscoveryResType& out) {
110 +
111 + init_iso20_ac_AC_ChargeParameterDiscoveryResType(&out);
112 + convert(in.header, out.Header);
113 + cb_convert_enum(in.response_code, out.ResponseCode);
114 +
115 + std::visit(ModeResponseVisitor(out), in.transfer_mode);
116 + }
117 +
118 + template <> int serialize_to_exi(const AC_ChargeParameterDiscoveryResponse& in, exi_bitstream_t& out) {
119 + iso20_ac_exiDocument doc;
120 +
121 + init_iso20_ac_exiDocument(&doc);
122 +
123 + CB_SET_USED(doc.AC_ChargeParameterDiscoveryRes);
124 +
125 + convert(in, doc.AC_ChargeParameterDiscoveryRes);
126 +
127 + return encode_iso20_ac_exiDocument(&out, &doc);
128 + }
129 +
130 + template <> size_t serialize(const AC_ChargeParameterDiscoveryResponse& in, const io::StreamOutputView& out) {
131 + return serialize_helper(in, out);
132 + }
133 +
134 + } // namespace iso15118::message_20
135 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.09f54039a78815b3c1e09f44d1cd23fa.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.09f54039a78815b3c1e09f44d1cd23fa.html new file mode 100644 index 000000000..0ae28ae77 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.09f54039a78815b3c1e09f44d1cd23fa.html @@ -0,0 +1,533 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/authorization.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:222684.6%
Functions:55100.0%
Branches:41625.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/authorization.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + 2template <> void convert(const struct iso20_AuthorizationReqType& in, AuthorizationRequest& out) {
14 + 2 convert(in.Header, out.header);
15 +
16 + 2 out.selected_authorization_service = static_cast<datatypes::Authorization>(in.SelectedAuthorizationService);
17 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 if (in.EIM_AReqAuthorizationMode_isUsed) {
18 + 2 out.authorization_mode.emplace<datatypes::EIM_ASReqAuthorizationMode>();
19 + } else if (in.PnC_AReqAuthorizationMode_isUsed) {
20 +
21 + auto& pnc_out = out.authorization_mode.emplace<datatypes::PnC_ASReqAuthorizationMode>();
22 +
23 + pnc_out.id = CB2CPP_STRING(in.PnC_AReqAuthorizationMode.Id);
24 + CB2CPP_BYTES(in.PnC_AReqAuthorizationMode.GenChallenge, pnc_out.gen_challenge);
25 + // Todo(sl): Adding certificate
26 + }
27 + 2}
28 +
29 + 2template <> void convert(const AuthorizationResponse& in, iso20_AuthorizationResType& out) {
30 + 2 init_iso20_AuthorizationResType(&out);
31 +
32 + 2 out.ResponseCode = static_cast<iso20_responseCodeType>(in.response_code);
33 + 2 out.EVSEProcessing = static_cast<iso20_processingType>(in.evse_processing);
34 +
35 + 2 convert(in.header, out.Header);
36 + 2}
37 +
38 + 2template <> void insert_type(VariantAccess& va, const struct iso20_AuthorizationReqType& in) {
39 + 2 va.insert_type<AuthorizationRequest>(in);
40 + 2};
41 +
42 + 2template <> int serialize_to_exi(const AuthorizationResponse& in, exi_bitstream_t& out) {
43 + iso20_exiDocument doc;
44 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
45 +
46 + 2 CB_SET_USED(doc.AuthorizationRes);
47 +
48 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.AuthorizationRes);
49 +
50 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
51 + }
52 +
53 + 2template <> size_t serialize(const AuthorizationResponse& in, const io::StreamOutputView& out) {
54 + 2 return serialize_helper(in, out);
55 + }
56 +
57 + } // namespace iso15118::message_20
58 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.23d59e8f0ca18d37af38b79aa9025dc9.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.23d59e8f0ca18d37af38b79aa9025dc9.html new file mode 100644 index 000000000..9b9bed9ef --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization.cpp.23d59e8f0ca18d37af38b79aa9025dc9.html @@ -0,0 +1,1098 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/authorization.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:296942.0%
Functions:2450.0%
Branches:115819.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <algorithm>
4 +
5 + #include <iso15118/d20/state/authorization.hpp>
6 + #include <iso15118/d20/state/service_discovery.hpp>
7 +
8 + #include <iso15118/detail/d20/context_helper.hpp>
9 + #include <iso15118/detail/d20/state/authorization.hpp>
10 + #include <iso15118/detail/d20/state/session_stop.hpp>
11 +
12 + namespace iso15118::d20::state {
13 +
14 + namespace dt = message_20::datatypes;
15 +
16 + using AuthStatus = dt::AuthStatus;
17 +
18 + 8static bool find_auth_service_in_offered_services(const dt::Authorization& req_selected_auth_service,
19 + const d20::Session& session) {
20 + 8 auto& offered_auth_services = session.offered_services.auth_services;
21 +
+ 1/2 +
+
✓ Branch 3 taken 8 times.
+
✗ Branch 4 not taken.
+
+
+
8 return std::find(offered_auth_services.begin(), offered_auth_services.end(), req_selected_auth_service) !=
22 + 16 offered_auth_services.end();
23 + }
24 +
25 + 10message_20::AuthorizationResponse handle_request(const message_20::AuthorizationRequest& req,
26 + const d20::Session& session,
27 + const dt::AuthStatus& authorization_status) {
28 +
29 + 10 message_20::AuthorizationResponse res = message_20::AuthorizationResponse();
30 +
31 +
+ 3/4 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 8 times.
+
+
+
10 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
32 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
33 + }
34 +
35 + // [V2G20-2209] Check if authorization service was offered in authorization_setup res
36 +
+ 3/4 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 6 times.
+
+
+
8 if (not find_auth_service_in_offered_services(req.selected_authorization_service, session)) {
37 + 2 return response_with_code(
38 + 2 res, dt::ResponseCode::WARNING_AuthorizationSelectionInvalid); // [V2G20-2226] Handling if warning
39 + }
40 +
41 + 6 auto response_code = dt::ResponseCode::OK;
42 +
43 +
+ 1/3 +
+
✓ Branch 0 taken 6 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
+
+
6 switch (req.selected_authorization_service) {
44 + 6 case dt::Authorization::EIM:
45 +
+ 3/3 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
+
+
6 switch (authorization_status) {
46 + 2 case AuthStatus::Accepted:
47 + 2 res.evse_processing = dt::Processing::Finished;
48 + 2 response_code = dt::ResponseCode::OK;
49 + 2 break;
50 + 2 case AuthStatus::Rejected: // Failure [V2G20-2230]
51 + 2 res.evse_processing = dt::Processing::Finished;
52 + 2 response_code = dt::ResponseCode::WARNING_EIMAuthorizationFailure;
53 + 2 break;
54 + 2 case AuthStatus::Pending:
55 + default:
56 + 2 res.evse_processing = dt::Processing::Ongoing;
57 + 2 response_code = dt::ResponseCode::OK;
58 + 2 break;
59 + }
60 + 6 break;
61 +
62 + case dt::Authorization::PnC:
63 + // todo(SL): Handle PnC
64 + break;
65 +
66 + default:
67 + // todo(SL): Fill
68 + break;
69 + }
70 +
71 + 6 return response_with_code(res, response_code);
72 + }
73 +
74 + void Authorization::enter() {
75 + ctx.log.enter_state("Authorization");
76 + }
77 +
78 + FsmSimpleState::HandleEventReturnType Authorization::handle_event(AllocatorType& sa, FsmEvent ev) {
79 +
80 + if (ev == FsmEvent::CONTROL_MESSAGE) {
81 + const auto control_data = ctx.get_control_event<AuthorizationResponse>();
82 + if (not control_data) {
83 + // Ignore control message
84 + return sa.HANDLED_INTERNALLY;
85 + }
86 +
87 + if (*control_data) {
88 + authorization_status = AuthStatus::Accepted;
89 + } else {
90 + authorization_status = AuthStatus::Rejected;
91 + }
92 +
93 + return sa.HANDLED_INTERNALLY;
94 + }
95 +
96 + if (ev != FsmEvent::V2GTP_MESSAGE) {
97 + return sa.PASS_ON;
98 + }
99 +
100 + const auto variant = ctx.pull_request();
101 +
102 + if (const auto req = variant->get_if<message_20::AuthorizationRequest>()) {
103 + const auto res = handle_request(*req, ctx.session, authorization_status);
104 +
105 + ctx.respond(res);
106 +
107 + if (res.response_code >= dt::ResponseCode::FAILED) {
108 + ctx.session_stopped = true;
109 + return sa.PASS_ON;
110 + }
111 +
112 + if (authorization_status == AuthStatus::Accepted) {
113 + authorization_status = AuthStatus::Pending; // reset
114 + return sa.create_simple<ServiceDiscovery>(ctx);
115 + } else {
116 + return sa.HANDLED_INTERNALLY;
117 + }
118 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
119 + const auto res = handle_request(*req, ctx.session);
120 + ctx.respond(res);
121 +
122 + ctx.session_stopped = true;
123 + return sa.PASS_ON;
124 + } else {
125 + ctx.log("expected AuthorizationReq! But code type id: %d", variant->get_type());
126 +
127 + // Sequence Error
128 + const message_20::Type req_type = variant->get_type();
129 + send_sequence_error(req_type, ctx);
130 +
131 + ctx.session_stopped = true;
132 + return sa.PASS_ON;
133 + }
134 + }
135 +
136 + } // namespace iso15118::d20::state
137 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.9612701f6a3e9fd37cda169e446c9393.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.9612701f6a3e9fd37cda169e446c9393.html new file mode 100644 index 000000000..de959f572 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.9612701f6a3e9fd37cda169e446c9393.html @@ -0,0 +1,945 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/authorization_setup.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:194938.8%
Functions:1333.3%
Branches:247830.8%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <random>
4 +
5 + #include <iso15118/d20/state/authorization.hpp>
6 + #include <iso15118/d20/state/authorization_setup.hpp>
7 +
8 + #include <iso15118/detail/d20/context_helper.hpp>
9 + #include <iso15118/detail/helper.hpp>
10 +
11 + #include <iso15118/detail/d20/state/authorization_setup.hpp>
12 + #include <iso15118/detail/d20/state/session_stop.hpp>
13 +
14 + namespace iso15118::d20::state {
15 +
16 + namespace dt = message_20::datatypes;
17 +
18 + 8message_20::AuthorizationSetupResponse handle_request(const message_20::AuthorizationSetupRequest& req,
19 + d20::Session& session, bool cert_install_service,
20 + const std::vector<dt::Authorization>& authorization_services) {
21 +
22 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 auto res = message_20::AuthorizationSetupResponse(); // default mandatory values [V2G20-736]
23 +
24 +
+ 3/4 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 6 times.
+
+
+
8 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
25 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
26 + }
27 +
28 + 6 res.certificate_installation_service = cert_install_service;
29 +
30 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 6 times.
+
+
+
6 if (authorization_services.empty()) {
31 + logf_warning("authorization_services was not set. Setting EIM as auth_mode");
32 + res.authorization_services = {dt::Authorization::EIM};
33 + } else {
34 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 res.authorization_services = authorization_services;
35 + }
36 +
37 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 session.offered_services.auth_services = res.authorization_services;
38 +
39 +
+ 6/6 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 2 times.
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
✓ Branch 6 taken 2 times.
+
✓ Branch 7 taken 4 times.
+
+
+
6 if (res.authorization_services.size() == 1 && res.authorization_services[0] == dt::Authorization::EIM) {
40 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 res.authorization_mode.emplace<dt::EIM_ASResAuthorizationMode>();
41 + } else {
42 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 auto& pnc_auth_mode = res.authorization_mode.emplace<dt::PnC_ASResAuthorizationMode>();
43 +
44 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 std::random_device rd;
45 +
+ 2/4 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 4 times.
+
✗ Branch 5 not taken.
+
+
+
4 std::mt19937 generator(rd());
46 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 std::uniform_int_distribution<uint8_t> distribution(0x00, 0xff);
47 +
48 +
+ 2/2 +
+
✓ Branch 0 taken 64 times.
+
✓ Branch 1 taken 4 times.
+
+
+
68 for (auto& item : pnc_auth_mode.gen_challenge) {
49 +
+ 1/2 +
+
✓ Branch 1 taken 64 times.
+
✗ Branch 2 not taken.
+
+
+
64 item = distribution(generator);
50 + }
51 + 4 }
52 +
53 +
+ 1/2 +
+
✓ Branch 2 taken 6 times.
+
✗ Branch 3 not taken.
+
+
+
6 return response_with_code(res, dt::ResponseCode::OK);
54 + 8}
55 +
56 + void AuthorizationSetup::enter() {
57 + ctx.log.enter_state("AuthorizationSetup");
58 + }
59 +
60 + FsmSimpleState::HandleEventReturnType AuthorizationSetup::handle_event(AllocatorType& sa, FsmEvent ev) {
61 +
62 + if (ev != FsmEvent::V2GTP_MESSAGE) {
63 + return sa.PASS_ON;
64 + }
65 +
66 + const auto variant = ctx.pull_request();
67 +
68 + if (const auto req = variant->get_if<message_20::AuthorizationSetupRequest>()) {
69 + const auto res = handle_request(*req, ctx.session, ctx.session_config.cert_install_service,
70 + ctx.session_config.authorization_services);
71 +
72 + logf_info("Timestamp: %d", req->header.timestamp);
73 +
74 + ctx.respond(res);
75 +
76 + if (res.response_code >= dt::ResponseCode::FAILED) {
77 + ctx.session_stopped = true;
78 + return sa.PASS_ON;
79 + }
80 +
81 + // Todo(sl): PnC is currently not supported
82 + ctx.feedback.signal(session::feedback::Signal::REQUIRE_AUTH_EIM);
83 +
84 + return sa.create_simple<Authorization>(ctx);
85 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
86 + const auto res = handle_request(*req, ctx.session);
87 +
88 + ctx.respond(res);
89 + ctx.session_stopped = true;
90 +
91 + return sa.PASS_ON;
92 + } else {
93 + ctx.log("expected AuthorizationSetupReq! But code type id: %d", variant->get_type());
94 +
95 + // Sequence Error
96 + const message_20::Type req_type = variant->get_type();
97 + send_sequence_error(req_type, ctx);
98 +
99 + ctx.session_stopped = true;
100 + return sa.PASS_ON;
101 + }
102 + }
103 +
104 + } // namespace iso15118::d20::state
105 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.d20df6b19add57685839123faa40cf00.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.d20df6b19add57685839123faa40cf00.html new file mode 100644 index 000000000..a8a5f3a48 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.authorization_setup.cpp.d20df6b19add57685839123faa40cf00.html @@ -0,0 +1,657 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/authorization_setup.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:3434100.0%
Functions:88100.0%
Branches:71450.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/authorization_setup.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + 2template <> void convert(const struct iso20_AuthorizationSetupReqType& in, AuthorizationSetupRequest& out) {
14 + 2 convert(in.Header, out.header);
15 + 2}
16 +
17 + struct AuthorizationModeVisitor {
18 + 4 AuthorizationModeVisitor(iso20_AuthorizationSetupResType& out_) : out(out_){};
19 + 2 void operator()([[maybe_unused]] const datatypes::EIM_ASResAuthorizationMode& in) {
20 + 2 CB_SET_USED(out.EIM_ASResAuthorizationMode);
21 + 2 init_iso20_EIM_ASResAuthorizationModeType(&out.EIM_ASResAuthorizationMode);
22 + 2 }
23 + 2 void operator()(const datatypes::PnC_ASResAuthorizationMode& in) {
24 + 2 CB_SET_USED(out.PnC_ASResAuthorizationMode);
25 + 2 init_iso20_PnC_ASResAuthorizationModeType(&out.PnC_ASResAuthorizationMode);
26 +
+ 1/4 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
✗ Branch 4 not taken.
+
✗ Branch 5 not taken.
+
+
+
2 CPP2CB_BYTES(in.gen_challenge, out.PnC_ASResAuthorizationMode.GenChallenge);
27 + // todo(sl): supported_providers missing
28 + 2 }
29 +
30 + private:
31 + iso20_AuthorizationSetupResType& out;
32 + };
33 +
34 + 4template <> void convert(const AuthorizationSetupResponse& in, iso20_AuthorizationSetupResType& out) {
35 + 4 init_iso20_AuthorizationSetupResType(&out);
36 +
37 + 4 cb_convert_enum(in.response_code, out.ResponseCode);
38 +
39 + 4 out.AuthorizationServices.arrayLen = in.authorization_services.size();
40 +
41 + 4 uint8_t element = 0;
42 +
+ 2/2 +
+
✓ Branch 5 taken 6 times.
+
✓ Branch 6 taken 4 times.
+
+
+
10 for (auto const& service : in.authorization_services) {
43 + 6 cb_convert_enum(service, out.AuthorizationServices.array[element++]);
44 + }
45 +
46 + 4 out.CertificateInstallationService = in.certificate_installation_service;
47 +
48 +
+ 1/2 +
+
✓ Branch 2 taken 4 times.
+
✗ Branch 3 not taken.
+
+
+
4 std::visit(AuthorizationModeVisitor(out), in.authorization_mode);
49 +
50 + 4 convert(in.header, out.Header);
51 + 4}
52 +
53 + 2template <> void insert_type(VariantAccess& va, const struct iso20_AuthorizationSetupReqType& in) {
54 + 2 va.insert_type<AuthorizationSetupRequest>(in);
55 + 2};
56 +
57 + 4template <> int serialize_to_exi(const AuthorizationSetupResponse& in, exi_bitstream_t& out) {
58 + iso20_exiDocument doc;
59 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 init_iso20_exiDocument(&doc);
60 +
61 + 4 CB_SET_USED(doc.AuthorizationSetupRes);
62 +
63 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 convert(in, doc.AuthorizationSetupRes);
64 +
65 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
8 return encode_iso20_exiDocument(&out, &doc);
66 + }
67 +
68 + 4template <> size_t serialize(const AuthorizationSetupResponse& in, const io::StreamOutputView& out) {
69 + 4 return serialize_helper(in, out);
70 + }
71 +
72 + } // namespace iso15118::message_20
73 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.cpp.886c2dd259355f8afbda35c0afbb15ca.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.cpp.886c2dd259355f8afbda35c0afbb15ca.html new file mode 100644 index 000000000..6e57a31ab --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.cpp.886c2dd259355f8afbda35c0afbb15ca.html @@ -0,0 +1,222 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/misc/cb_exi.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:66100.0%
Functions:22100.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/detail/cb_exi.hpp>
4 +
5 + 36exi_bitstream_t get_exi_input_stream(const iso15118::io::StreamInputView& buffer_view) {
6 + exi_bitstream_t exi_stream_in;
7 + 36 exi_bitstream_init(&exi_stream_in, const_cast<uint8_t*>(buffer_view.payload), buffer_view.payload_len, 0, nullptr);
8 +
9 + 36 return exi_stream_in;
10 + }
11 +
12 + 40exi_bitstream_t get_exi_output_stream(const iso15118::io::StreamOutputView& buffer_view) {
13 + exi_bitstream_t exi_stream_out;
14 + 40 exi_bitstream_init(&exi_stream_out, buffer_view.payload, buffer_view.payload_len, 0, nullptr);
15 +
16 + 40 return exi_stream_out;
17 + }
18 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.hpp.ef7fd8eb7ebe1da1cb35a2d6b89b2664.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.hpp.ef7fd8eb7ebe1da1cb35a2d6b89b2664.html new file mode 100644 index 000000000..74cb0ba9e --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.cb_exi.hpp.ef7fd8eb7ebe1da1cb35a2d6b89b2664.html @@ -0,0 +1,778 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/detail/cb_exi.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:8988.9%
Functions:263378.8%
Branches:41233.3%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <stdexcept>
6 +
7 + #include <cbv2g/common/exi_bitstream.h>
8 +
9 + #include <iso15118/io/stream_view.hpp>
10 +
11 + #define CB2CPP_STRING(property) (std::string(property.characters, property.charactersLen))
12 + #define CPP2CB_STRING(in, out) \
13 + if (in.length() > sizeof(out.characters)) { \
14 + throw std::runtime_error("String too long"); \
15 + } \
16 + in.copy(out.characters, in.length()); \
17 + out.charactersLen = in.length()
18 +
19 + #define CPP2CB_BYTES(in, out) \
20 + if (in.size() > sizeof(out.bytes)) { \
21 + throw std::runtime_error("Byte vector too long"); \
22 + } \
23 + std::copy(in.begin(), in.end(), out.bytes); \
24 + out.bytesLen = in.size()
25 +
26 + #define CB2CPP_BYTES(in, out) \
27 + if (in.bytesLen > out.size()) { \
28 + throw std::runtime_error("Byte array too long"); \
29 + } \
30 + std::copy(std::begin(in.bytes), std::end(in.bytes), out.begin());
31 +
32 + #define CB_SET_USED(property) (property##_isUsed = 1)
33 + #define CB2CPP_ASSIGN_IF_USED(in, out) \
34 + if (in##_isUsed) { \
35 + out = in; \
36 + }
37 +
38 + #define CPP2CB_ASSIGN_IF_USED(in, out) \
39 + if (in) { \
40 + out = in.value(); \
41 + } \
42 + \
43 + out##_isUsed = static_cast<bool>(in);
44 +
45 + #define CB2CPP_CONVERT_IF_USED(in, out) \
46 + if (in##_isUsed) { \
47 + convert(in, out.emplace()); \
48 + }
49 +
50 + #define CPP2CB_CONVERT_IF_USED(in, out) \
51 + if (in) { \
52 + convert(in.value(), out); \
53 + } \
54 + \
55 + out##_isUsed = static_cast<bool>(in);
56 +
57 + #define CPP2CB_STRING_IF_USED(in, out) \
58 + if (in) { \
59 + CPP2CB_STRING(in.value(), out); \
60 + } \
61 + \
62 + out##_isUsed = static_cast<bool>(in);
63 +
64 + 104template <typename T1, typename T2> void cb_convert_enum(const T1& in, T2& out) {
65 + 104 out = static_cast<T2>(in);
66 + 104}
67 +
68 + exi_bitstream_t get_exi_input_stream(const iso15118::io::StreamInputView&);
69 + exi_bitstream_t get_exi_output_stream(const iso15118::io::StreamOutputView&);
70 +
71 + namespace iso15118::message_20 {
72 +
73 + template <typename MessageType> int serialize_to_exi(const MessageType& in, exi_bitstream_t& out);
74 +
75 + template <typename MessageType>
76 + 38size_t serialize_helper(const MessageType& in, const io::StreamOutputView& stream_view) {
77 +
+ 1/2 +
+
✓ Branch 1 taken 36 times.
+
✗ Branch 2 not taken.
+
+
+
38 auto out = get_exi_output_stream(stream_view);
78 +
79 +
+ 1/2 +
+
✓ Branch 1 taken 36 times.
+
✗ Branch 2 not taken.
+
+
+
38 const auto error = serialize_to_exi(in, out);
80 +
81 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 36 times.
+
+
+
38 if (error != 0) {
82 + throw std::runtime_error("Could not encode exi: " + std::to_string(error));
83 + }
84 +
85 +
+ 1/2 +
+
✓ Branch 1 taken 36 times.
+
✗ Branch 2 not taken.
+
+
+
76 return exi_bitstream_get_length(&out);
86 + }
87 +
88 + } // namespace iso15118::message_20
89 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.common_types.cpp.4891eea45fd542f0e0f6dd7bc0e2bc1c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.common_types.cpp.4891eea45fd542f0e0f6dd7bc0e2bc1c.html new file mode 100644 index 000000000..775086137 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.common_types.cpp.4891eea45fd542f0e0f6dd7bc0e2bc1c.html @@ -0,0 +1,1357 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/common_types.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:469647.9%
Functions:152755.6%
Branches:75213.5%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <cmath>
4 +
5 + #include <iso15118/message/common_types.hpp>
6 +
7 + #include <iso15118/detail/cb_exi.hpp>
8 + #include <iso15118/message/variant.hpp>
9 +
10 + #include <cbv2g/iso_20/iso20_AC_Datatypes.h>
11 + #include <cbv2g/iso_20/iso20_CommonMessages_Datatypes.h>
12 + #include <cbv2g/iso_20/iso20_DC_Datatypes.h>
13 +
14 + namespace iso15118::message_20 {
15 +
16 + 64template <typename cb_HeaderType> void convert(const cb_HeaderType& in, Header& out) {
17 +
18 + 64 std::copy(in.SessionID.bytes, in.SessionID.bytes + in.SessionID.bytesLen, out.session_id.begin());
19 + 64 out.timestamp = in.TimeStamp;
20 +
21 + // Todo(sl): missing signature
22 + 64}
23 +
24 + template void convert(const struct iso20_MessageHeaderType& in, Header& out);
25 + template void convert(const struct iso20_dc_MessageHeaderType& in, Header& out);
26 + template void convert(const struct iso20_ac_MessageHeaderType& in, Header& out);
27 +
28 + 72template <typename cb_HeaderType> void convert_header(const Header& in, cb_HeaderType& out) {
29 + 72 out.TimeStamp = in.timestamp;
30 + 72 std::copy(in.session_id.begin(), in.session_id.end(), out.SessionID.bytes);
31 +
32 + // FIXME (aw): this should be fixed 8
33 + 72 out.SessionID.bytesLen = 8;
34 + 72}
35 +
36 + 24template <> void convert(const Header& in, iso20_MessageHeaderType& out) {
37 + 24 init_iso20_MessageHeaderType(&out);
38 + 24 convert_header(in, out);
39 + 24}
40 +
41 + 12template <> void convert(const Header& in, iso20_dc_MessageHeaderType& out) {
42 + 12 init_iso20_dc_MessageHeaderType(&out);
43 + 12 convert_header(in, out);
44 + 12}
45 +
46 + template <> void convert(const Header& in, iso20_ac_MessageHeaderType& out) {
47 + init_iso20_ac_MessageHeaderType(&out);
48 + convert_header(in, out);
49 + }
50 +
51 + template <typename cb_RationalNumberType>
52 + 128void convert(const cb_RationalNumberType& in, datatypes::RationalNumber& out) {
53 + 128 out.exponent = in.Exponent;
54 + 128 out.value = in.Value;
55 + 128}
56 +
57 + template void convert(const struct iso20_ac_RationalNumberType& in, datatypes::RationalNumber& out);
58 + template void convert(const struct iso20_dc_RationalNumberType& in, datatypes::RationalNumber& out);
59 + template void convert(const struct iso20_RationalNumberType& in, datatypes::RationalNumber& out);
60 +
61 + template <typename cb_RationalNumberType>
62 + 48void convert(const datatypes::RationalNumber& in, cb_RationalNumberType& out) {
63 + 48 out.Exponent = in.exponent;
64 + 48 out.Value = in.value;
65 + 48}
66 +
67 + template void convert(const datatypes::RationalNumber& in, struct iso20_ac_RationalNumberType& out);
68 + template void convert(const datatypes::RationalNumber& in, struct iso20_dc_RationalNumberType& out);
69 + template void convert(const datatypes::RationalNumber& in, struct iso20_RationalNumberType& out);
70 +
71 + template <> void convert(const datatypes::EvseStatus& in, struct iso20_dc_EVSEStatusType& out) {
72 + out.NotificationMaxDelay = in.notification_max_delay;
73 + cb_convert_enum(in.notification, out.EVSENotification);
74 + }
75 +
76 + template <> void convert(const datatypes::EvseStatus& in, struct iso20_ac_EVSEStatusType& out) {
77 + out.NotificationMaxDelay = in.notification_max_delay;
78 + cb_convert_enum(in.notification, out.EVSENotification);
79 + }
80 +
81 + template <typename cb_MeterInfoType> void convert_meterinfo(const datatypes::MeterInfo& in, cb_MeterInfoType& out) {
82 +
83 + CPP2CB_STRING(in.meter_id, out.MeterID);
84 + out.ChargedEnergyReadingWh = in.charged_energy_reading_wh;
85 +
86 + CPP2CB_ASSIGN_IF_USED(in.bpt_discharged_energy_reading_wh, out.BPT_DischargedEnergyReadingWh);
87 + CPP2CB_ASSIGN_IF_USED(in.capacitive_energy_reading_varh, out.CapacitiveEnergyReadingVARh);
88 + CPP2CB_ASSIGN_IF_USED(in.bpt_inductive_energery_reading_varh, out.BPT_InductiveEnergyReadingVARh);
89 +
90 + if (in.meter_signature) {
91 + CPP2CB_BYTES(in.meter_signature.value(), out.MeterSignature);
92 + CB_SET_USED(out.MeterSignature);
93 + }
94 +
95 + CPP2CB_ASSIGN_IF_USED(in.meter_status, out.MeterStatus);
96 + CPP2CB_ASSIGN_IF_USED(in.meter_timestamp, out.MeterTimestamp);
97 + }
98 +
99 + template <> void convert(const datatypes::MeterInfo& in, iso20_dc_MeterInfoType& out) {
100 + init_iso20_dc_MeterInfoType(&out);
101 + convert_meterinfo(in, out);
102 + }
103 +
104 + template <> void convert(const datatypes::MeterInfo& in, iso20_ac_MeterInfoType& out) {
105 + init_iso20_ac_MeterInfoType(&out);
106 + convert_meterinfo(in, out);
107 + }
108 +
109 + template <> void convert(const datatypes::EvseStatus& in, iso20_EVSEStatusType& out) {
110 + out.NotificationMaxDelay = in.notification_max_delay;
111 + cb_convert_enum(in.notification, out.EVSENotification);
112 + }
113 +
114 + namespace datatypes {
115 +
116 + 224float from_RationalNumber(const RationalNumber& in) {
117 + 224 return in.value * pow(10, in.exponent);
118 + }
119 +
120 + 28RationalNumber from_float(float in) {
121 + 28 RationalNumber out;
122 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 28 times.
+
+
+
28 if (in == 0.0) {
123 + out.exponent = 0;
124 + out.value = 0;
125 + return out;
126 + }
127 + 28 out.exponent = static_cast<int8_t>(floor(log10(fabs(in))));
128 + 28 out.exponent -= 3; // add 3 digits of precision
129 + 28 out.value = static_cast<int16_t>(in * pow(10, -out.exponent));
130 + 28 return out;
131 + }
132 +
133 + 2std::string from_Protocol(const Protocol& in) {
134 +
135 +
+ 1/4 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✗ Branch 3 not taken.
+
+
+
2 switch (in) {
136 + case Protocol::Ftp:
137 + return std::string("ftp");
138 + 2 case Protocol::Http:
139 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return std::string("http");
140 + case Protocol::Https:
141 + return std::string("https");
142 + }
143 + return "";
144 + }
145 +
146 + 10std::string from_control_mode(const ControlMode& in) {
147 +
+ 1/3 +
+
✓ Branch 0 taken 10 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
+
+
10 switch (in) {
148 + 10 case ControlMode::Scheduled:
149 +
+ 1/2 +
+
✓ Branch 2 taken 10 times.
+
✗ Branch 3 not taken.
+
+
+
10 return "Scheduled";
150 + case ControlMode::Dynamic:
151 + return "Dynamic";
152 + }
153 + return "";
154 + }
155 +
156 + 10std::string from_mobility_needs_mode(const MobilityNeedsMode& in) {
157 +
+ 1/3 +
+
✓ Branch 0 taken 10 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
+
+
10 switch (in) {
158 + 10 case MobilityNeedsMode::ProvidedByEvcc:
159 +
+ 1/2 +
+
✓ Branch 2 taken 10 times.
+
✗ Branch 3 not taken.
+
+
+
10 return "ProvidedByEvcc";
160 + case MobilityNeedsMode::ProvidedBySecc:
161 + return "ProvidedBySecc";
162 + }
163 + return "";
164 + }
165 +
166 + } // namespace datatypes
167 +
168 + } // namespace iso15118::message_20
169 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.config.cpp.ebe0eced5db2be04723fa992faf48aec.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.config.cpp.ebe0eced5db2be04723fa992faf48aec.html new file mode 100644 index 000000000..de7cd7d48 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.config.cpp.ebe0eced5db2be04723fa992faf48aec.html @@ -0,0 +1,851 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/config.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:313881.6%
Functions:55100.0%
Branches:163644.4%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/config.hpp>
4 +
5 + #include <algorithm>
6 +
7 + #include <iso15118/detail/helper.hpp>
8 +
9 + namespace iso15118::d20 {
10 +
11 + namespace dt = message_20::datatypes;
12 +
13 + namespace {
14 +
15 + 36auto get_mobility_needs_mode(const ControlMobilityNeedsModes& mode) {
16 + using namespace dt;
17 +
18 +
+ 2/4 +
+
✓ Branch 0 taken 36 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 36 times.
+
+
+
36 if (mode.control_mode == ControlMode::Scheduled and mode.mobility_mode == MobilityNeedsMode::ProvidedBySecc) {
19 + logf_info("Setting the mobility needs mode to ProvidedByEvcc. In scheduled mode only ProvidedByEvcc is "
20 + "supported.");
21 + return MobilityNeedsMode::ProvidedByEvcc;
22 + }
23 +
24 + 36 return mode.mobility_mode;
25 + }
26 +
27 + 18auto get_default_dc_parameter_list(const std::vector<ControlMobilityNeedsModes>& control_mobility_modes) {
28 + using namespace dt;
29 +
30 + // TODO(sl): Add check if a control mode is more than one in that vector
31 +
32 + 18 std::vector<DcParameterList> param_list;
33 +
34 +
+ 2/2 +
+
✓ Branch 4 taken 18 times.
+
✓ Branch 5 taken 18 times.
+
+
+
36 for (const auto& mode : control_mobility_modes) {
35 + 18 param_list.push_back({
36 + DcConnector::Extended,
37 + 18 mode.control_mode,
38 +
+ 2/4 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 18 times.
+
✗ Branch 5 not taken.
+
+
+
18 get_mobility_needs_mode(mode),
39 + Pricing::NoPricing,
40 + });
41 + }
42 +
43 + 18 return param_list;
44 + }
45 +
46 + 18auto get_default_dc_bpt_parameter_list(const std::vector<ControlMobilityNeedsModes>& control_mobility_modes) {
47 + using namespace dt;
48 +
49 + // TODO(sl): Add check if a control mode is more than one in that vector
50 +
51 + 18 std::vector<DcBptParameterList> param_list;
52 +
53 +
+ 2/2 +
+
✓ Branch 4 taken 18 times.
+
✓ Branch 5 taken 18 times.
+
+
+
36 for (const auto& mode : control_mobility_modes) {
54 + 18 param_list.push_back({{
55 + DcConnector::Extended,
56 + 18 mode.control_mode,
57 +
+ 2/4 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 18 times.
+
✗ Branch 5 not taken.
+
+
+
18 get_mobility_needs_mode(mode),
58 + Pricing::NoPricing,
59 + },
60 + BptChannel::Unified,
61 + GeneratorMode::GridFollowing});
62 + }
63 +
64 + 18 return param_list;
65 + }
66 +
67 + } // namespace
68 +
69 + 18SessionConfig::SessionConfig(EvseSetupConfig config) :
70 + 18 evse_id(std::move(config.evse_id)),
71 + 18 cert_install_service(config.enable_certificate_install_service),
72 + 18 authorization_services(std::move(config.authorization_services)),
73 + 18 supported_energy_transfer_services(std::move(config.supported_energy_services)),
74 + 18 dc_limits(std::move(config.dc_limits)),
75 + 36 supported_control_mobility_modes(std::move(config.control_mobility_modes)) {
76 +
77 + 18 const auto is_bpt_service = [](dt::ServiceCategory service) { return service == dt::ServiceCategory::DC_BPT; };
78 +
+ 1/2 +
+
✓ Branch 3 taken 18 times.
+
✗ Branch 4 not taken.
+
+
+
18 const auto dc_bpt_found = std::any_of(supported_energy_transfer_services.begin(),
79 + supported_energy_transfer_services.end(), is_bpt_service);
80 +
81 +
+ 2/6 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 18 times.
+
✗ Branch 3 not taken.
+
✗ Branch 4 not taken.
+
✗ Branch 5 not taken.
+
✓ Branch 6 taken 18 times.
+
+
+
18 if (dc_bpt_found and not dc_limits.discharge_limits.has_value()) {
82 + logf_warning("The supported energy services contain DC_BPT, but dc limits does not contain BPT "
83 + "limits. This can lead to session shutdowns.");
84 + }
85 +
86 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 18 times.
+
+
+
18 if (supported_control_mobility_modes.empty()) {
87 + logf_warning("No control modes were provided, set to scheduled mode");
88 + supported_control_mobility_modes = {{dt::ControlMode::Scheduled, dt::MobilityNeedsMode::ProvidedByEvcc}};
89 + }
90 +
91 +
+ 1/2 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
+
+
18 dc_parameter_list = get_default_dc_parameter_list(supported_control_mobility_modes);
92 +
+ 1/2 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
+
+
18 dc_bpt_parameter_list = get_default_dc_bpt_parameter_list(supported_control_mobility_modes);
93 + 18}
94 +
95 + } // namespace iso15118::d20
96 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_abstract.hpp.9cc455081a7ae3d917bf24cf27ed1ad4.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_abstract.hpp.9cc455081a7ae3d917bf24cf27ed1ad4.html new file mode 100644 index 000000000..d0dbd5601 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_abstract.hpp.9cc455081a7ae3d917bf24cf27ed1ad4.html @@ -0,0 +1,368 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/io/connection_abstract.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:010.0%
Functions:010.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cstddef>
6 + #include <functional>
7 +
8 + #include "ipv6_endpoint.hpp"
9 +
10 + namespace iso15118::io {
11 +
12 + enum class ConnectionEvent {
13 + ACCEPTED,
14 + OPEN,
15 + NEW_DATA,
16 + CLOSED,
17 + };
18 +
19 + using ConnectionEventCallback = std::function<void(ConnectionEvent)>;
20 +
21 + struct ReadResult {
22 + bool would_block{true};
23 + size_t bytes_read{0};
24 + };
25 +
26 + struct IConnection {
27 + virtual void set_event_callback(const ConnectionEventCallback&) = 0;
28 +
29 + virtual Ipv6EndPoint get_public_endpoint() const = 0;
30 +
31 + virtual void write(const uint8_t* buf, size_t len) = 0;
32 + virtual ReadResult read(uint8_t* buf, size_t len) = 0;
33 +
34 + virtual void close() = 0;
35 +
36 + virtual ~IConnection() = default;
37 + };
38 + } // namespace iso15118::io
39 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_openssl.cpp.9d9029180aaf032b87b8ae43a0db7c9f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_openssl.cpp.9d9029180aaf032b87b8ae43a0db7c9f.html new file mode 100644 index 000000000..cbc27a128 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_openssl.cpp.9d9029180aaf032b87b8ae43a0db7c9f.html @@ -0,0 +1,2482 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/connection_openssl.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:01690.0%
Functions:0150.0%
Branches:02080.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2024 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/connection_ssl.hpp>
4 +
5 + #include <cassert>
6 + #include <cinttypes>
7 + #include <cstring>
8 + #include <filesystem>
9 + #include <unistd.h>
10 +
11 + #include <sys/socket.h>
12 +
13 + #include <openssl/bio.h>
14 + #include <openssl/err.h>
15 + #include <openssl/ssl.h>
16 +
17 + #include <iso15118/detail/helper.hpp>
18 + #include <iso15118/detail/io/helper_openssl.hpp>
19 + #include <iso15118/detail/io/socket_helper.hpp>
20 + #include <iso15118/io/sdp_server.hpp>
21 +
22 + namespace std {
23 + template <> class default_delete<SSL> {
24 + public:
25 + void operator()(SSL* ptr) const {
26 + ::SSL_free(ptr);
27 + }
28 + };
29 + template <> class default_delete<SSL_CTX> {
30 + public:
31 + void operator()(SSL_CTX* ptr) const {
32 + ::SSL_CTX_free(ptr);
33 + }
34 + };
35 + } // namespace std
36 +
37 + namespace iso15118::io {
38 +
39 + static constexpr auto DEFAULT_SOCKET_BACKLOG = 4;
40 +
41 + static int ex_data_idx;
42 +
43 + struct SSLContext {
44 + std::unique_ptr<SSL_CTX> ssl_ctx;
45 + std::unique_ptr<SSL> ssl;
46 + int fd{-1};
47 + int accept_fd{-1};
48 + std::string interface_name;
49 + bool enable_key_logging{false};
50 + std::unique_ptr<io::TlsKeyLoggingServer> key_server;
51 + };
52 +
53 + static SSL_CTX* init_ssl(const config::SSLConfig& ssl_config) {
54 +
55 + // Note: openssl does not provide support for ECDH-ECDSA-AES128-SHA256 anymore
56 + static constexpr auto TLS1_2_CIPHERSUITES = "ECDHE-ECDSA-AES128-SHA256";
57 + static constexpr auto TLS1_3_CIPHERSUITES = "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256";
58 +
59 + const std::filesystem::path prefix(ssl_config.config_string);
60 +
61 + const SSL_METHOD* method = TLS_server_method();
62 + const auto ctx = SSL_CTX_new(method);
63 +
64 + if (ctx == nullptr) {
65 + log_and_raise_openssl_error("Failed in SSL_CTX_new()");
66 + }
67 +
68 + if (SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION) == 0) {
69 + log_and_raise_openssl_error("Failed in SSL_CTX_set_min_proto_version()");
70 + }
71 +
72 + if (SSL_CTX_set_cipher_list(ctx, TLS1_2_CIPHERSUITES) == 0) {
73 + log_and_raise_openssl_error("Failed in SSL_CTX_set_cipher_list()");
74 + }
75 +
76 + if (SSL_CTX_set_ciphersuites(ctx, TLS1_3_CIPHERSUITES) == 0) {
77 + log_and_raise_openssl_error("Failed in SSL_CTX_set_ciphersuites()");
78 + }
79 +
80 + // TODO(sl): Better cert path handling
81 + const std::filesystem::path certificate_chain_file_path = prefix / "client/cso/CPO_CERT_CHAIN.pem";
82 +
83 + if (SSL_CTX_use_certificate_chain_file(ctx, certificate_chain_file_path.c_str()) != 1) {
84 + log_and_raise_openssl_error("Failed in SSL_CTX_use_certificate_chain_file()");
85 + }
86 +
87 + // INFO: the password callback uses a non-const argument
88 + std::string pass_str = ssl_config.private_key_password;
89 + SSL_CTX_set_default_passwd_cb_userdata(ctx, pass_str.data());
90 +
91 + const std::filesystem::path private_key_file_path = prefix / "client/cso/SECC_LEAF.key";
92 + if (SSL_CTX_use_PrivateKey_file(ctx, private_key_file_path.c_str(), SSL_FILETYPE_PEM) != 1) {
93 + log_and_raise_openssl_error("Failed in SSL_CTX_use_PrivateKey_file()");
94 + }
95 +
96 + // TODO(sl): How switch verify mode to none if tls 1.2 is used?
97 + SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, nullptr);
98 +
99 + if (ssl_config.enable_tls_key_logging) {
100 +
101 + SSL_CTX_set_keylog_callback(ctx, [](const SSL* ssl, const char* line) {
102 + logf_info("TLS handshake keys: %s", line);
103 +
104 + auto& key_logging_server = *static_cast<io::TlsKeyLoggingServer*>(SSL_get_ex_data(ssl, ex_data_idx));
105 +
106 + if (key_logging_server.get_fd() == -1) {
107 + logf_warning("Error - key_logging_server fd is not available");
108 + return;
109 + }
110 + const auto result = key_logging_server.send(line);
111 + if (not cmp_equal(result, strlen(line))) {
112 + const auto error_msg = adding_err_msg("key_logging_server send() failed");
113 + logf_error(error_msg.c_str());
114 + }
115 + });
116 + }
117 +
118 + return ctx;
119 + }
120 +
121 + ConnectionSSL::ConnectionSSL(PollManager& poll_manager_, const std::string& interface_name_,
122 + const config::SSLConfig& ssl_config) :
123 + poll_manager(poll_manager_), ssl(std::make_unique<SSLContext>()) {
124 +
125 + ssl->interface_name = interface_name_;
126 + ssl->enable_key_logging = ssl_config.enable_tls_key_logging;
127 +
128 + // Openssl stuff missing!
129 + const auto ssl_ctx = init_ssl(ssl_config);
130 + ssl->ssl_ctx = std::unique_ptr<SSL_CTX>(ssl_ctx);
131 +
132 + sockaddr_in6 address;
133 + if (not get_first_sockaddr_in6_for_interface(interface_name_, address)) {
134 + const auto msg = "Failed to get ipv6 socket address for interface " + interface_name_;
135 + log_and_throw(msg.c_str());
136 + }
137 +
138 + // Todo(sl): Define constexpr -> 50000 is fixed?
139 + end_point.port = 50000;
140 + memcpy(&end_point.address, &address.sin6_addr, sizeof(address.sin6_addr));
141 +
142 + const auto address_name = sockaddr_in6_to_name(address);
143 +
144 + if (not address_name) {
145 + const auto msg =
146 + "Failed to determine string representation of ipv6 socket address for interface " + interface_name_;
147 + log_and_throw(msg.c_str());
148 + }
149 +
150 + logf_info("Start TLS server [%s]:%" PRIu16, address_name.get(), end_point.port);
151 +
152 + ssl->fd = socket(AF_INET6, SOCK_STREAM, 0);
153 + if (ssl->fd == -1) {
154 + log_and_throw("Failed to create an ipv6 socket");
155 + }
156 +
157 + // before bind, set the port
158 + address.sin6_port = htobe16(end_point.port);
159 +
160 + int optval_tmp{1};
161 + const auto set_reuseaddr = setsockopt(ssl->fd, SOL_SOCKET, SO_REUSEADDR, &optval_tmp, sizeof(optval_tmp));
162 + if (set_reuseaddr == -1) {
163 + log_and_throw("setsockopt(SO_REUSEADDR) failed");
164 + }
165 +
166 + const auto set_reuseport = setsockopt(ssl->fd, SOL_SOCKET, SO_REUSEPORT, &optval_tmp, sizeof(optval_tmp));
167 + if (set_reuseport == -1) {
168 + log_and_throw("setsockopt(SO_REUSEPORT) failed");
169 + }
170 +
171 + const auto bind_result = bind(ssl->fd, reinterpret_cast<const struct sockaddr*>(&address), sizeof(address));
172 + if (bind_result == -1) {
173 + const auto error = "Failed to bind ipv6 socket to interface " + interface_name_;
174 + log_and_throw(error.c_str());
175 + }
176 +
177 + const auto listen_result = listen(ssl->fd, DEFAULT_SOCKET_BACKLOG);
178 + if (listen_result == -1) {
179 + log_and_throw("Listen on socket failed");
180 + }
181 +
182 + poll_manager.register_fd(ssl->fd, [this]() { this->handle_connect(); });
183 + }
184 +
185 + ConnectionSSL::~ConnectionSSL() = default;
186 +
187 + void ConnectionSSL::set_event_callback(const ConnectionEventCallback& callback) {
188 + event_callback = callback;
189 + }
190 +
191 + Ipv6EndPoint ConnectionSSL::get_public_endpoint() const {
192 + return end_point;
193 + }
194 +
195 + void ConnectionSSL::write(const uint8_t* buf, size_t len) {
196 + assert(handshake_complete); // TODO(sl): Adding states?
197 +
198 + size_t writebytes = 0;
199 + const auto ssl_ptr = ssl->ssl.get();
200 +
201 + const auto ssl_write_result = SSL_write_ex(ssl_ptr, buf, len, &writebytes);
202 +
203 + if (ssl_write_result <= 0) {
204 + const auto ssl_err_raw = SSL_get_error(ssl_ptr, ssl_write_result);
205 + log_and_raise_openssl_error("Failed to SSL_write_ex(): " + std::to_string(ssl_err_raw));
206 + } else if (writebytes != len) {
207 + log_and_throw("Didn't complete to write");
208 + }
209 + }
210 +
211 + ReadResult ConnectionSSL::read(uint8_t* buf, size_t len) {
212 + assert(handshake_complete); // TODO(sl): Adding states?
213 +
214 + size_t readbytes = 0;
215 + const auto ssl_ptr = ssl->ssl.get();
216 +
217 + const auto ssl_read_result = SSL_read_ex(ssl_ptr, buf, len, &readbytes);
218 +
219 + if (ssl_read_result > 0) {
220 + const auto would_block = (readbytes < len);
221 + return {would_block, readbytes};
222 + }
223 +
224 + const auto ssl_error = SSL_get_error(ssl_ptr, ssl_read_result);
225 +
226 + if ((ssl_error == SSL_ERROR_WANT_READ) or (ssl_error == SSL_ERROR_WANT_WRITE)) {
227 + return {true, 0};
228 + }
229 +
230 + log_and_raise_openssl_error("Failed to SSL_read_ex(): " + std::to_string(ssl_error));
231 +
232 + return {false, 0};
233 + }
234 +
235 + void ConnectionSSL::handle_connect() {
236 +
237 + const auto peer = BIO_ADDR_new();
238 + ssl->accept_fd = BIO_accept_ex(ssl->fd, peer, BIO_SOCK_NONBLOCK);
239 +
240 + if (ssl->accept_fd < 0) {
241 + log_and_raise_openssl_error("Failed to BIO_accept_ex");
242 + }
243 +
244 + const auto ip = BIO_ADDR_hostname_string(peer, 1);
245 + const auto service = BIO_ADDR_service_string(peer, 1);
246 +
247 + logf_info("Incoming connection from [%s]:%s", ip, service);
248 +
249 + poll_manager.unregister_fd(ssl->fd);
250 + ::close(ssl->fd);
251 +
252 + call_if_available(event_callback, ConnectionEvent::ACCEPTED);
253 +
254 + ssl->ssl = std::unique_ptr<SSL>(SSL_new(ssl->ssl_ctx.get()));
255 + const auto socket_bio = BIO_new_socket(ssl->accept_fd, BIO_CLOSE);
256 +
257 + const auto ssl_ptr = ssl->ssl.get();
258 +
259 + SSL_set_bio(ssl_ptr, socket_bio, socket_bio);
260 + SSL_set_accept_state(ssl_ptr);
261 + SSL_set_app_data(ssl_ptr, this);
262 +
263 + if (ssl->enable_key_logging) {
264 + const auto port = std::stoul(service);
265 + ssl->key_server = std::make_unique<io::TlsKeyLoggingServer>(ssl->interface_name, port);
266 +
267 + // NOTE(sl): SSL_get_ex_new_index does not work with "ex data" because of const
268 + std::string tmp = "ex data";
269 + ex_data_idx = SSL_get_ex_new_index(0, tmp.data(), nullptr, nullptr, nullptr);
270 +
271 + SSL_set_ex_data(ssl_ptr, ex_data_idx, ssl->key_server.get());
272 + }
273 +
274 + poll_manager.register_fd(ssl->accept_fd, [this]() { this->handle_data(); });
275 +
276 + OPENSSL_free(ip);
277 + OPENSSL_free(service);
278 +
279 + BIO_ADDR_free(peer);
280 + }
281 +
282 + void ConnectionSSL::handle_data() {
283 + if (not handshake_complete) {
284 + const auto ssl_ptr = ssl->ssl.get();
285 +
286 + const auto ssl_handshake_result = SSL_accept(ssl_ptr);
287 +
288 + if (ssl_handshake_result <= 0) {
289 +
290 + const auto ssl_error = SSL_get_error(ssl_ptr, ssl_handshake_result);
291 +
292 + if ((ssl_error == SSL_ERROR_WANT_READ) or (ssl_error == SSL_ERROR_WANT_WRITE)) {
293 + return;
294 + }
295 + log_and_raise_openssl_error("Failed to SSL_accept(): " + std::to_string(ssl_error));
296 + } else {
297 + logf_info("Handshake complete!");
298 +
299 + handshake_complete = true;
300 + if (ssl->enable_key_logging) {
301 + ssl->key_server.reset();
302 + }
303 +
304 + call_if_available(event_callback, ConnectionEvent::OPEN);
305 +
306 + return;
307 + }
308 + }
309 +
310 + call_if_available(event_callback, ConnectionEvent::NEW_DATA);
311 + }
312 +
313 + void ConnectionSSL::close() {
314 + /* tear down TLS connection gracefully */
315 + logf_info("Closing TLS connection");
316 +
317 + const auto ssl_ptr = ssl->ssl.get();
318 +
319 + const auto ssl_close_result = SSL_shutdown(ssl_ptr); // TODO(sl): Correct shutdown handling
320 +
321 + if (ssl_close_result < 0) {
322 + const auto ssl_error = SSL_get_error(ssl_ptr, ssl_close_result);
323 + if ((ssl_error != SSL_ERROR_WANT_READ) and (ssl_error != SSL_ERROR_WANT_WRITE)) {
324 + log_and_raise_openssl_error("Failed to SSL_shutdown(): " + std::to_string(ssl_error));
325 + }
326 + }
327 +
328 + // TODO(sl): Test if correct
329 +
330 + ::close(ssl->accept_fd);
331 + poll_manager.unregister_fd(ssl->accept_fd);
332 +
333 + logf_info("TLS connection closed gracefully");
334 +
335 + call_if_available(event_callback, ConnectionEvent::CLOSED);
336 + }
337 +
338 + } // namespace iso15118::io
339 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_plain.cpp.59684de05b18f7546aa963894385cc14.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_plain.cpp.59684de05b18f7546aa963894385cc14.html new file mode 100644 index 000000000..446323d72 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.connection_plain.cpp.59684de05b18f7546aa963894385cc14.html @@ -0,0 +1,1309 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/connection_plain.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0870.0%
Functions:0110.0%
Branches:0800.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/connection_plain.hpp>
4 +
5 + #include <cassert>
6 + #include <chrono>
7 + #include <cinttypes>
8 + #include <cstring>
9 + #include <thread>
10 +
11 + #include <endian.h>
12 + #include <unistd.h>
13 +
14 + #include <iso15118/detail/helper.hpp>
15 + #include <iso15118/detail/io/socket_helper.hpp>
16 +
17 + namespace iso15118::io {
18 +
19 + static constexpr auto DEFAULT_SOCKET_BACKLOG = 4;
20 +
21 + ConnectionPlain::ConnectionPlain(PollManager& poll_manager_, const std::string& interface_name) :
22 + poll_manager(poll_manager_) {
23 + sockaddr_in6 address;
24 + if (not get_first_sockaddr_in6_for_interface(interface_name, address)) {
25 + const auto msg = "Failed to get ipv6 socket address for interface " + interface_name;
26 + log_and_throw(msg.c_str());
27 + }
28 +
29 + // setup end point information
30 + end_point.port = 50000;
31 + memcpy(&end_point.address, &address.sin6_addr, sizeof(address.sin6_addr));
32 +
33 + fd = socket(AF_INET6, SOCK_STREAM, 0);
34 + if (fd == -1) {
35 + log_and_throw("Failed to create an ipv6 socket");
36 + }
37 +
38 + // before bind, set the port
39 + address.sin6_port = htobe16(end_point.port);
40 +
41 + int optval_tmp{1};
42 + const auto set_reuseaddr = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval_tmp, sizeof(optval_tmp));
43 + if (set_reuseaddr == -1) {
44 + log_and_throw("setsockopt(SO_REUSEADDR) failed");
45 + }
46 +
47 + const auto set_reuseport = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &optval_tmp, sizeof(optval_tmp));
48 + if (set_reuseport == -1) {
49 + log_and_throw("setsockopt(SO_REUSEPORT) failed");
50 + }
51 +
52 + const auto bind_result = bind(fd, reinterpret_cast<const struct sockaddr*>(&address), sizeof(address));
53 + if (bind_result == -1) {
54 + const auto error = "Failed to bind ipv6 socket to interface " + interface_name;
55 + log_and_throw(error.c_str());
56 + }
57 +
58 + const auto listen_result = listen(fd, DEFAULT_SOCKET_BACKLOG);
59 + if (listen_result == -1) {
60 + log_and_throw("Listen on socket failed");
61 + }
62 +
63 + poll_manager.register_fd(fd, [this]() { this->handle_connect(); });
64 + }
65 +
66 + ConnectionPlain::~ConnectionPlain() = default;
67 +
68 + void ConnectionPlain::set_event_callback(const ConnectionEventCallback& callback) {
69 + this->event_callback = callback;
70 + }
71 +
72 + Ipv6EndPoint ConnectionPlain::get_public_endpoint() const {
73 + return end_point;
74 + }
75 +
76 + void ConnectionPlain::write(const uint8_t* buf, size_t len) {
77 + assert(connection_open);
78 +
79 + const auto write_result = ::write(fd, buf, len);
80 +
81 + if (write_result == -1) {
82 + log_and_throw("Failed to write()");
83 + } else if (not cmp_equal(write_result, len)) {
84 + log_and_throw("Could not complete write");
85 + }
86 + }
87 +
88 + ReadResult ConnectionPlain::read(uint8_t* buf, size_t len) {
89 + assert(connection_open);
90 +
91 + const auto read_result = ::read(fd, buf, len);
92 + const auto did_block = (len > 0) and (not cmp_equal(read_result, len));
93 +
94 + if (read_result >= 0) {
95 + return {did_block, static_cast<size_t>(read_result)};
96 + }
97 +
98 + // should be an error
99 + if (errno != EAGAIN) {
100 + // in case the error is not due to blocking, log it
101 + logf_error("ConnectionPlain::read failed with error code: %d", errno);
102 + }
103 +
104 + return {did_block, 0};
105 + }
106 +
107 + void ConnectionPlain::handle_connect() {
108 +
109 + sockaddr_in6 address;
110 + socklen_t address_len = sizeof(address);
111 +
112 + const auto accept_fd = accept4(fd, reinterpret_cast<struct sockaddr*>(&address), &address_len, SOCK_NONBLOCK);
113 + if (accept_fd == -1) {
114 + log_and_throw("Failed to accept4");
115 + }
116 +
117 + const auto address_name = sockaddr_in6_to_name(address);
118 +
119 + if (not address_name) {
120 + log_and_throw("Failed to determine string representation of ipv6 socket address");
121 + }
122 +
123 + logf_info("Incoming connection from [%s]:%" PRIu16, address_name.get(), ntohs(address.sin6_port));
124 +
125 + poll_manager.unregister_fd(fd);
126 + ::close(fd);
127 +
128 + call_if_available(event_callback, ConnectionEvent::ACCEPTED);
129 +
130 + connection_open = true;
131 + call_if_available(event_callback, ConnectionEvent::OPEN);
132 +
133 + fd = accept_fd;
134 + poll_manager.register_fd(fd, [this]() { this->handle_data(); });
135 + }
136 +
137 + void ConnectionPlain::handle_data() {
138 + assert(connection_open);
139 +
140 + call_if_available(event_callback, ConnectionEvent::NEW_DATA);
141 + }
142 +
143 + void ConnectionPlain::close() {
144 +
145 + /* tear down TCP connection gracefully */
146 + logf_info("Closing TCP connection");
147 +
148 + const auto shutdown_result = shutdown(fd, SHUT_RDWR);
149 +
150 + if (shutdown_result == -1) {
151 + log_and_throw("shutdown() failed");
152 + }
153 +
154 + // Waiting for client closing the connection
155 + std::this_thread::sleep_for(std::chrono::seconds(2));
156 +
157 + poll_manager.unregister_fd(fd);
158 +
159 + const auto close_shutdown = ::close(fd);
160 +
161 + if (close_shutdown == -1) {
162 + log_and_throw("close() failed");
163 + }
164 +
165 + logf_info("TCP connection closed gracefully");
166 +
167 + connection_open = false;
168 + call_if_available(event_callback, ConnectionEvent::CLOSED);
169 + }
170 +
171 + } // namespace iso15118::io
172 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.cpp.1dff5e6d0fddfed7f05f09ce50cb3617.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.cpp.1dff5e6d0fddfed7f05f09ce50cb3617.html new file mode 100644 index 000000000..6f832ff31 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.cpp.1dff5e6d0fddfed7f05f09ce50cb3617.html @@ -0,0 +1,642 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/context.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:193751.4%
Functions:5955.6%
Branches:41625.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/context.hpp>
4 +
5 + #include <stdexcept>
6 +
7 + #include <iso15118/detail/helper.hpp>
8 +
9 + namespace iso15118::d20 {
10 +
11 + std::unique_ptr<MessageExchange> create_message_exchange(uint8_t* buf, const size_t len) {
12 + io::StreamOutputView view = {buf, len};
13 + return std::make_unique<MessageExchange>(std::move(view));
14 + }
15 +
16 + 2MessageExchange::MessageExchange(io::StreamOutputView output_) : response(std::move(output_)) {
17 + 2}
18 +
19 + 2void MessageExchange::set_request(std::unique_ptr<message_20::Variant> new_request) {
20 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (request) {
21 + // FIXME (aw): we might want to have a stack here?
22 + throw std::runtime_error("Previous V2G message has not been handled yet");
23 + }
24 +
25 + 2 request = std::move(new_request);
26 + 2}
27 +
28 + 2std::unique_ptr<message_20::Variant> MessageExchange::pull_request() {
29 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (not request) {
30 + throw std::runtime_error("Tried to access V2G message, but there is none");
31 + }
32 +
33 + 2 return std::move(request);
34 + }
35 +
36 + std::tuple<bool, size_t, io::v2gtp::PayloadType, message_20::Type> MessageExchange::check_and_clear_response() {
37 + auto retval = std::make_tuple(response_available, response_size, payload_type, response_type);
38 +
39 + response_available = false;
40 + response_size = 0;
41 + response_type = message_20::Type::None;
42 +
43 + return retval;
44 + }
45 +
46 + message_20::Type MessageExchange::peek_request_type() const {
47 + if (not request) {
48 + logf_warning("Tried to access V2G message, but there is none");
49 + return message_20::Type::None;
50 + }
51 + return request->get_type();
52 + }
53 +
54 + 2Context::Context(session::feedback::Callbacks feedback_callbacks, session::SessionLogger& logger,
55 + d20::SessionConfig session_config_, const std::optional<ControlEvent>& current_control_event_,
56 + 2 MessageExchange& message_exchange_) :
57 +
+ 1/2 +
+
✓ Branch 3 taken 2 times.
+
✗ Branch 4 not taken.
+
+
+
2 feedback(std::move(feedback_callbacks)),
58 + 2 log(logger),
59 + 2 session_config(std::move(session_config_)),
60 + 2 current_control_event{current_control_event_},
61 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 message_exchange(message_exchange_) {
62 + 2}
63 +
64 + 2std::unique_ptr<message_20::Variant> Context::pull_request() {
65 + 2 return message_exchange.pull_request();
66 + }
67 +
68 + message_20::Type Context::peek_request_type() const {
69 + return message_exchange.peek_request_type();
70 + }
71 +
72 + } // namespace iso15118::d20
73 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.hpp.737ec5dc795108ccd72ca1aeba3102c8.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.hpp.737ec5dc795108ccd72ca1aeba3102c8.html new file mode 100644 index 000000000..c48e3251a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context.hpp.737ec5dc795108ccd72ca1aeba3102c8.html @@ -0,0 +1,829 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/d20/context.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:91560.0%
Functions:2355.7%
Branches:040.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <memory>
6 + #include <optional>
7 + #include <string>
8 + #include <tuple>
9 +
10 + #include <iso15118/message/payload_type.hpp>
11 + #include <iso15118/message/variant.hpp>
12 + #include <iso15118/session/feedback.hpp>
13 + #include <iso15118/session/logger.hpp>
14 +
15 + #include "config.hpp"
16 + #include "control_event.hpp"
17 + #include "session.hpp"
18 +
19 + namespace iso15118::d20 {
20 +
21 + // forward declare
22 + class ControlEventQueue;
23 +
24 + class MessageExchange {
25 + public:
26 + MessageExchange(io::StreamOutputView);
27 +
28 + void set_request(std::unique_ptr<message_20::Variant> new_request);
29 + std::unique_ptr<message_20::Variant> pull_request();
30 + message_20::Type peek_request_type() const;
31 +
32 + 2 template <typename MessageType> void set_response(const MessageType& msg) {
33 + 2 response_size = message_20::serialize(msg, response);
34 + 2 response_available = true;
35 + 2 payload_type = message_20::PayloadTypeTrait<MessageType>::type;
36 + 2 response_type = message_20::TypeTrait<MessageType>::type;
37 + 2 }
38 +
39 + std::tuple<bool, size_t, io::v2gtp::PayloadType, message_20::Type> check_and_clear_response();
40 +
41 + private:
42 + // input
43 + std::unique_ptr<message_20::Variant> request{nullptr};
44 +
45 + // output
46 + const io::StreamOutputView response;
47 + size_t response_size{0};
48 + bool response_available{false};
49 + io::v2gtp::PayloadType payload_type;
50 + message_20::Type response_type;
51 + };
52 +
53 + std::unique_ptr<MessageExchange> create_message_exchange(uint8_t* buf, const size_t len);
54 +
55 + class Context {
56 + public:
57 + // FIXME (aw): bundle arguments
58 + Context(session::feedback::Callbacks, session::SessionLogger&, d20::SessionConfig,
59 + const std::optional<ControlEvent>&, MessageExchange&);
60 +
61 + std::unique_ptr<message_20::Variant> pull_request();
62 + message_20::Type peek_request_type() const;
63 +
64 + 2 template <typename MessageType> void respond(const MessageType& msg) {
65 + 2 message_exchange.set_response(msg);
66 + 2 }
67 +
68 + const auto& get_control_event() {
69 + return current_control_event;
70 + }
71 +
72 + template <typename T> T const* get_control_event() {
73 + if (not current_control_event.has_value()) {
74 + return nullptr;
75 + }
76 +
77 + if (not std::holds_alternative<T>(*current_control_event)) {
78 + return nullptr;
79 + }
80 +
81 + return &std::get<T>(*current_control_event);
82 + }
83 +
84 + const session::Feedback feedback;
85 +
86 + session::SessionLogger& log;
87 +
88 + Session session;
89 +
90 + SessionConfig session_config;
91 +
92 + bool session_stopped{false};
93 +
94 + private:
95 + const std::optional<ControlEvent>& current_control_event;
96 + MessageExchange& message_exchange;
97 + };
98 +
99 + } // namespace iso15118::d20
100 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.cpp.a6deda03a80df1dbd594e14f8adc581a.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.cpp.a6deda03a80df1dbd594e14f8adc581a.html new file mode 100644 index 000000000..4031e1f0d --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.cpp.a6deda03a80df1dbd594e14f8adc581a.html @@ -0,0 +1,812 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/context_helper.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:106016.7%
Functions:31816.7%
Branches:1901.1%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <ctime>
4 +
5 + #include <iso15118/detail/d20/context_helper.hpp>
6 + #include <iso15118/detail/helper.hpp>
7 +
8 + #include <iso15118/message/authorization.hpp>
9 + #include <iso15118/message/authorization_setup.hpp>
10 + #include <iso15118/message/dc_cable_check.hpp>
11 + #include <iso15118/message/dc_charge_loop.hpp>
12 + #include <iso15118/message/dc_charge_parameter_discovery.hpp>
13 + #include <iso15118/message/dc_pre_charge.hpp>
14 + #include <iso15118/message/dc_welding_detection.hpp>
15 + #include <iso15118/message/power_delivery.hpp>
16 + #include <iso15118/message/schedule_exchange.hpp>
17 + #include <iso15118/message/service_detail.hpp>
18 + #include <iso15118/message/service_discovery.hpp>
19 + #include <iso15118/message/service_selection.hpp>
20 + #include <iso15118/message/session_setup.hpp>
21 + #include <iso15118/message/session_stop.hpp>
22 +
23 + namespace iso15118::d20 {
24 +
25 + 122static inline void setup_timestamp(message_20::Header& header) {
26 + 122 header.timestamp = static_cast<uint64_t>(std::time(nullptr));
27 + 122}
28 +
29 + 122bool validate_and_setup_header(message_20::Header& header, const Session& cur_session,
30 + const decltype(message_20::Header::session_id)& req_session_id) {
31 +
32 + 122 setup_header(header, cur_session);
33 +
34 +
+ 1/2 +
+
✓ Branch 2 taken 122 times.
+
✗ Branch 3 not taken.
+
+
+
122 return (cur_session.get_id() == req_session_id);
35 + }
36 +
37 + 122void setup_header(message_20::Header& header, const Session& cur_session) {
38 + 122 header.session_id = cur_session.get_id();
39 + 122 setup_timestamp(header);
40 + 122}
41 +
42 + template <typename Response> Response handle_sequence_error(const d20::Session& session) {
43 + Response res;
44 + setup_header(res.header, session);
45 + return response_with_code(res, message_20::datatypes::ResponseCode::FAILED_SequenceError);
46 + }
47 +
48 + // Todo(sl): Not happy at all. Need refactoring. Only ctx.respond and Session is needed. Not the whole Context.
49 + void send_sequence_error(const message_20::Type req_type, d20::Context& ctx) {
50 +
51 + if (req_type == message_20::Type::SessionSetupReq) {
52 + const auto res = handle_sequence_error<message_20::SessionSetupResponse>(ctx.session);
53 + ctx.respond(res);
54 + } else if (req_type == message_20::Type::AuthorizationSetupReq) {
55 + const auto res = handle_sequence_error<message_20::AuthorizationSetupResponse>(ctx.session);
56 + ctx.respond(res);
57 + } else if (req_type == message_20::Type::AuthorizationReq) {
58 + const auto res = handle_sequence_error<message_20::AuthorizationResponse>(ctx.session);
59 + ctx.respond(res);
60 + } else if (req_type == message_20::Type::ServiceDiscoveryReq) {
61 + const auto res = handle_sequence_error<message_20::ServiceDiscoveryResponse>(ctx.session);
62 + ctx.respond(res);
63 + } else if (req_type == message_20::Type::ServiceDetailReq) {
64 + const auto res = handle_sequence_error<message_20::ServiceDetailResponse>(ctx.session);
65 + ctx.respond(res);
66 + } else if (req_type == message_20::Type::ServiceSelectionReq) {
67 + const auto res = handle_sequence_error<message_20::ServiceSelectionResponse>(ctx.session);
68 + ctx.respond(res);
69 + } else if (req_type == message_20::Type::DC_ChargeParameterDiscoveryReq) {
70 + const auto res = handle_sequence_error<message_20::DC_ChargeParameterDiscoveryResponse>(ctx.session);
71 + ctx.respond(res);
72 + } else if (req_type == message_20::Type::ScheduleExchangeReq) {
73 + const auto res = handle_sequence_error<message_20::ScheduleExchangeResponse>(ctx.session);
74 + ctx.respond(res);
75 + } else if (req_type == message_20::Type::DC_CableCheckReq) {
76 + const auto res = handle_sequence_error<message_20::DC_CableCheckResponse>(ctx.session);
77 + ctx.respond(res);
78 + } else if (req_type == message_20::Type::PowerDeliveryReq) {
79 + const auto res = handle_sequence_error<message_20::PowerDeliveryResponse>(ctx.session);
80 + ctx.respond(res);
81 + } else if (req_type == message_20::Type::DC_PreChargeReq) {
82 + const auto res = handle_sequence_error<message_20::DC_PreChargeResponse>(ctx.session);
83 + ctx.respond(res);
84 + } else if (req_type == message_20::Type::DC_ChargeLoopReq) {
85 + const auto res = handle_sequence_error<message_20::DC_ChargeLoopResponse>(ctx.session);
86 + ctx.respond(res);
87 + } else if (req_type == message_20::Type::DC_WeldingDetectionReq) {
88 + const auto res = handle_sequence_error<message_20::DC_WeldingDetectionResponse>(ctx.session);
89 + ctx.respond(res);
90 + } else if (req_type == message_20::Type::SessionStopReq) {
91 + const auto res = handle_sequence_error<message_20::SessionStopResponse>(ctx.session);
92 + ctx.respond(res);
93 + } else {
94 + logf_warning("Unknown code type id: %d ", req_type);
95 + }
96 + }
97 +
98 + } // namespace iso15118::d20
99 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.hpp.68a4e1da65347a1b95edf13900cde800.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.hpp.68a4e1da65347a1b95edf13900cde800.html new file mode 100644 index 000000000..64ef38f06 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.context_helper.hpp.68a4e1da65347a1b95edf13900cde800.html @@ -0,0 +1,284 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/detail/d20/context_helper.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:33100.0%
Functions:141593.3%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <iso15118/d20/context.hpp>
6 + #include <iso15118/d20/session.hpp>
7 + #include <iso15118/message/common_types.hpp>
8 +
9 + namespace iso15118::d20 {
10 +
11 + // FIXME (aw): not sure about correct signature here for RVO
12 + 124template <typename Response, typename ResponseCode> Response& response_with_code(Response& res, ResponseCode code) {
13 + // FIXME (aw): could add an static_assert here that ResponseCode is an enum?
14 + 124 res.response_code = code;
15 + 124 return res;
16 + }
17 +
18 + bool validate_and_setup_header(message_20::Header&, const Session&, const decltype(message_20::Header::session_id)&);
19 +
20 + void setup_header(message_20::Header&, const Session&);
21 +
22 + void send_sequence_error(const message_20::Type, d20::Context&);
23 +
24 + } // namespace iso15118::d20
25 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event.hpp.307983a6ca397fbd15e6aae52daf0d24.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event.hpp.307983a6ca397fbd15e6aae52daf0d24.html new file mode 100644 index 000000000..a3b98bb9f --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event.hpp.307983a6ca397fbd15e6aae52daf0d24.html @@ -0,0 +1,524 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/d20/control_event.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:060.0%
Functions:030.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cstdint>
6 + #include <optional>
7 + #include <variant>
8 +
9 + #include <iso15118/d20/dynamic_mode_parameters.hpp>
10 + #include <iso15118/d20/limits.hpp>
11 +
12 + namespace iso15118::d20 {
13 + class CableCheckFinished {
14 + public:
15 + explicit CableCheckFinished(bool success_) : success(success_) {
16 + }
17 +
18 + operator bool() const {
19 + return success;
20 + }
21 +
22 + private:
23 + bool success;
24 + };
25 +
26 + struct PresentVoltageCurrent {
27 + float voltage;
28 + float current;
29 + };
30 +
31 + class AuthorizationResponse {
32 + public:
33 + explicit AuthorizationResponse(bool authorized_) : authorized(authorized_) {
34 + }
35 +
36 + operator bool() const {
37 + return authorized;
38 + }
39 +
40 + private:
41 + bool authorized;
42 + };
43 +
44 + class StopCharging {
45 + public:
46 + explicit StopCharging(bool stop_) : stop(stop_) {
47 + }
48 +
49 + operator bool() const {
50 + return stop;
51 + }
52 +
53 + private:
54 + bool stop;
55 + };
56 +
57 + using ControlEvent = std::variant<CableCheckFinished, PresentVoltageCurrent, AuthorizationResponse, StopCharging,
58 + DcTransferLimits, UpdateDynamicModeParameters>;
59 +
60 + } // namespace iso15118::d20
61 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event_queue.cpp.21d1a92646e91b9088051013ee431c4d.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event_queue.cpp.21d1a92646e91b9088051013ee431c4d.html new file mode 100644 index 000000000..174d9dd1a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.control_event_queue.cpp.21d1a92646e91b9088051013ee431c4d.html @@ -0,0 +1,285 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/control_event_queue.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0120.0%
Functions:020.0%
Branches:080.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/control_event_queue.hpp>
4 +
5 + namespace iso15118::d20 {
6 +
7 + std::optional<ControlEvent> ControlEventQueue::pop() {
8 + std::lock_guard<std::mutex> lck(mutex);
9 +
10 + if (queue.empty()) {
11 + return std::nullopt;
12 + }
13 +
14 + auto event = std::make_optional<ControlEvent>(std::move(queue.front()));
15 + queue.pop();
16 +
17 + return event;
18 + }
19 +
20 + void ControlEventQueue::push(ControlEvent event) {
21 + std::lock_guard<std::mutex> lck(mutex);
22 +
23 + queue.push(std::move(event));
24 + }
25 +
26 + } // namespace iso15118::d20
27 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.css b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.css new file mode 100644 index 000000000..5c7a38439 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.css @@ -0,0 +1,620 @@ +:root { + font-family: sans-serif; + --tab_size: 4; +} + +.theme-green, .theme-blue { + --unknown_color: lightgray; + --low_color: #FF6666; + --medium_color: #F9FD63; + --partial_covered_color: var(--medium_color); + --uncovered_color: #FF8C8C; + --warning_color: orangered; + --notTakenBranch_color: red; + --notTakenCondition_color: red; + --uncheckedDecision_color: darkorange; + --notTakenDecision_color: red; + --notInvokedCall_color: red; + --excluded_color: rgb(255, 241, 229); +} + +.theme-green { + --high_color: #85E485; + --covered_color: #85E485; + --takenBranch_color: green; + --takenCondition_color: green; + --takenDecision_color: green; + --invokedCall_color: green; +} + +.theme-blue { + --high_color: #66B4FF; + --covered_color: #66B4Ff; + --takenBranch_color: blue; + --takenCondition_color: blue; + --takenDecision_color: blue; + --invokedCall_color: blue; +} + +body +{ + color: #000000; + background-color: #FFFFFF; +} + +h1 +{ + text-align: center; + margin: 0; + padding-bottom: 10px; + font-size: 20pt; + font-weight: bold; +} + +hr +{ + background-color: navy; + height: 2px; + border: 0; +} + +/* Link formats: use maroon w/underlines */ +a:link +{ + color: navy; + text-decoration: underline; +} +a:visited +{ + color: maroon; + text-decoration: underline; +} + +/*** Summary formats ***/ + +.summary +{ + display: flex; + flex-flow: row wrap; + max-width: 100%; + justify-content: flex-start; +} + +.summary > table +{ + flex: 1 0 7em; + border: 0; +} + +.summary > :last-child { + margin-left: auto; +} + +table.legend +{ + color: black; + display: flex; + flex-flow: row wrap; + justify-content: flex-start; +} + +table.legend th[scope=row] +{ + font-weight: normal; + text-align: right; + white-space: nowrap; +} + +table.legend td +{ + color: blue; + text-align: left; + white-space: nowrap; + padding-left: 5px; +} + +table.legend td.legend +{ + color: black; + font-size: 80%; +} + +table.legend td.warning_text +{ + color: var(--warning_color); +} + +table.coverage td, +table.coverage th +{ + text-align: right; + color: black; + font-weight: normal; + white-space: nowrap; + padding-left: 5px; + padding-right: 4px; +} + +table.coverage td +{ + background-color: LightSteelBlue; +} + +table.coverage th[scope=row] +{ + color: black; + font-weight: normal; + white-space: nowrap; +} + +table.coverage th[scope=col] +{ + color: blue; + font-weight: normal; + white-space: nowrap; +} + +table.legend span +{ + margin-right: 4px; + padding: 2px; +} + +table.legend span.coverage-unknown, +table.legend span.coverage-none, +table.legend span.coverage-low, +table.legend span.coverage-medium, +table.legend span.coverage-high +{ + padding-left: 3px; + padding-right: 3px; +} + +table.legend span.coverage-unknown, +table.coverage td.coverage-unknown, +table.file-list td.coverage-unknown +{ + background-color: var(--unknown_color) !important; +} + +table.legend span.coverage-none, +table.legend span.coverage-low, +table.coverage td.coverage-none, +table.coverage td.coverage-low, +table.file-list td.coverage-none, +table.file-list td.coverage-low +{ + background-color: var(--low_color) !important; +} + +table.legend span.coverage-medium, +table.coverage td.coverage-medium, +table.file-list td.coverage-medium +{ + background-color: var(--medium_color) !important; +} + +table.legend span.coverage-high, +table.coverage td.coverage-high, +table.file-list td.coverage-high +{ + background-color: var(--high_color) !important; +} +/*** End of Summary formats ***/ +/*** Meter formats ***/ + +/* Common */ +meter { + -moz-appearance: none; + + width: 30vw; + min-width: 4em; + max-width: 15em; + height: 0.75em; + padding: 0; + vertical-align: baseline; + margin-top: 3px; + /* Outer background for Mozilla */ + background: none; + background-color: whitesmoke; +} + +/* Webkit */ + +meter::-webkit-meter-bar { + /* Outer background for Webkit */ + background: none; + background-color: whitesmoke; + height: 0.75em; + border-radius: 0px; +} + +meter::-webkit-meter-optimum-value, +meter::-webkit-meter-suboptimum-value, +meter::-webkit-meter-even-less-good-value +{ + /* Inner shadow for Webkit */ + border: solid 1px black; +} + +meter.coverage-none::-webkit-meter-optimum-value, +meter.coverage-low::-webkit-meter-optimum-value +{ + background: var(--low_color); +} + +meter.coverage-medium::-webkit-meter-optimum-value +{ + background: var(--medium_color); +} + +meter.coverage-high::-webkit-meter-optimum-value +{ + background: var(--high_color); +} + +/* Mozilla */ + +meter::-moz-meter-bar +{ + box-sizing: border-box; +} + +meter:-moz-meter-optimum::-moz-meter-bar, +meter:-moz-meter-sub-optimum::-moz-meter-bar, +meter:-moz-meter-sub-sub-optimum::-moz-meter-bar +{ + /* Inner shadow for Mozilla */ + border: solid 1px black; +} + +meter.coverage-none:-moz-meter-optimum::-moz-meter-bar, +meter.coverage-low:-moz-meter-optimum::-moz-meter-bar +{ + background: var(--low_color); +} + +meter.coverage-medium:-moz-meter-optimum::-moz-meter-bar +{ + background: var(--medium_color); +} + +meter.coverage-high:-moz-meter-optimum::-moz-meter-bar +{ + background: var(--high_color); +} + +/*** End of Meter formats ***/ +.file-list td, .file-list th { + padding: 0 10px; + font-weight: bold; +} + +.file-list th[scope^=col] +{ + text-align: center; + color: white; + background-color: SteelBlue; + font-size: 120%; +} + +.file-list th[scope=row] +{ + text-align: left; + color: black; + font-family: monospace; + font-weight: bold; + font-size: 110%; +} + +.file-list tr > td, +.file-list tr > th { + background: aliceblue; +} + +.file-list tr:nth-child(even) > td, +.file-list tr:nth-child(even) > th { + background: LightSteelBlue +} + +.file-list tr:hover > td, +.file-list tr:hover > th[scope=row] +{ + background-color: #ddd; +} +td.CoverValue +{ + text-align: right; + white-space: nowrap; +} + +td.coveredLine, +span.coveredLine +{ + background-color: var(--covered_color) !important; +} + +td.partialCoveredLine, +span.partialCoveredLine +{ + background-color: var(--partial_covered_color) !important; +} + +td.uncoveredLine, +span.uncoveredLine +{ + background-color: var(--uncovered_color) !important; +} + +td.excludedLine, +span.excludedLine +{ + background-color: var(--excluded_color) !important; +} + +.linebranch, .linecondition, .linedecision, .linecall, .linecount +{ + font-family: monospace; + border-right: 1px gray solid; + background-color: lightgray; + text-align: right; +} + + +.linebranchDetails, .lineconditionDetails, .linedecisionDetails, .linecallDetails +{ + position: relative; +} +.linebranchSummary, .lineconditionSummary, .linedecisionSummary, .linecallSummary +{ + cursor: help; +} +.linebranchContents, .lineconditionContents, .linedecisionContents, .linecallContents +{ + font-family: sans-serif; + font-size: small; + text-align: left; + position: absolute; + width: 15em; + padding: 1em; + background: white; + border: solid gray 1px; + box-shadow: 5px 5px 10px gray; + z-index: 1; /* show in front of the table entries */ +} + +.excludedBranch +{ + color: var(--takenBranch_color) !important; +} + +.takenBranch +{ + color: var(--takenBranch_color) !important; +} + +.notTakenBranch +{ + color: var(--notTakenBranch_color) !important; +} + +.takenCondition +{ + color: var(--takenCondition_color) !important; +} + +.notTakenCondition +{ + color: var(--notTakenCondition_color) !important; +} + +.takenDecision +{ + color: var(--takenDecision_color) !important; +} + +.notTakenDecision +{ + color: var(--notTakenDecision_color) !important; +} + +.uncheckedDecision +{ + color: var(--uncheckedDecision_color) !important; +} + +.invokedCall +{ + color: var(--invokedCall_color) !important; +} + +.notInvokedCall +{ + color: var(--notInvokedCall_color) !important; +} + +.src +{ + padding-left: 12px; + text-align: left; + + font-family: monospace; + white-space: pre; + + tab-size: var(--tab_size); + -moz-tab-size: var(--tab_size); +} + +span.takenBranch, +span.notTakenBranch, +span.takenDecision, +span.notTakenDecision, +span.uncheckedDecision +{ + font-family: monospace; + font-weight: bold; +} + +pre +{ + height : 15px; + margin-top: 0; + margin-bottom: 0; +} + +.listOfFunctions td, .listOfFunctions th { + padding: 0 10px; +} +.listOfFunctions th +{ + text-align: center; + color: white; + background-color: SteelBlue; +} +.listOfFunctions tr > td { + background: aliceblue; +} +.listOfFunctions tr:nth-child(even) > td { + background: LightSteelBlue +} +.listOfFunctions tr:hover > td +{ + background-color: #ddd; +} +.listOfFunctions tr > td > a +{ + text-decoration: none; + color: inherit; +} + +.source-line +{ + height : 15px; + margin-top: 0; + margin-bottom: 0; +} + +.lineno +{ + background-color: #EFE383; + border-right: 1px solid #BBB15F; + text-align: right; + unicode-bidi: embed; + font-family: monospace; + white-space: pre; +} + +.lineno > a +{ + text-decoration: none; + color: inherit; +} + +.file-list +{ + margin: 1em auto; + border: 0; + border-spacing: 1px; +} + +.file-source table +{ + border-spacing: 0; +} + +.file-source table td, +.file-source table th +{ + padding: 1px 10px; +} + +.file-source table th +{ + font-family: monospace; + font-weight: bold; +} + +.file-source table td:last-child +{ + width: 100%; +} +footer +{ + text-align: center; + padding-top: 3px; +} + +/* pygments syntax highlighting */ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.hll { background-color: #ffffcc } +.c { color: #3D7B7B; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ +.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ +.cp { color: #9C6500 } /* Comment.Preproc */ +.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ +.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ +.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #E40000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #008400 } /* Generic.Inserted */ +.go { color: #717171 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #687822 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #717171; font-weight: bold } /* Name.Entity */ +.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #767600 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mb { color: #666666 } /* Literal.Number.Bin */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sa { color: #BA2121 } /* Literal.String.Affix */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.dl { color: #BA2121 } /* Literal.String.Delimiter */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #A45A77 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.fm { color: #0000FF } /* Name.Function.Magic */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.vm { color: #19177C } /* Name.Variable.Magic */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.4075e2e30d85444ccf61b19e881c5ff8.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.4075e2e30d85444ccf61b19e881c5ff8.html new file mode 100644 index 000000000..5398f45bc --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.4075e2e30d85444ccf61b19e881c5ff8.html @@ -0,0 +1,792 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/dc_cable_check.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:84418.2%
Functions:1333.3%
Branches:55010.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_cable_check.hpp>
4 + #include <iso15118/d20/state/dc_pre_charge.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/dc_cable_check.hpp>
8 + #include <iso15118/detail/d20/state/session_stop.hpp>
9 + #include <iso15118/detail/helper.hpp>
10 +
11 + namespace iso15118::d20::state {
12 +
13 + namespace dt = message_20::datatypes;
14 +
15 + 6message_20::DC_CableCheckResponse handle_request(const message_20::DC_CableCheckRequest& req,
16 + const d20::Session& session, bool cable_check_done) {
17 +
18 + 6 message_20::DC_CableCheckResponse res;
19 +
20 +
+ 3/4 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 4 times.
+
+
+
6 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
21 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
22 + }
23 +
24 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (not cable_check_done) {
25 + 2 res.processing = dt::Processing::Ongoing;
26 + } else {
27 + 2 res.processing = dt::Processing::Finished;
28 + }
29 +
30 + 4 return response_with_code(res, dt::ResponseCode::OK);
31 + }
32 +
33 + void DC_CableCheck::enter() {
34 + ctx.log.enter_state("DC_CableCheck");
35 + }
36 +
37 + FsmSimpleState::HandleEventReturnType DC_CableCheck::handle_event(AllocatorType& sa, FsmEvent ev) {
38 +
39 + if (ev == FsmEvent::CONTROL_MESSAGE) {
40 + const auto control_data = ctx.get_control_event<CableCheckFinished>();
41 + if (not control_data) {
42 + // Ignore control message
43 + return sa.HANDLED_INTERNALLY;
44 + }
45 +
46 + cable_check_done = *control_data;
47 +
48 + return sa.HANDLED_INTERNALLY;
49 + }
50 +
51 + if (ev != FsmEvent::V2GTP_MESSAGE) {
52 + return sa.PASS_ON;
53 + }
54 +
55 + const auto variant = ctx.pull_request();
56 +
57 + if (const auto req = variant->get_if<message_20::DC_CableCheckRequest>()) {
58 + if (not cable_check_initiated) {
59 + ctx.feedback.signal(session::feedback::Signal::START_CABLE_CHECK);
60 + cable_check_initiated = true;
61 + }
62 +
63 + const auto res = handle_request(*req, ctx.session, cable_check_done);
64 +
65 + ctx.respond(res);
66 +
67 + if (res.response_code >= dt::ResponseCode::FAILED) {
68 + ctx.session_stopped = true;
69 + return sa.PASS_ON;
70 + }
71 +
72 + if (cable_check_done) {
73 + return sa.create_simple<DC_PreCharge>(ctx);
74 + } else {
75 + return sa.HANDLED_INTERNALLY;
76 + }
77 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
78 + const auto res = handle_request(*req, ctx.session);
79 +
80 + ctx.respond(res);
81 + ctx.session_stopped = true;
82 +
83 + return sa.PASS_ON;
84 + } else {
85 + ctx.log("expected DC_CableCheckReq! But code type id: %d", variant->get_type());
86 +
87 + // Sequence Error
88 + const message_20::Type req_type = variant->get_type();
89 + send_sequence_error(req_type, ctx);
90 +
91 + ctx.session_stopped = true;
92 + return sa.PASS_ON;
93 + }
94 + }
95 +
96 + } // namespace iso15118::d20::state
97 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.f568fac84d18bec691ede92b6c94a36c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.f568fac84d18bec691ede92b6c94a36c.html new file mode 100644 index 000000000..afc1d901f --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_cable_check.cpp.f568fac84d18bec691ede92b6c94a36c.html @@ -0,0 +1,435 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/dc_cable_check.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:1919100.0%
Functions:55100.0%
Branches:3650.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/dc_cable_check.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_DC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + 2template <> void convert(const struct iso20_dc_DC_CableCheckReqType& in, DC_CableCheckRequest& out) {
15 + 2 convert(in.Header, out.header);
16 + 2}
17 +
18 + 2template <> void insert_type(VariantAccess& va, const struct iso20_dc_DC_CableCheckReqType& in) {
19 + 2 va.insert_type<DC_CableCheckRequest>(in);
20 + 2}
21 +
22 + 4template <> void convert(const DC_CableCheckResponse& in, struct iso20_dc_DC_CableCheckResType& out) {
23 + 4 init_iso20_dc_DC_CableCheckResType(&out);
24 + 4 convert(in.header, out.Header);
25 + 4 cb_convert_enum(in.response_code, out.ResponseCode);
26 + 4 cb_convert_enum(in.processing, out.EVSEProcessing);
27 + 4}
28 +
29 + 4template <> int serialize_to_exi(const DC_CableCheckResponse& in, exi_bitstream_t& out) {
30 + iso20_dc_exiDocument doc;
31 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 init_iso20_dc_exiDocument(&doc);
32 +
33 + 4 CB_SET_USED(doc.DC_CableCheckRes);
34 +
35 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 convert(in, doc.DC_CableCheckRes);
36 +
37 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
8 return encode_iso20_dc_exiDocument(&out, &doc);
38 + }
39 +
40 + 4template <> size_t serialize(const DC_CableCheckResponse& in, const io::StreamOutputView& out) {
41 + 4 return serialize_helper(in, out);
42 + }
43 +
44 + } // namespace iso15118::message_20
45 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.7b5387df383c056c19ab7b8b140bea74.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.7b5387df383c056c19ab7b8b140bea74.html new file mode 100644 index 000000000..9e1df472a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.7b5387df383c056c19ab7b8b140bea74.html @@ -0,0 +1,2192 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/dc_charge_loop.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:8114057.9%
Functions:7977.8%
Branches:4415428.6%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_charge_loop.hpp>
4 + #include <iso15118/d20/state/dc_welding_detection.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/dc_charge_loop.hpp>
8 + #include <iso15118/detail/d20/state/power_delivery.hpp>
9 + #include <iso15118/detail/helper.hpp>
10 +
11 + namespace iso15118::d20::state {
12 +
13 + namespace dt = message_20::datatypes;
14 +
15 + using Scheduled_DC_Req = dt::Scheduled_DC_CLReqControlMode;
16 + using Scheduled_BPT_DC_Req = dt::BPT_Scheduled_DC_CLReqControlMode;
17 + using Dynamic_DC_Req = dt::Dynamic_DC_CLReqControlMode;
18 + using Dynamic_BPT_DC_Req = dt::BPT_Dynamic_DC_CLReqControlMode;
19 +
20 + using Scheduled_DC_Res = dt::Scheduled_DC_CLResControlMode;
21 + using Scheduled_BPT_DC_Res = dt::BPT_Scheduled_DC_CLResControlMode;
22 + using Dynamic_DC_Res = dt::Dynamic_DC_CLResControlMode;
23 + using Dynamic_BPT_DC_Res = dt::BPT_Dynamic_DC_CLResControlMode;
24 +
25 + template <typename In, typename Out> void convert(Out& out, const In& in);
26 +
27 + 2template <> void convert(Scheduled_DC_Res& out, const d20::DcTransferLimits& in) {
28 + 2 out.max_charge_power = in.charge_limits.power.max;
29 + 2 out.min_charge_power = in.charge_limits.power.min;
30 + 2 out.max_charge_current = in.charge_limits.current.max;
31 + 2 out.max_voltage = in.voltage.max;
32 + 2}
33 +
34 + 2template <> void convert(Scheduled_BPT_DC_Res& out, const d20::DcTransferLimits& in) {
35 + 2 out.max_charge_power = in.charge_limits.power.max;
36 + 2 out.min_charge_power = in.charge_limits.power.min;
37 + 2 out.max_charge_current = in.charge_limits.current.max;
38 + 2 out.max_voltage = in.voltage.max;
39 + 2 out.min_voltage = in.voltage.min;
40 +
41 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (in.discharge_limits.has_value()) {
42 + 2 auto& discharge_limits = in.discharge_limits.value();
43 + 2 out.max_discharge_power = discharge_limits.power.max;
44 + 2 out.min_discharge_power = discharge_limits.power.min;
45 + 2 out.max_discharge_current = discharge_limits.current.max;
46 + }
47 + 2}
48 +
49 + 4template <> void convert(Dynamic_DC_Res& out, const d20::DcTransferLimits& in) {
50 + 4 out.max_charge_power = in.charge_limits.power.max;
51 + 4 out.min_charge_power = in.charge_limits.power.min;
52 + 4 out.max_charge_current = in.charge_limits.current.max;
53 + 4 out.max_voltage = in.voltage.max;
54 + 4}
55 +
56 + 4template <> void convert(Dynamic_BPT_DC_Res& out, const d20::DcTransferLimits& in) {
57 + 4 out.max_charge_power = in.charge_limits.power.max;
58 + 4 out.min_charge_power = in.charge_limits.power.min;
59 + 4 out.max_charge_current = in.charge_limits.current.max;
60 + 4 out.max_voltage = in.voltage.max;
61 + 4 out.min_voltage = in.voltage.min;
62 +
63 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 if (in.discharge_limits.has_value()) {
64 + 4 auto& discharge_limits = in.discharge_limits.value();
65 + 4 out.max_discharge_power = discharge_limits.power.max;
66 + 4 out.min_discharge_power = discharge_limits.power.min;
67 + 4 out.max_discharge_current = discharge_limits.current.max;
68 + }
69 + 4}
70 +
71 + namespace {
72 + template <typename T>
73 + 8void set_dynamic_parameters_in_res(T& res_mode, const UpdateDynamicModeParameters& parameters,
74 + uint64_t header_timestamp) {
75 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
8 if (parameters.departure_time) {
76 + 8 const auto departure_time = static_cast<uint64_t>(parameters.departure_time.value());
77 +
+ 1/2 +
+
✓ Branch 0 taken 4 times.
+
✗ Branch 1 not taken.
+
+
+
8 if (departure_time > header_timestamp) {
78 + 8 res_mode.departure_time = static_cast<uint32_t>(departure_time - header_timestamp);
79 + }
80 + }
81 + 8 res_mode.target_soc = parameters.target_soc;
82 + 8 res_mode.minimum_soc = parameters.min_soc;
83 + 8 res_mode.ack_max_delay = 30; // TODO(sl) what to send here and define 30 seconds as const
84 + 8}
85 + } // namespace
86 +
87 + 18message_20::DC_ChargeLoopResponse handle_request(const message_20::DC_ChargeLoopRequest& req,
88 + const d20::Session& session, const float present_voltage,
89 + const float present_current, const bool stop,
90 + const DcTransferLimits& dc_limits,
91 + const UpdateDynamicModeParameters& dynamic_parameters) {
92 +
93 + 18 message_20::DC_ChargeLoopResponse res;
94 +
95 +
+ 3/4 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 16 times.
+
+
+
18 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
96 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
97 + }
98 +
99 + 16 const auto selected_services = session.get_selected_services();
100 + 16 const auto selected_control_mode = selected_services.selected_control_mode;
101 + 16 const auto selected_energy_service = selected_services.selected_energy_service;
102 + 16 const auto selected_mobility_needs_mode = selected_services.selected_mobility_needs_mode;
103 +
104 +
+ 2/2 +
+
✓ Branch 1 taken 6 times.
+
✓ Branch 2 taken 10 times.
+
+
+
16 if (std::holds_alternative<Scheduled_DC_Req>(req.control_mode)) {
105 +
106 + // If the ev sends a false control mode or a false energy service other than the previous selected ones, then
107 + // the charger should terminate the session
108 +
+ 4/4 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
✓ Branch 3 taken 2 times.
+
+
+
6 if (selected_control_mode != dt::ControlMode::Scheduled or selected_energy_service != dt::ServiceCategory::DC) {
109 +
+ 1/2 +
+
✓ Branch 2 taken 4 times.
+
✗ Branch 3 not taken.
+
+
+
4 return response_with_code(res, dt::ResponseCode::FAILED);
110 + }
111 +
112 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& res_mode = res.control_mode.emplace<Scheduled_DC_Res>();
113 + 2 convert(res_mode, dc_limits);
114 +
115 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 8 times.
+
+
+
10 } else if (std::holds_alternative<Scheduled_BPT_DC_Req>(req.control_mode)) {
116 +
117 + // If the ev sends a false control mode or a false energy service other than the previous selected ones, then
118 + // the charger should terminate the session
119 +
+ 2/4 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
+
+
2 if (selected_control_mode != dt::ControlMode::Scheduled or
120 + selected_energy_service != dt::ServiceCategory::DC_BPT) {
121 + return response_with_code(res, dt::ResponseCode::FAILED);
122 + }
123 +
124 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (not dc_limits.discharge_limits.has_value()) {
125 + logf_error("Transfer mode is BPT, but only dc limits without discharge limits are provided!");
126 + return response_with_code(res, dt::ResponseCode::FAILED);
127 + }
128 +
129 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& res_mode = res.control_mode.emplace<Scheduled_BPT_DC_Res>();
130 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(res_mode, dc_limits);
131 +
132 +
+ 2/2 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 4 times.
+
+
+
8 } else if (std::holds_alternative<Dynamic_DC_Req>(req.control_mode)) {
133 +
134 + // If the ev sends a false control mode or a false energy service other than the previous selected ones, then
135 + // the charger should terminate the session
136 +
+ 2/4 +
+
✓ Branch 0 taken 4 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 4 times.
+
+
+
4 if (selected_control_mode != dt::ControlMode::Dynamic or selected_energy_service != dt::ServiceCategory::DC) {
137 + return response_with_code(res, dt::ResponseCode::FAILED);
138 + }
139 +
140 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 auto& res_mode = res.control_mode.emplace<Dynamic_DC_Res>();
141 + 4 convert(res_mode, dc_limits);
142 +
143 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (selected_mobility_needs_mode == dt::MobilityNeedsMode::ProvidedBySecc) {
144 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 set_dynamic_parameters_in_res(res_mode, dynamic_parameters, res.header.timestamp);
145 + }
146 +
147 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 } else if (std::holds_alternative<Dynamic_BPT_DC_Req>(req.control_mode)) {
148 +
149 + // If the ev sends a false control mode or a false energy service other than the previous selected ones, then
150 + // the charger should terminate the session
151 +
+ 2/4 +
+
✓ Branch 0 taken 4 times.
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 4 times.
+
+
+
4 if (selected_control_mode != dt::ControlMode::Dynamic or
152 + selected_energy_service != dt::ServiceCategory::DC_BPT) {
153 + return response_with_code(res, dt::ResponseCode::FAILED);
154 + }
155 +
156 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 if (not dc_limits.discharge_limits.has_value()) {
157 + logf_error("Transfer mode is BPT, but only dc limits without discharge limits are provided!");
158 + return response_with_code(res, dt::ResponseCode::FAILED);
159 + }
160 +
161 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 auto& res_mode = res.control_mode.emplace<Dynamic_BPT_DC_Res>();
162 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 convert(res_mode, dc_limits);
163 +
164 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (selected_mobility_needs_mode == dt::MobilityNeedsMode::ProvidedBySecc) {
165 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 set_dynamic_parameters_in_res(res_mode, dynamic_parameters, res.header.timestamp);
166 + }
167 + }
168 +
169 +
+ 1/2 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
+
+
12 res.present_voltage = dt::from_float(present_voltage);
170 +
+ 1/2 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
+
+
12 res.present_current = dt::from_float(present_current);
171 +
172 + // TODO(sl): Setting EvseStatus, MeterInfo, Receipt, *_limit_achieved
173 +
174 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 12 times.
+
+
+
12 if (stop) {
175 + res.status = {0, dt::EvseNotification::Terminate};
176 + }
177 +
178 +
+ 1/2 +
+
✓ Branch 2 taken 12 times.
+
✗ Branch 3 not taken.
+
+
+
12 return response_with_code(res, dt::ResponseCode::OK);
179 + 18}
180 +
181 + void DC_ChargeLoop::enter() {
182 + ctx.log.enter_state("DC_ChargeLoop");
183 + }
184 +
185 + FsmSimpleState::HandleEventReturnType DC_ChargeLoop::handle_event(AllocatorType& sa, FsmEvent ev) {
186 +
187 + if (ev == FsmEvent::CONTROL_MESSAGE) {
188 +
189 + if (const auto* control_data = ctx.get_control_event<PresentVoltageCurrent>()) {
190 + present_voltage = control_data->voltage;
191 + present_current = control_data->current;
192 + } else if (const auto* control_data = ctx.get_control_event<StopCharging>()) {
193 + stop = *control_data;
194 + } else if (const auto* control_data = ctx.get_control_event<UpdateDynamicModeParameters>()) {
195 + dynamic_parameters = *control_data;
196 + }
197 +
198 + // Ignore control message
199 + return sa.HANDLED_INTERNALLY;
200 + }
201 +
202 + if (ev != FsmEvent::V2GTP_MESSAGE) {
203 + return sa.PASS_ON;
204 + }
205 +
206 + const auto variant = ctx.pull_request();
207 +
208 + if (const auto req = variant->get_if<message_20::PowerDeliveryRequest>()) {
209 + const auto res = handle_request(*req, ctx.session);
210 +
211 + ctx.respond(res);
212 +
213 + if (res.response_code >= dt::ResponseCode::FAILED) {
214 + ctx.session_stopped = true;
215 + return sa.PASS_ON;
216 + }
217 +
218 + // Reset
219 + first_entry_in_charge_loop = true;
220 +
221 + // Todo(sl): React properly to Start, Stop, Standby and ScheduleRenegotiation
222 + if (req->charge_progress == dt::Progress::Stop) {
223 + ctx.feedback.signal(session::feedback::Signal::CHARGE_LOOP_FINISHED);
224 + ctx.feedback.signal(session::feedback::Signal::DC_OPEN_CONTACTOR);
225 + return sa.create_simple<DC_WeldingDetection>(ctx);
226 + }
227 +
228 + return sa.HANDLED_INTERNALLY;
229 + } else if (const auto req = variant->get_if<message_20::DC_ChargeLoopRequest>()) {
230 + if (first_entry_in_charge_loop) {
231 + ctx.feedback.signal(session::feedback::Signal::CHARGE_LOOP_STARTED);
232 + first_entry_in_charge_loop = false;
233 + }
234 +
235 + const auto res = handle_request(*req, ctx.session, present_voltage, present_current, stop,
236 + ctx.session_config.dc_limits, dynamic_parameters);
237 +
238 + ctx.respond(res);
239 +
240 + if (res.response_code >= dt::ResponseCode::FAILED) {
241 + ctx.session_stopped = true;
242 + return sa.PASS_ON;
243 + }
244 +
245 + ctx.feedback.dc_charge_loop_req(req->control_mode);
246 + ctx.feedback.dc_charge_loop_req(req->present_voltage);
247 + ctx.feedback.dc_charge_loop_req(req->meter_info_requested);
248 + if (req->display_parameters) {
249 + ctx.feedback.dc_charge_loop_req(*req->display_parameters);
250 + }
251 +
252 + return sa.HANDLED_INTERNALLY;
253 + } else {
254 + ctx.log("Expected PowerDeliveryReq or DC_ChargeLoopReq! But code type id: %d", variant->get_type());
255 +
256 + // Sequence Error
257 + const message_20::Type req_type = variant->get_type();
258 + send_sequence_error(req_type, ctx);
259 +
260 + ctx.session_stopped = true;
261 + return sa.PASS_ON;
262 + }
263 + }
264 +
265 + } // namespace iso15118::d20::state
266 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.ca2976ccf99c866876af27e0ebc46805.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.ca2976ccf99c866876af27e0ebc46805.html new file mode 100644 index 000000000..87820d35a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_loop.cpp.ca2976ccf99c866876af27e0ebc46805.html @@ -0,0 +1,2240 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/dc_charge_loop.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:8917750.3%
Functions:133240.6%
Branches:3611032.7%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/dc_charge_loop.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_DC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + 2template <> void convert(const struct iso20_dc_DisplayParametersType& in, datatypes::DisplayParameters& out) {
15 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.PresentSOC, out.present_soc);
16 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.MinimumSOC, out.min_soc);
17 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.TargetSOC, out.target_soc);
18 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.MaximumSOC, out.max_soc);
19 +
20 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToMinimumSOC, out.remaining_time_to_min_soc);
21 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToTargetSOC, out.remaining_time_to_target_soc);
22 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.RemainingTimeToMaximumSOC, out.remaining_time_to_max_soc);
23 +
24 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.ChargingComplete, out.charging_complete);
25 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.BatteryEnergyCapacity, out.battery_energy_capacity);
26 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.InletHot, out.inlet_hot);
27 + 2}
28 +
29 + // FIXME (aw): this should go to common.cpp
30 + 4template <typename InType> void convert(const InType& in, datatypes::Scheduled_CLReqControlMode& out) {
31 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVTargetEnergyRequest, out.target_energy_request);
32 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMaximumEnergyRequest, out.max_energy_request);
33 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMinimumEnergyRequest, out.min_energy_request);
34 + 4}
35 +
36 + 4template <typename InType> void convert(const InType& in, datatypes::Scheduled_DC_CLReqControlMode& out) {
37 + static_assert(std::is_same_v<InType, iso20_dc_Scheduled_DC_CLReqControlModeType> or
38 + std::is_same_v<InType, iso20_dc_BPT_Scheduled_DC_CLReqControlModeType>);
39 + 4 convert(in, static_cast<datatypes::Scheduled_CLReqControlMode&>(out));
40 +
41 + 4 convert(in.EVTargetCurrent, out.target_current);
42 + 4 convert(in.EVTargetVoltage, out.target_voltage);
43 +
44 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMaximumChargePower, out.max_charge_power);
45 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMinimumChargePower, out.min_charge_power);
46 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMaximumChargeCurrent, out.max_charge_current);
47 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMaximumVoltage, out.max_voltage);
48 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.EVMinimumVoltage, out.min_voltage);
49 + 4}
50 +
51 + template <>
52 + void convert(const struct iso20_dc_BPT_Scheduled_DC_CLReqControlModeType& in,
53 + datatypes::BPT_Scheduled_DC_CLReqControlMode& out) {
54 + convert(in, static_cast<datatypes::Scheduled_DC_CLReqControlMode&>(out));
55 +
56 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargePower, out.max_discharge_power);
57 + CB2CPP_CONVERT_IF_USED(in.EVMinimumDischargePower, out.min_discharge_power);
58 + CB2CPP_CONVERT_IF_USED(in.EVMaximumDischargeCurrent, out.max_discharge_current);
59 + }
60 +
61 + // FIXME (aw): this should go to common.cpp
62 + 4template <typename InType> void convert(const InType& in, datatypes::Dynamic_CLReqControlMode& out) {
63 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_ASSIGN_IF_USED(in.DepartureTime, out.departure_time);
64 + 4 convert(in.EVTargetEnergyRequest, out.target_energy_request);
65 + 4 convert(in.EVMaximumEnergyRequest, out.max_energy_request);
66 + 4 convert(in.EVMinimumEnergyRequest, out.min_energy_request);
67 + 4}
68 +
69 + 4template <typename InType> void convert(const InType& in, datatypes::Dynamic_DC_CLReqControlMode& out) {
70 + static_assert(std::is_same_v<InType, iso20_dc_Dynamic_DC_CLReqControlModeType> or
71 + std::is_same_v<InType, iso20_dc_BPT_Dynamic_DC_CLReqControlModeType>);
72 + 4 convert(in, static_cast<datatypes::Dynamic_CLReqControlMode&>(out));
73 +
74 + 4 convert(in.EVMaximumChargePower, out.max_charge_power);
75 + 4 convert(in.EVMinimumChargePower, out.min_charge_power);
76 + 4 convert(in.EVMaximumChargeCurrent, out.max_charge_current);
77 + 4 convert(in.EVMaximumVoltage, out.max_voltage);
78 + 4 convert(in.EVMinimumVoltage, out.min_voltage);
79 + 4}
80 +
81 + template <>
82 + void convert(const struct iso20_dc_BPT_Dynamic_DC_CLReqControlModeType& in,
83 + datatypes::BPT_Dynamic_DC_CLReqControlMode& out) {
84 + convert(in, static_cast<datatypes::Dynamic_DC_CLReqControlMode&>(out));
85 +
86 + convert(in.EVMaximumDischargePower, out.max_discharge_power);
87 + convert(in.EVMinimumDischargePower, out.min_discharge_power);
88 + convert(in.EVMaximumDischargeCurrent, out.max_discharge_current);
89 + CB2CPP_CONVERT_IF_USED(in.EVMaximumV2XEnergyRequest, out.max_v2x_energy_request);
90 + CB2CPP_CONVERT_IF_USED(in.EVMinimumV2XEnergyRequest, out.min_v2x_energy_request);
91 + }
92 +
93 + 4template <> void convert(const struct iso20_dc_DC_ChargeLoopReqType& in, DC_ChargeLoopRequest& out) {
94 + 4 convert(in.Header, out.header);
95 +
96 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 CB2CPP_CONVERT_IF_USED(in.DisplayParameters, out.display_parameters);
97 +
98 + 4 out.meter_info_requested = in.MeterInfoRequested;
99 +
100 + 4 convert(in.EVPresentVoltage, out.present_voltage);
101 +
102 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (in.Scheduled_DC_CLReqControlMode_isUsed) {
103 + 2 convert(in.Scheduled_DC_CLReqControlMode, out.control_mode.emplace<datatypes::Scheduled_DC_CLReqControlMode>());
104 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 } else if (in.BPT_Scheduled_DC_CLReqControlMode_isUsed) {
105 + convert(in.BPT_Scheduled_DC_CLReqControlMode,
106 + out.control_mode.emplace<datatypes::BPT_Scheduled_DC_CLReqControlMode>());
107 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (in.Dynamic_DC_CLReqControlMode_isUsed) {
108 + 2 convert(in.Dynamic_DC_CLReqControlMode, out.control_mode.emplace<datatypes::Dynamic_DC_CLReqControlMode>());
109 + } else if (in.BPT_Dynamic_DC_CLReqControlMode_isUsed) {
110 + convert(in.BPT_Dynamic_DC_CLReqControlMode,
111 + out.control_mode.emplace<datatypes::BPT_Dynamic_DC_CLReqControlMode>());
112 + } else {
113 + // should not happen
114 + assert(false);
115 + }
116 + 4}
117 +
118 + 4template <> void insert_type(VariantAccess& va, const struct iso20_dc_DC_ChargeLoopReqType& in) {
119 + 4 va.insert_type<DC_ChargeLoopRequest>(in);
120 + 4}
121 +
122 + template <> void convert(const datatypes::DetailedCost& in, struct iso20_dc_DetailedCostType& out) {
123 + init_iso20_dc_DetailedCostType(&out);
124 + convert(in.amount, out.Amount);
125 + convert(in.cost_per_unit, out.CostPerUnit);
126 + }
127 +
128 + template <> void convert(const datatypes::DetailedTax& in, struct iso20_dc_DetailedTaxType& out) {
129 + init_iso20_dc_DetailedTaxType(&out);
130 + out.TaxRuleID = in.tax_rule_id;
131 + convert(in.amount, out.Amount);
132 + }
133 +
134 + template <> void convert(const datatypes::Receipt& in, struct iso20_dc_ReceiptType& out) {
135 + init_iso20_dc_ReceiptType(&out);
136 +
137 + out.TimeAnchor = in.time_anchor;
138 + CPP2CB_CONVERT_IF_USED(in.energy_costs, out.EnergyCosts);
139 + CPP2CB_CONVERT_IF_USED(in.occupany_costs, out.OccupancyCosts);
140 + CPP2CB_CONVERT_IF_USED(in.additional_service_costs, out.AdditionalServicesCosts);
141 + CPP2CB_CONVERT_IF_USED(in.overstay_costs, out.OverstayCosts);
142 +
143 + if (sizeof(out.TaxCosts.array) < in.tax_costs.size()) {
144 + throw std::runtime_error("tax costs array is too large");
145 + }
146 + for (std::size_t i = 0; i < in.tax_costs.size(); ++i) {
147 + convert(in.tax_costs[i], out.TaxCosts.array[i]);
148 + }
149 + out.TaxCosts.arrayLen = in.tax_costs.size();
150 + }
151 +
152 + 4template <typename cb_Type> void convert(const datatypes::Scheduled_DC_CLResControlMode& in, cb_Type& out) {
153 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.max_charge_power, out.EVSEMaximumChargePower);
154 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.min_charge_power, out.EVSEMinimumChargePower);
155 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.max_charge_current, out.EVSEMaximumChargeCurrent);
156 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.max_voltage, out.EVSEMaximumVoltage);
157 + 4}
158 +
159 + template <typename cb_Type> void convert(const datatypes::Dynamic_CLResControlMode& in, cb_Type& out) {
160 + CPP2CB_ASSIGN_IF_USED(in.departure_time, out.DepartureTime);
161 + CPP2CB_ASSIGN_IF_USED(in.minimum_soc, out.MinimumSOC);
162 + CPP2CB_ASSIGN_IF_USED(in.target_soc, out.TargetSOC);
163 + CPP2CB_ASSIGN_IF_USED(in.ack_max_delay, out.AckMaxDelay);
164 + }
165 +
166 + template <>
167 + void convert(const datatypes::BPT_Scheduled_DC_CLResControlMode& in,
168 + struct iso20_dc_BPT_Scheduled_DC_CLResControlModeType& out) {
169 + convert(static_cast<const datatypes::Scheduled_DC_CLResControlMode&>(in), out);
170 +
171 + CPP2CB_CONVERT_IF_USED(in.max_discharge_power, out.EVSEMaximumDischargePower);
172 + CPP2CB_CONVERT_IF_USED(in.min_discharge_power, out.EVSEMinimumDischargePower);
173 + CPP2CB_CONVERT_IF_USED(in.max_discharge_current, out.EVSEMaximumDischargePower);
174 + CPP2CB_CONVERT_IF_USED(in.min_voltage, out.EVSEMinimumVoltage);
175 + }
176 +
177 + template <typename cb_Type> void convert(const datatypes::Dynamic_DC_CLResControlMode& in, cb_Type& out) {
178 + convert(static_cast<const datatypes::Dynamic_CLResControlMode&>(in), out);
179 +
180 + convert(in.max_charge_power, out.EVSEMaximumChargePower);
181 + convert(in.min_charge_power, out.EVSEMinimumChargePower);
182 + convert(in.max_charge_current, out.EVSEMaximumChargePower);
183 + convert(in.max_voltage, out.EVSEMaximumVoltage);
184 + }
185 +
186 + template <>
187 + void convert(const datatypes::BPT_Dynamic_DC_CLResControlMode& in,
188 + struct iso20_dc_BPT_Dynamic_DC_CLResControlModeType& out) {
189 + convert(static_cast<const datatypes::Dynamic_DC_CLResControlMode&>(in), out);
190 +
191 + convert(in.max_discharge_power, out.EVSEMaximumDischargePower);
192 + convert(in.min_discharge_power, out.EVSEMinimumDischargePower);
193 + convert(in.max_discharge_current, out.EVSEMaximumDischargeCurrent);
194 + convert(in.min_voltage, out.EVSEMinimumVoltage);
195 + }
196 +
197 + struct ControlModeVisitor {
198 + using ScheduledCM = datatypes::Scheduled_DC_CLResControlMode;
199 + using BPT_ScheduledCM = datatypes::BPT_Scheduled_DC_CLResControlMode;
200 + using DynamicCM = datatypes::Dynamic_DC_CLResControlMode;
201 + using BPT_DynamicCM = datatypes::BPT_Dynamic_DC_CLResControlMode;
202 +
203 + 2 ControlModeVisitor(iso20_dc_DC_ChargeLoopResType& res_) : res(res_){};
204 + 2 void operator()(const ScheduledCM& in) {
205 + 2 auto& out = res.Scheduled_DC_CLResControlMode;
206 + 2 init_iso20_dc_Scheduled_DC_CLResControlModeType(&out);
207 + 2 convert(in, out);
208 + 2 CB_SET_USED(res.Scheduled_DC_CLResControlMode);
209 + 2 }
210 + void operator()(const BPT_ScheduledCM& in) {
211 + auto& out = res.BPT_Scheduled_DC_CLResControlMode;
212 + init_iso20_dc_BPT_Scheduled_DC_CLResControlModeType(&out);
213 + convert(in, out);
214 + CB_SET_USED(res.BPT_Scheduled_DC_CLResControlMode);
215 + }
216 + void operator()(const DynamicCM& in) {
217 + auto& out = res.Dynamic_DC_CLResControlMode;
218 + init_iso20_dc_Dynamic_DC_CLResControlModeType(&out);
219 + convert(in, out);
220 + CB_SET_USED(res.Dynamic_DC_CLResControlMode);
221 + }
222 + void operator()(const BPT_DynamicCM& in) {
223 + auto& out = res.BPT_Dynamic_DC_CLResControlMode;
224 + init_iso20_dc_BPT_Dynamic_DC_CLResControlModeType(&out);
225 + convert(in, out);
226 + CB_SET_USED(res.BPT_Dynamic_DC_CLResControlMode);
227 + }
228 +
229 + private:
230 + iso20_dc_DC_ChargeLoopResType& res;
231 + };
232 +
233 + 2template <> void convert(const DC_ChargeLoopResponse& in, struct iso20_dc_DC_ChargeLoopResType& out) {
234 + 2 init_iso20_dc_DC_ChargeLoopResType(&out);
235 + 2 convert(in.header, out.Header);
236 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
237 +
238 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_CONVERT_IF_USED(in.status, out.EVSEStatus);
239 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_CONVERT_IF_USED(in.meter_info, out.MeterInfo);
240 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_CONVERT_IF_USED(in.receipt, out.Receipt);
241 +
242 + 2 convert(in.present_current, out.EVSEPresentCurrent);
243 + 2 convert(in.present_voltage, out.EVSEPresentVoltage);
244 +
245 + 2 out.EVSEPowerLimitAchieved = in.power_limit_achieved;
246 + 2 out.EVSECurrentLimitAchieved = in.current_limit_achieved;
247 + 2 out.EVSEVoltageLimitAchieved = in.voltage_limit_achieved;
248 +
249 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 std::visit(ControlModeVisitor(out), in.control_mode);
250 + 2}
251 +
252 + 2template <> int serialize_to_exi(const DC_ChargeLoopResponse& in, exi_bitstream_t& out) {
253 + iso20_dc_exiDocument doc;
254 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_dc_exiDocument(&doc);
255 +
256 + 2 CB_SET_USED(doc.DC_ChargeLoopRes);
257 +
258 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.DC_ChargeLoopRes);
259 +
260 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_dc_exiDocument(&out, &doc);
261 + }
262 +
263 + 2template <> size_t serialize(const DC_ChargeLoopResponse& in, const io::StreamOutputView& out) {
264 + 2 return serialize_helper(in, out);
265 + }
266 +
267 + } // namespace iso15118::message_20
268 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.29560e38cc17c256e5fee4d3e5264db6.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.29560e38cc17c256e5fee4d3e5264db6.html new file mode 100644 index 000000000..b202b0f3a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.29560e38cc17c256e5fee4d3e5264db6.html @@ -0,0 +1,1256 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/dc_charge_parameter_discovery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:438252.4%
Functions:3560.0%
Branches:178619.8%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_charge_parameter_discovery.hpp>
4 + #include <iso15118/d20/state/schedule_exchange.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/dc_charge_parameter_discovery.hpp>
8 + #include <iso15118/detail/d20/state/session_stop.hpp>
9 + #include <iso15118/detail/helper.hpp>
10 +
11 + namespace iso15118::d20::state {
12 +
13 + namespace dt = message_20::datatypes;
14 +
15 + using DC_ModeReq = dt::DC_CPDReqEnergyTransferMode;
16 + using BPT_DC_ModeReq = dt::BPT_DC_CPDReqEnergyTransferMode;
17 +
18 + using DC_ModeRes = dt::DC_CPDResEnergyTransferMode;
19 + using BPT_DC_ModeRes = dt::BPT_DC_CPDResEnergyTransferMode;
20 +
21 + template <typename In, typename Out> void convert(Out& out, const In& in);
22 +
23 + 2template <> void convert(DC_ModeRes& out, const d20::DcTransferLimits& in) {
24 + 2 out.max_charge_power = in.charge_limits.power.max;
25 + 2 out.min_charge_power = in.charge_limits.power.min;
26 + 2 out.max_charge_current = in.charge_limits.current.max;
27 + 2 out.min_charge_current = in.charge_limits.current.min;
28 + 2 out.max_voltage = in.voltage.max;
29 + 2 out.min_voltage = in.voltage.min;
30 + 2 out.power_ramp_limit = in.power_ramp_limit;
31 + 2}
32 +
33 + 2template <> void convert(BPT_DC_ModeRes& out, const d20::DcTransferLimits& in) {
34 + 2 out.max_charge_power = in.charge_limits.power.max;
35 + 2 out.min_charge_power = in.charge_limits.power.min;
36 + 2 out.max_charge_current = in.charge_limits.current.max;
37 + 2 out.min_charge_current = in.charge_limits.current.min;
38 + 2 out.max_voltage = in.voltage.max;
39 + 2 out.min_voltage = in.voltage.min;
40 + 2 out.power_ramp_limit = in.power_ramp_limit;
41 +
42 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (in.discharge_limits.has_value()) {
43 + 2 auto& discharge_limits = in.discharge_limits.value();
44 + 2 out.max_discharge_power = discharge_limits.power.max;
45 + 2 out.min_discharge_power = discharge_limits.power.min;
46 + 2 out.max_discharge_current = discharge_limits.current.max;
47 + 2 out.min_discharge_current = discharge_limits.current.min;
48 + }
49 + 2}
50 +
51 + message_20::DC_ChargeParameterDiscoveryResponse
52 + 12handle_request(const message_20::DC_ChargeParameterDiscoveryRequest& req, const d20::Session& session,
53 + const d20::DcTransferLimits& dc_limits) {
54 +
55 + 12 message_20::DC_ChargeParameterDiscoveryResponse res;
56 +
57 +
+ 3/4 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 10 times.
+
+
+
12 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
58 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
59 + }
60 +
61 + 10 const auto selected_energy_service = session.get_selected_services().selected_energy_service;
62 +
63 +
+ 2/2 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 6 times.
+
+
+
10 if (std::holds_alternative<DC_ModeReq>(req.transfer_mode)) {
64 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (selected_energy_service != dt::ServiceCategory::DC) {
65 + 2 return response_with_code(res, dt::ResponseCode::FAILED_WrongChargeParameter);
66 + }
67 +
68 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& mode = res.transfer_mode.emplace<DC_ModeRes>();
69 + 2 convert(mode, dc_limits);
70 +
71 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 } else if (std::holds_alternative<BPT_DC_ModeReq>(req.transfer_mode)) {
72 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 4 times.
+
+
+
6 if (selected_energy_service != dt::ServiceCategory::DC_BPT) {
73 + 2 return response_with_code(res, dt::ResponseCode::FAILED_WrongChargeParameter);
74 + }
75 +
76 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
+
+
4 if (not dc_limits.discharge_limits.has_value()) {
77 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 logf_error("Transfer mode is BPT, but only dc limits without discharge limits are provided!");
78 + 2 return response_with_code(res, dt::ResponseCode::FAILED);
79 + }
80 +
81 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& mode = res.transfer_mode.emplace<BPT_DC_ModeRes>();
82 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(mode, dc_limits);
83 +
84 + } else {
85 + // Not supported transfer_mode
86 + return response_with_code(res, dt::ResponseCode::FAILED_WrongChargeParameter);
87 + }
88 +
89 + 4 return response_with_code(res, dt::ResponseCode::OK);
90 + }
91 +
92 + void DC_ChargeParameterDiscovery::enter() {
93 + ctx.log.enter_state("DC_ChargeParameterDiscovery");
94 + }
95 +
96 + FsmSimpleState::HandleEventReturnType DC_ChargeParameterDiscovery::handle_event(AllocatorType& sa, FsmEvent ev) {
97 + if (ev != FsmEvent::V2GTP_MESSAGE) {
98 + return sa.PASS_ON;
99 + }
100 +
101 + const auto variant = ctx.pull_request();
102 +
103 + if (const auto req = variant->get_if<message_20::DC_ChargeParameterDiscoveryRequest>()) {
104 +
105 + auto dc_max_limits = session::feedback::DcMaximumLimits{};
106 +
107 + if (const auto* mode = std::get_if<DC_ModeReq>(&req->transfer_mode)) {
108 + dc_max_limits.current = dt::from_RationalNumber(mode->max_charge_current);
109 + dc_max_limits.voltage = dt::from_RationalNumber(mode->max_voltage);
110 + dc_max_limits.power = dt::from_RationalNumber(mode->max_charge_power);
111 +
112 + logf_info("Max charge current %fA", dt::from_RationalNumber(mode->max_charge_current));
113 + } else if (const auto* mode = std::get_if<BPT_DC_ModeReq>(&req->transfer_mode)) {
114 + dc_max_limits.current = dt::from_RationalNumber(mode->max_charge_current);
115 + dc_max_limits.voltage = dt::from_RationalNumber(mode->max_voltage);
116 + dc_max_limits.power = dt::from_RationalNumber(mode->max_charge_power);
117 +
118 + logf_info("Max charge current %fA", dt::from_RationalNumber(mode->max_charge_current));
119 + logf_info("Max discharge current %fA", dt::from_RationalNumber(mode->max_discharge_current));
120 + }
121 +
122 + const auto res = handle_request(*req, ctx.session, ctx.session_config.dc_limits);
123 +
124 + ctx.respond(res);
125 +
126 + ctx.feedback.dc_max_limits(dc_max_limits);
127 +
128 + if (res.response_code >= dt::ResponseCode::FAILED) {
129 + ctx.session_stopped = true;
130 + return sa.PASS_ON;
131 + }
132 +
133 + return sa.create_simple<ScheduleExchange>(ctx);
134 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
135 + const auto res = handle_request(*req, ctx.session);
136 +
137 + ctx.respond(res);
138 + ctx.session_stopped = true;
139 +
140 + return sa.PASS_ON;
141 + } else {
142 + ctx.log("expected DC_ChargeParameterDiscovery! But code type id: %d", variant->get_type());
143 + ctx.session_stopped = true;
144 +
145 + // Sequence Error
146 + const message_20::Type req_type = variant->get_type();
147 + send_sequence_error(req_type, ctx);
148 +
149 + return sa.PASS_ON;
150 + }
151 + }
152 +
153 + } // namespace iso15118::d20::state
154 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.6240861adfbe13cf74b75bfb61940024.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.6240861adfbe13cf74b75bfb61940024.html new file mode 100644 index 000000000..2d045d4d5 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_charge_parameter_discovery.cpp.6240861adfbe13cf74b75bfb61940024.html @@ -0,0 +1,1100 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/dc_charge_parameter_discovery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:477661.8%
Functions:91275.0%
Branches:71838.9%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/dc_charge_parameter_discovery.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_DC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + using DC_ModeReq = datatypes::DC_CPDReqEnergyTransferMode;
15 + using BPT_DC_ModeReq = datatypes::BPT_DC_CPDReqEnergyTransferMode;
16 +
17 + using DC_ModeRes = datatypes::DC_CPDResEnergyTransferMode;
18 + using BPT_DC_ModeRes = datatypes::BPT_DC_CPDResEnergyTransferMode;
19 +
20 + 2template <> void convert(const struct iso20_dc_DC_CPDReqEnergyTransferModeType& in, DC_ModeReq& out) {
21 + 2 convert(in.EVMaximumChargePower, out.max_charge_power);
22 + 2 convert(in.EVMinimumChargePower, out.min_charge_power);
23 + 2 convert(in.EVMaximumChargeCurrent, out.max_charge_current);
24 + 2 convert(in.EVMinimumChargeCurrent, out.min_charge_current);
25 + 2 convert(in.EVMaximumVoltage, out.max_voltage);
26 + 2 convert(in.EVMinimumVoltage, out.min_voltage);
27 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.TargetSOC_isUsed) {
28 + out.target_soc = in.TargetSOC;
29 + }
30 + 2}
31 +
32 + template <> void convert(const struct iso20_dc_BPT_DC_CPDReqEnergyTransferModeType& in, BPT_DC_ModeReq& out) {
33 + convert(in.EVMaximumChargePower, out.max_charge_power);
34 + convert(in.EVMinimumChargePower, out.min_charge_power);
35 + convert(in.EVMaximumChargeCurrent, out.max_charge_current);
36 + convert(in.EVMinimumChargeCurrent, out.min_charge_current);
37 + convert(in.EVMaximumVoltage, out.max_voltage);
38 + convert(in.EVMinimumVoltage, out.min_voltage);
39 + if (in.TargetSOC_isUsed) {
40 + out.target_soc = in.TargetSOC;
41 + }
42 +
43 + convert(in.EVMaximumDischargePower, out.max_discharge_power);
44 + convert(in.EVMinimumDischargePower, out.min_discharge_power);
45 + convert(in.EVMaximumDischargeCurrent, out.max_discharge_current);
46 + convert(in.EVMinimumDischargeCurrent, out.min_discharge_current);
47 + }
48 +
49 + template <>
50 + 2void convert(const struct iso20_dc_DC_ChargeParameterDiscoveryReqType& in, DC_ChargeParameterDiscoveryRequest& out) {
51 + 2 convert(in.Header, out.header);
52 +
53 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 if (in.DC_CPDReqEnergyTransferMode_isUsed) {
54 + 2 auto& mode_out = out.transfer_mode.emplace<DC_ModeReq>();
55 + 2 convert(in.DC_CPDReqEnergyTransferMode, mode_out);
56 +
57 + } else if (in.BPT_DC_CPDReqEnergyTransferMode_isUsed) {
58 + auto& mode_out = out.transfer_mode.emplace<BPT_DC_ModeReq>();
59 + convert(in.BPT_DC_CPDReqEnergyTransferMode, mode_out);
60 + } else {
61 + // FIXME (aw): fail, should not happen!
62 + }
63 + 2}
64 +
65 + 2template <> void insert_type(VariantAccess& va, const struct iso20_dc_DC_ChargeParameterDiscoveryReqType& in) {
66 + 2 va.insert_type<DC_ChargeParameterDiscoveryRequest>(in);
67 + 2}
68 +
69 + struct ModeResponseVisitor {
70 + 2 ModeResponseVisitor(iso20_dc_DC_ChargeParameterDiscoveryResType& res_) : res(res_){};
71 + 2 void operator()(const DC_ModeRes& in) {
72 + 2 init_iso20_dc_DC_CPDResEnergyTransferModeType(&res.DC_CPDResEnergyTransferMode);
73 + 2 CB_SET_USED(res.DC_CPDResEnergyTransferMode);
74 +
75 + 2 convert_common(in, res.DC_CPDResEnergyTransferMode);
76 + 2 }
77 +
78 + void operator()(const BPT_DC_ModeRes& in) {
79 + init_iso20_dc_BPT_DC_CPDResEnergyTransferModeType(&res.BPT_DC_CPDResEnergyTransferMode);
80 + CB_SET_USED(res.BPT_DC_CPDResEnergyTransferMode);
81 +
82 + auto& out = res.BPT_DC_CPDResEnergyTransferMode;
83 +
84 + convert_common(in, out);
85 +
86 + convert(in.max_discharge_power, out.EVSEMaximumDischargePower);
87 + convert(in.min_discharge_power, out.EVSEMinimumDischargePower);
88 + convert(in.max_discharge_current, out.EVSEMaximumDischargeCurrent);
89 + convert(in.min_discharge_current, out.EVSEMinimumDischargeCurrent);
90 + }
91 +
92 + template <typename ModeResTypeIn, typename ModeResTypeOut>
93 + 4 static void convert_common(const ModeResTypeIn& in, ModeResTypeOut& out) {
94 + 4 convert(in.max_charge_power, out.EVSEMaximumChargePower);
95 + 4 convert(in.min_charge_power, out.EVSEMinimumChargePower);
96 + 4 convert(in.max_charge_current, out.EVSEMaximumChargeCurrent);
97 + 4 convert(in.min_charge_current, out.EVSEMinimumChargeCurrent);
98 + 4 convert(in.max_voltage, out.EVSEMaximumVoltage);
99 + 4 convert(in.min_voltage, out.EVSEMinimumVoltage);
100 +
101 + 4 out.EVSEPowerRampLimitation_isUsed = in.power_ramp_limit.has_value();
102 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
4 if (in.power_ramp_limit) {
103 + convert(*in.power_ramp_limit, out.EVSEPowerRampLimitation);
104 + }
105 + 4 }
106 +
107 + private:
108 + iso20_dc_DC_ChargeParameterDiscoveryResType& res;
109 + };
110 +
111 + template <>
112 + 2void convert(const DC_ChargeParameterDiscoveryResponse& in, struct iso20_dc_DC_ChargeParameterDiscoveryResType& out) {
113 + 2 init_iso20_dc_DC_ChargeParameterDiscoveryResType(&out);
114 + 2 convert(in.header, out.Header);
115 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
116 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 std::visit(ModeResponseVisitor(out), in.transfer_mode);
117 + 2}
118 +
119 + 2template <> int serialize_to_exi(const DC_ChargeParameterDiscoveryResponse& in, exi_bitstream_t& out) {
120 + iso20_dc_exiDocument doc;
121 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_dc_exiDocument(&doc);
122 +
123 + 2 CB_SET_USED(doc.DC_ChargeParameterDiscoveryRes);
124 +
125 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.DC_ChargeParameterDiscoveryRes);
126 +
127 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_dc_exiDocument(&out, &doc);
128 + }
129 +
130 + 2template <> size_t serialize(const DC_ChargeParameterDiscoveryResponse& in, const io::StreamOutputView& out) {
131 + 2 return serialize_helper(in, out);
132 + }
133 +
134 + } // namespace iso15118::message_20
135 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.2361f3fdeaa3b1ea5cf5b3e7dd93375c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.2361f3fdeaa3b1ea5cf5b3e7dd93375c.html new file mode 100644 index 000000000..dc33ad9ad --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.2361f3fdeaa3b1ea5cf5b3e7dd93375c.html @@ -0,0 +1,722 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/dc_pre_charge.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:63815.8%
Functions:1333.3%
Branches:4488.3%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_pre_charge.hpp>
4 + #include <iso15118/d20/state/power_delivery.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/dc_pre_charge.hpp>
8 + #include <iso15118/detail/d20/state/session_stop.hpp>
9 + #include <iso15118/detail/helper.hpp>
10 +
11 + namespace iso15118::d20::state {
12 +
13 + namespace dt = message_20::datatypes;
14 +
15 + 4message_20::DC_PreChargeResponse handle_request(const message_20::DC_PreChargeRequest& req, const d20::Session& session,
16 + const float present_voltage) {
17 +
18 + 4 message_20::DC_PreChargeResponse res;
19 +
20 +
+ 3/4 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 2 times.
+
+
+
4 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
21 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
22 + }
23 +
24 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 res.present_voltage = dt::from_float(present_voltage);
25 +
26 + 2 return response_with_code(res, dt::ResponseCode::OK);
27 + }
28 +
29 + void DC_PreCharge::enter() {
30 + ctx.log.enter_state("DC_PreCharge");
31 + }
32 +
33 + FsmSimpleState::HandleEventReturnType DC_PreCharge::handle_event(AllocatorType& sa, FsmEvent ev) {
34 +
35 + if (ev == FsmEvent::CONTROL_MESSAGE) {
36 + const auto control_data = ctx.get_control_event<PresentVoltageCurrent>();
37 + if (not control_data) {
38 + // Ignore control message
39 + return sa.HANDLED_INTERNALLY;
40 + }
41 +
42 + present_voltage = control_data->voltage;
43 +
44 + return sa.HANDLED_INTERNALLY;
45 + }
46 +
47 + if (ev != FsmEvent::V2GTP_MESSAGE) {
48 + return sa.PASS_ON;
49 + }
50 +
51 + const auto variant = ctx.pull_request();
52 +
53 + if (const auto req = variant->get_if<message_20::DC_PreChargeRequest>()) {
54 + const auto res = handle_request(*req, ctx.session, present_voltage);
55 +
56 + ctx.feedback.dc_pre_charge_target_voltage(message_20::datatypes::from_RationalNumber(req->target_voltage));
57 +
58 + ctx.respond(res);
59 +
60 + if (res.response_code >= dt::ResponseCode::FAILED) {
61 + ctx.session_stopped = true;
62 + return sa.PASS_ON;
63 + }
64 +
65 + return sa.create_simple<PowerDelivery>(ctx);
66 +
67 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
68 + const auto res = handle_request(*req, ctx.session);
69 +
70 + ctx.respond(res);
71 + ctx.session_stopped = true;
72 +
73 + return sa.PASS_ON;
74 + } else {
75 + ctx.log("expected DC_PreChargeReq! But code type id: %d", variant->get_type());
76 +
77 + // Sequence Error
78 + const message_20::Type req_type = variant->get_type();
79 + send_sequence_error(req_type, ctx);
80 +
81 + ctx.session_stopped = true;
82 + return sa.PASS_ON;
83 + }
84 + }
85 +
86 + } // namespace iso15118::d20::state
87 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.9e46c5c49e83e576b8a1cb6b5a0aff91.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.9e46c5c49e83e576b8a1cb6b5a0aff91.html new file mode 100644 index 000000000..00bb797a9 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_pre_charge.cpp.9e46c5c49e83e576b8a1cb6b5a0aff91.html @@ -0,0 +1,470 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/dc_pre_charge.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:2222100.0%
Functions:55100.0%
Branches:3650.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/dc_pre_charge.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_DC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + 2template <> void convert(const struct iso20_dc_DC_PreChargeReqType& in, DC_PreChargeRequest& out) {
15 + 2 convert(in.Header, out.header);
16 +
17 + 2 cb_convert_enum(in.EVProcessing, out.processing);
18 + 2 convert(in.EVPresentVoltage, out.present_voltage);
19 + 2 convert(in.EVTargetVoltage, out.target_voltage);
20 + 2}
21 +
22 + 2template <> void insert_type(VariantAccess& va, const struct iso20_dc_DC_PreChargeReqType& in) {
23 + 2 va.insert_type<DC_PreChargeRequest>(in);
24 + 2}
25 +
26 + 2template <> void convert(const DC_PreChargeResponse& in, struct iso20_dc_DC_PreChargeResType& out) {
27 + 2 init_iso20_dc_DC_PreChargeResType(&out);
28 + 2 convert(in.header, out.Header);
29 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
30 +
31 + 2 convert(in.present_voltage, out.EVSEPresentVoltage);
32 + 2}
33 +
34 + 2template <> int serialize_to_exi(const DC_PreChargeResponse& in, exi_bitstream_t& out) {
35 + iso20_dc_exiDocument doc;
36 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_dc_exiDocument(&doc);
37 +
38 + 2 CB_SET_USED(doc.DC_PreChargeRes);
39 +
40 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.DC_PreChargeRes);
41 +
42 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_dc_exiDocument(&out, &doc);
43 + }
44 +
45 + 2template <> size_t serialize(const DC_PreChargeResponse& in, const io::StreamOutputView& out) {
46 + 2 return serialize_helper(in, out);
47 + }
48 +
49 + } // namespace iso15118::message_20
50 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.c2431b7c857e9785e7a41b24cca25797.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.c2431b7c857e9785e7a41b24cca25797.html new file mode 100644 index 000000000..ad5791624 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.c2431b7c857e9785e7a41b24cca25797.html @@ -0,0 +1,666 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/dc_welding_detection.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:63417.6%
Functions:1333.3%
Branches:44010.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_welding_detection.hpp>
4 + #include <iso15118/d20/state/session_stop.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/dc_welding_detection.hpp>
8 + #include <iso15118/detail/helper.hpp>
9 +
10 + namespace iso15118::d20::state {
11 +
12 + namespace dt = message_20::datatypes;
13 +
14 + 4message_20::DC_WeldingDetectionResponse handle_request(const message_20::DC_WeldingDetectionRequest& req,
15 + const d20::Session& session, const float present_voltage) {
16 + 4 message_20::DC_WeldingDetectionResponse res;
17 +
18 +
+ 3/4 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 2 times.
+
+
+
4 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
19 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
20 + }
21 +
22 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 res.present_voltage = dt::from_float(present_voltage);
23 +
24 + 2 return response_with_code(res, dt::ResponseCode::OK);
25 + }
26 +
27 + void DC_WeldingDetection::enter() {
28 + ctx.log.enter_state("DC_WeldingDetection");
29 + }
30 +
31 + FsmSimpleState::HandleEventReturnType DC_WeldingDetection::handle_event(AllocatorType& sa, FsmEvent ev) {
32 +
33 + if (ev == FsmEvent::CONTROL_MESSAGE) {
34 + const auto control_data = ctx.get_control_event<PresentVoltageCurrent>();
35 + if (not control_data) {
36 + // Ignore control message
37 + return sa.HANDLED_INTERNALLY;
38 + }
39 +
40 + present_voltage = control_data->voltage;
41 +
42 + return sa.HANDLED_INTERNALLY;
43 + }
44 +
45 + if (ev != FsmEvent::V2GTP_MESSAGE) {
46 + return sa.PASS_ON;
47 + }
48 +
49 + const auto variant = ctx.pull_request();
50 +
51 + if (const auto req = variant->get_if<message_20::DC_WeldingDetectionRequest>()) {
52 + const auto res = handle_request(*req, ctx.session, present_voltage);
53 +
54 + ctx.respond(res);
55 +
56 + if (res.response_code >= dt::ResponseCode::FAILED) {
57 + ctx.session_stopped = true;
58 + return sa.PASS_ON;
59 + }
60 +
61 + if (req->processing == dt::Processing::Ongoing) {
62 + return sa.HANDLED_INTERNALLY;
63 + }
64 +
65 + return sa.create_simple<SessionStop>(ctx);
66 + } else {
67 + ctx.log("expected DC_WeldingDetection! But code type id: %d", variant->get_type());
68 +
69 + // Sequence Error
70 + const message_20::Type req_type = variant->get_type();
71 + send_sequence_error(req_type, ctx);
72 +
73 + ctx.session_stopped = true;
74 + return sa.PASS_ON;
75 + }
76 + }
77 +
78 + } // namespace iso15118::d20::state
79 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.e9ca4c4ce86ce3c1e99636800506f51f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.e9ca4c4ce86ce3c1e99636800506f51f.html new file mode 100644 index 000000000..51944722d --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.dc_welding_detection.cpp.e9ca4c4ce86ce3c1e99636800506f51f.html @@ -0,0 +1,456 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/dc_welding_detection.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:2020100.0%
Functions:55100.0%
Branches:3650.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/dc_welding_detection.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
10 + #include <cbv2g/iso_20/iso20_DC_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + 2template <> void convert(const struct iso20_dc_DC_WeldingDetectionReqType& in, DC_WeldingDetectionRequest& out) {
15 + 2 convert(in.Header, out.header);
16 +
17 + 2 cb_convert_enum(in.EVProcessing, out.processing);
18 + 2}
19 +
20 + 2template <> void insert_type(VariantAccess& va, const struct iso20_dc_DC_WeldingDetectionReqType& in) {
21 + 2 va.insert_type<DC_WeldingDetectionRequest>(in);
22 + 2}
23 +
24 + 2template <> void convert(const DC_WeldingDetectionResponse& in, struct iso20_dc_DC_WeldingDetectionResType& out) {
25 + 2 init_iso20_dc_DC_WeldingDetectionResType(&out);
26 + 2 convert(in.header, out.Header);
27 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
28 +
29 + 2 convert(in.present_voltage, out.EVSEPresentVoltage);
30 + 2}
31 +
32 + 2template <> int serialize_to_exi(const DC_WeldingDetectionResponse& in, exi_bitstream_t& out) {
33 + iso20_dc_exiDocument doc;
34 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_dc_exiDocument(&doc);
35 +
36 + 2 CB_SET_USED(doc.DC_WeldingDetectionRes);
37 +
38 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.DC_WeldingDetectionRes);
39 +
40 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_dc_exiDocument(&out, &doc);
41 + }
42 +
43 + 2template <> size_t serialize(const DC_WeldingDetectionResponse& in, const io::StreamOutputView& out) {
44 + 2 return serialize_helper(in, out);
45 + }
46 +
47 + } // namespace iso15118::message_20
48 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.feedback.cpp.9d0826502c3fd46afe84f9211e112c1a.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.feedback.cpp.9d0826502c3fd46afe84f9211e112c1a.html new file mode 100644 index 000000000..5373ec76f --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.feedback.cpp.9d0826502c3fd46afe84f9211e112c1a.html @@ -0,0 +1,407 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/session/feedback.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:2323100.0%
Functions:88100.0%
Branches:4850.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/session/feedback.hpp>
4 +
5 + #include <iso15118/detail/helper.hpp>
6 +
7 + namespace iso15118::session {
8 +
9 + 24Feedback::Feedback(feedback::Callbacks callbacks_) : callbacks(std::move(callbacks_)) {
10 + 24}
11 +
12 + 2void Feedback::signal(feedback::Signal signal) const {
13 + 2 call_if_available(callbacks.signal, signal);
14 + 2}
15 +
16 + 2void Feedback::dc_pre_charge_target_voltage(float voltage) const {
17 + 2 call_if_available(callbacks.dc_pre_charge_target_voltage, voltage);
18 + 2}
19 +
20 + 10void Feedback::dc_charge_loop_req(const feedback::DcChargeLoopReq& req_values) const {
21 + 10 call_if_available(callbacks.dc_charge_loop_req, req_values);
22 + 10}
23 +
24 + 2void Feedback::dc_max_limits(const feedback::DcMaximumLimits& max_limits) const {
25 + 2 call_if_available(callbacks.dc_max_limits, max_limits);
26 + 2}
27 +
28 + 2void Feedback::v2g_message(const message_20::Type& v2g_message) const {
29 + 2 call_if_available(callbacks.v2g_message, v2g_message);
30 + 2}
31 +
32 + 2void Feedback::evcc_id(const std::string& evccid) const {
33 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 call_if_available(callbacks.evccid, evccid);
34 + 2}
35 +
36 + 2void Feedback::selected_protocol(const std::string& selected_protocol) const {
37 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 call_if_available(callbacks.selected_protocol, selected_protocol);
38 + 2}
39 +
40 + } // namespace iso15118::session
41 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.fsm.cpp.4a265c70ba8c7b2922596d16b6e19f5c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.fsm.cpp.4a265c70ba8c7b2922596d16b6e19f5c.html new file mode 100644 index 000000000..8a1ce7996 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.fsm.cpp.4a265c70ba8c7b2922596d16b6e19f5c.html @@ -0,0 +1,172 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/fsm.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:020.0%
Functions:010.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/fsm.hpp>
4 +
5 + namespace iso15118::d20 {
6 +
7 + Controller::Controller(Context&) {
8 + }
9 +
10 + } // namespace iso15118::d20
11 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.functions.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.functions.html new file mode 100644 index 000000000..18fb554c1 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.functions.html @@ -0,0 +1,659 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + +
Directory:./
Date:2024-12-09 13:28:44
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:1442343342.0%
Functions:28658149.2%
Branches:646318420.3%
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function (File:Line)Call countBlock coverage
bool iso15118::call_if_available<std::function<void (iso15118::io::ConnectionEvent)>, iso15118::io::ConnectionEvent>(std::function<void (iso15118::io::ConnectionEvent)> const&, iso15118::io::ConnectionEvent) (include/iso15118/detail/helper.hpp:33)not called0.0%
bool iso15118::cmp_equal<long, unsigned long>(long, unsigned long) (include/iso15118/detail/helper.hpp:43)not called0.0%
get_exi_input_stream(iso15118::io::StreamInputView const&) (src/iso15118/misc/cb_exi.cpp:5)called 36 times100.0%
get_exi_output_stream(iso15118::io::StreamOutputView const&) (src/iso15118/misc/cb_exi.cpp:12)called 40 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::AC_ChargeLoopResponse>(iso15118::message_20::AC_ChargeLoopResponse const&, exi_bitstream&) (src/iso15118/message/ac_charge_loop.cpp:281)not called0.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::AC_ChargeParameterDiscoveryResponse>(iso15118::message_20::AC_ChargeParameterDiscoveryResponse const&, exi_bitstream&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:118)not called0.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::AuthorizationResponse>(iso15118::message_20::AuthorizationResponse const&, exi_bitstream&) (src/iso15118/message/authorization.cpp:42)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::AuthorizationSetupResponse>(iso15118::message_20::AuthorizationSetupResponse const&, exi_bitstream&) (src/iso15118/message/authorization_setup.cpp:57)called 4 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::DC_CableCheckResponse>(iso15118::message_20::DC_CableCheckResponse const&, exi_bitstream&) (src/iso15118/message/dc_cable_check.cpp:29)called 4 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::message_20::DC_ChargeLoopResponse const&, exi_bitstream&) (src/iso15118/message/dc_charge_loop.cpp:252)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&, exi_bitstream&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:119)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::DC_PreChargeResponse>(iso15118::message_20::DC_PreChargeResponse const&, exi_bitstream&) (src/iso15118/message/dc_pre_charge.cpp:34)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::message_20::DC_WeldingDetectionResponse const&, exi_bitstream&) (src/iso15118/message/dc_welding_detection.cpp:32)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::PowerDeliveryResponse>(iso15118::message_20::PowerDeliveryResponse const&, exi_bitstream&) (src/iso15118/message/power_delivery.cpp:77)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::ScheduleExchangeResponse>(iso15118::message_20::ScheduleExchangeResponse const&, exi_bitstream&) (src/iso15118/message/schedule_exchange.cpp:352)called 6 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::ServiceDetailResponse>(iso15118::message_20::ServiceDetailResponse const&, exi_bitstream&) (src/iso15118/message/service_detail.cpp:183)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::message_20::ServiceDiscoveryResponse const&, exi_bitstream&) (src/iso15118/message/service_discovery.cpp:55)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::ServiceSelectionResponse>(iso15118::message_20::ServiceSelectionResponse const&, exi_bitstream&) (src/iso15118/message/service_selection.cpp:45)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::SessionSetupResponse>(iso15118::message_20::SessionSetupResponse const&, exi_bitstream&) (src/iso15118/message/session_setup.cpp:36)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::SessionStopResponse>(iso15118::message_20::SessionStopResponse const&, exi_bitstream&) (src/iso15118/message/session_stop.cpp:35)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::SupportedAppProtocolRequest>(iso15118::message_20::SupportedAppProtocolRequest const&, exi_bitstream&) (src/iso15118/message/supported_app_protocol.cpp:75)called 2 times100.0%
int iso15118::message_20::serialize_to_exi<iso15118::message_20::SupportedAppProtocolResponse>(iso15118::message_20::SupportedAppProtocolResponse const&, exi_bitstream&) (src/iso15118/message/supported_app_protocol.cpp:64)called 2 times100.0%
iso15118::Session::Session(std::unique_ptr<iso15118::io::IConnection, std::default_delete<iso15118::io::IConnection> >, iso15118::d20::SessionConfig, iso15118::session::feedback::Callbacks const&) (src/iso15118/session/iso.cpp:124)not called0.0%
iso15118::Session::Session(std::unique_ptr<iso15118::io::IConnection, std::default_delete<iso15118::io::IConnection> >, iso15118::d20::SessionConfig, iso15118::session::feedback::Callbacks const&)::{lambda(iso15118::io::ConnectionEvent)#1}::operator()(iso15118::io::ConnectionEvent) const (src/iso15118/session/iso.cpp:131)not called0.0%
iso15118::Session::handle_connection_event(iso15118::io::ConnectionEvent) (src/iso15118/session/iso.cpp:212)not called0.0%
iso15118::Session::is_finished() const (include/iso15118/session/iso.hpp:39)not called0.0%
iso15118::Session::poll() (src/iso15118/session/iso.cpp:141)not called0.0%
iso15118::Session::push_control_event(std::variant<iso15118::d20::CableCheckFinished, iso15118::d20::PresentVoltageCurrent, iso15118::d20::AuthorizationResponse, iso15118::d20::StopCharging, iso15118::d20::DcTransferLimits, iso15118::d20::UpdateDynamicModeParameters> const&) (src/iso15118/session/iso.cpp:137)not called0.0%
iso15118::Session::~Session() (src/iso15118/session/iso.cpp:135)not called0.0%
iso15118::TbdController::TbdController(iso15118::TbdConfig, iso15118::session::feedback::Callbacks, iso15118::d20::EvseSetupConfig) (src/iso15118/tbd_controller.cpp:18)not called0.0%
iso15118::TbdController::TbdController(iso15118::TbdConfig, iso15118::session::feedback::Callbacks, iso15118::d20::EvseSetupConfig)::{lambda()#1}::operator()() const (src/iso15118/tbd_controller.cpp:33)not called0.0%
iso15118::TbdController::handle_sdp_server_input() (src/iso15118/tbd_controller.cpp:96)not called0.0%
iso15118::TbdController::handle_sdp_server_input()::{lambda(bool)#1}::operator()(bool) const (src/iso15118/tbd_controller.cpp:115)not called0.0%
iso15118::TbdController::loop() (src/iso15118/tbd_controller.cpp:37)not called0.0%
iso15118::TbdController::send_control_event(std::variant<iso15118::d20::CableCheckFinished, iso15118::d20::PresentVoltageCurrent, iso15118::d20::AuthorizationResponse, iso15118::d20::StopCharging, iso15118::d20::DcTransferLimits, iso15118::d20::UpdateDynamicModeParameters> const&) (src/iso15118/tbd_controller.cpp:69)not called0.0%
iso15118::TbdController::update_authorization_services(std::vector<iso15118::message_20::datatypes::Authorization, std::allocator<iso15118::message_20::datatypes::Authorization> > const&, bool) (src/iso15118/tbd_controller.cpp:75)not called0.0%
iso15118::TbdController::update_dc_limits(iso15118::d20::DcTransferLimits const&) (src/iso15118/tbd_controller.cpp:87)not called0.0%
iso15118::adding_err_msg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/misc/helper.cpp:12)not called0.0%
iso15118::d20::(anonymous namespace)::get_default_dc_bpt_parameter_list(std::vector<iso15118::d20::ControlMobilityNeedsModes, std::allocator<iso15118::d20::ControlMobilityNeedsModes> > const&) (src/iso15118/d20/config.cpp:46)called 18 times80.0%
iso15118::d20::(anonymous namespace)::get_default_dc_parameter_list(std::vector<iso15118::d20::ControlMobilityNeedsModes, std::allocator<iso15118::d20::ControlMobilityNeedsModes> > const&) (src/iso15118/d20/config.cpp:27)called 18 times80.0%
iso15118::d20::(anonymous namespace)::get_mobility_needs_mode(iso15118::d20::ControlMobilityNeedsModes const&) (src/iso15118/d20/config.cpp:15)called 36 times67.0%
iso15118::d20::AuthorizationResponse const* iso15118::d20::Context::get_control_event<iso15118::d20::AuthorizationResponse>() (include/iso15118/d20/context.hpp:72)not called0.0%
iso15118::d20::AuthorizationResponse::operator bool() const (include/iso15118/d20/control_event.hpp:36)not called0.0%
iso15118::d20::CableCheckFinished const* iso15118::d20::Context::get_control_event<iso15118::d20::CableCheckFinished>() (include/iso15118/d20/context.hpp:72)not called0.0%
iso15118::d20::CableCheckFinished::operator bool() const (include/iso15118/d20/control_event.hpp:18)not called0.0%
iso15118::d20::Context::Context(iso15118::session::feedback::Callbacks, iso15118::session::SessionLogger&, iso15118::d20::SessionConfig, std::optional<std::variant<iso15118::d20::CableCheckFinished, iso15118::d20::PresentVoltageCurrent, iso15118::d20::AuthorizationResponse, iso15118::d20::StopCharging, iso15118::d20::DcTransferLimits, iso15118::d20::UpdateDynamicModeParameters> > const&, iso15118::d20::MessageExchange&) (src/iso15118/d20/context.cpp:54)called 2 times69.0%
iso15118::d20::Context::peek_request_type() const (src/iso15118/d20/context.cpp:68)not called0.0%
iso15118::d20::Context::pull_request() (src/iso15118/d20/context.cpp:64)called 2 times100.0%
iso15118::d20::ControlEventQueue::pop() (src/iso15118/d20/control_event_queue.cpp:7)not called0.0%
iso15118::d20::ControlEventQueue::push(std::variant<iso15118::d20::CableCheckFinished, iso15118::d20::PresentVoltageCurrent, iso15118::d20::AuthorizationResponse, iso15118::d20::StopCharging, iso15118::d20::DcTransferLimits, iso15118::d20::UpdateDynamicModeParameters>) (src/iso15118/d20/control_event_queue.cpp:20)not called0.0%
iso15118::d20::Controller::Controller(iso15118::d20::Context&) (src/iso15118/d20/fsm.cpp:7)not called0.0%
iso15118::d20::DcTransferLimits const* iso15118::d20::Context::get_control_event<iso15118::d20::DcTransferLimits>() (include/iso15118/d20/context.hpp:72)not called0.0%
iso15118::d20::MessageExchange::MessageExchange(iso15118::io::StreamOutputView) (src/iso15118/d20/context.cpp:16)called 2 times100.0%
iso15118::d20::MessageExchange::check_and_clear_response() (src/iso15118/d20/context.cpp:36)not called0.0%
iso15118::d20::MessageExchange::peek_request_type() const (src/iso15118/d20/context.cpp:46)not called0.0%
iso15118::d20::MessageExchange::pull_request() (src/iso15118/d20/context.cpp:28)called 2 times60.0%
iso15118::d20::MessageExchange::set_request(std::unique_ptr<iso15118::message_20::Variant, std::default_delete<iso15118::message_20::Variant> >) (src/iso15118/d20/context.cpp:19)called 2 times60.0%
iso15118::d20::PresentVoltageCurrent const* iso15118::d20::Context::get_control_event<iso15118::d20::PresentVoltageCurrent>() (include/iso15118/d20/context.hpp:72)not called0.0%
iso15118::d20::SelectedServiceParameters::SelectedServiceParameters() (include/iso15118/d20/session.hpp:39)called 118 times100.0%
iso15118::d20::SelectedServiceParameters::SelectedServiceParameters(iso15118::message_20::datatypes::ServiceCategory, iso15118::message_20::datatypes::DcConnector, iso15118::message_20::datatypes::ControlMode, iso15118::message_20::datatypes::MobilityNeedsMode, iso15118::message_20::datatypes::Pricing) (include/iso15118/d20/session.hpp:41)called 8 times100.0%
iso15118::d20::SelectedServiceParameters::SelectedServiceParameters(iso15118::message_20::datatypes::ServiceCategory, iso15118::message_20::datatypes::DcConnector, iso15118::message_20::datatypes::ControlMode, iso15118::message_20::datatypes::MobilityNeedsMode, iso15118::message_20::datatypes::Pricing, iso15118::message_20::datatypes::BptChannel, iso15118::message_20::datatypes::GeneratorMode) (include/iso15118/d20/session.hpp:54)called 2 times100.0%
iso15118::d20::Session::Session() (src/iso15118/d20/session.cpp:13)called 118 times70.0%
iso15118::d20::Session::Session(iso15118::d20::OfferedServices) (src/iso15118/d20/session.cpp:32)not called0.0%
iso15118::d20::Session::Session(iso15118::d20::SelectedServiceParameters) (src/iso15118/d20/session.cpp:23)called 32 times68.0%
iso15118::d20::Session::find_parameter_set_id(iso15118::message_20::datatypes::ServiceCategory, short) (src/iso15118/d20/session.cpp:44)called 18 times67.0%
iso15118::d20::Session::get_id() const (include/iso15118/d20/session.hpp:90)not called0.0%
iso15118::d20::Session::get_selected_services() const & (include/iso15118/d20/session.hpp:98)called 32 times100.0%
iso15118::d20::Session::selected_service_parameters(iso15118::message_20::datatypes::ServiceCategory, unsigned short) (src/iso15118/d20/session.cpp:82)called 14 times60.0%
iso15118::d20::Session::~Session() (src/iso15118/d20/session.cpp:42)called 150 times100.0%
iso15118::d20::SessionConfig::SessionConfig(iso15118::d20::EvseSetupConfig) (src/iso15118/d20/config.cpp:69)called 18 times52.0%
iso15118::d20::SessionConfig::SessionConfig(iso15118::d20::EvseSetupConfig)::{lambda(iso15118::message_20::datatypes::ServiceCategory)#1}::operator()(iso15118::message_20::datatypes::ServiceCategory) const (src/iso15118/d20/config.cpp:77)called 18 times100.0%
iso15118::d20::StopCharging::operator bool() const (include/iso15118/d20/control_event.hpp:49)not called0.0%
iso15118::d20::UpdateDynamicModeParameters const* iso15118::d20::Context::get_control_event<iso15118::d20::UpdateDynamicModeParameters>() (include/iso15118/d20/context.hpp:72)not called0.0%
iso15118::d20::create_message_exchange(unsigned char*, unsigned long) (src/iso15118/d20/context.cpp:11)not called0.0%
iso15118::d20::send_sequence_error(iso15118::message_20::Type, iso15118::d20::Context&) (src/iso15118/d20/context_helper.cpp:49)not called0.0%
iso15118::d20::setup_header(iso15118::message_20::Header&, iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:37)called 122 times100.0%
iso15118::d20::setup_timestamp(iso15118::message_20::Header&) (src/iso15118/d20/context_helper.cpp:25)called 122 times100.0%
iso15118::d20::state::(anonymous namespace)::(anonymous namespace)::set_dynamic_parameters_in_res(iso15118::message_20::datatypes::Dynamic_SEResControlMode&, iso15118::d20::UpdateDynamicModeParameters const&, unsigned long) (src/iso15118/d20/state/schedule_exchange.cpp:44)not called0.0%
iso15118::d20::state::(anonymous namespace)::create_default_scheduled_control_mode(iso15118::message_20::datatypes::RationalNumber const&) (src/iso15118/d20/state/schedule_exchange.cpp:24)called 2 times52.0%
iso15118::d20::state::Authorization::enter() (src/iso15118/d20/state/authorization.cpp:74)not called0.0%
iso15118::d20::state::Authorization::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/authorization.cpp:78)not called0.0%
iso15118::d20::state::AuthorizationSetup::enter() (src/iso15118/d20/state/authorization_setup.cpp:56)not called0.0%
iso15118::d20::state::AuthorizationSetup::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/authorization_setup.cpp:60)not called0.0%
iso15118::d20::state::DC_CableCheck::enter() (src/iso15118/d20/state/dc_cable_check.cpp:33)not called0.0%
iso15118::d20::state::DC_CableCheck::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/dc_cable_check.cpp:37)not called0.0%
iso15118::d20::state::DC_ChargeLoop::enter() (src/iso15118/d20/state/dc_charge_loop.cpp:181)not called0.0%
iso15118::d20::state::DC_ChargeLoop::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/dc_charge_loop.cpp:185)not called0.0%
iso15118::d20::state::DC_ChargeParameterDiscovery::enter() (src/iso15118/d20/state/dc_charge_parameter_discovery.cpp:92)not called0.0%
iso15118::d20::state::DC_ChargeParameterDiscovery::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/dc_charge_parameter_discovery.cpp:96)not called0.0%
iso15118::d20::state::DC_PreCharge::enter() (src/iso15118/d20/state/dc_pre_charge.cpp:29)not called0.0%
iso15118::d20::state::DC_PreCharge::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/dc_pre_charge.cpp:33)not called0.0%
iso15118::d20::state::DC_WeldingDetection::enter() (src/iso15118/d20/state/dc_welding_detection.cpp:27)not called0.0%
iso15118::d20::state::DC_WeldingDetection::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/dc_welding_detection.cpp:31)not called0.0%
iso15118::d20::state::PowerDelivery::enter() (src/iso15118/d20/state/power_delivery.cpp:35)not called0.0%
iso15118::d20::state::PowerDelivery::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/power_delivery.cpp:39)not called0.0%
iso15118::d20::state::ScheduleExchange::enter() (src/iso15118/d20/state/schedule_exchange.cpp:104)not called0.0%
iso15118::d20::state::ScheduleExchange::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/schedule_exchange.cpp:108)not called0.0%
iso15118::d20::state::ServiceDetail::enter() (src/iso15118/d20/state/service_detail.cpp:102)not called0.0%
iso15118::d20::state::ServiceDetail::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/service_detail.cpp:106)not called0.0%
iso15118::d20::state::ServiceDiscovery::enter() (src/iso15118/d20/state/service_discovery.cpp:83)not called0.0%
iso15118::d20::state::ServiceDiscovery::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/service_discovery.cpp:87)not called0.0%
iso15118::d20::state::ServiceSelection::enter() (src/iso15118/d20/state/service_selection.cpp:80)not called0.0%
iso15118::d20::state::ServiceSelection::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/service_selection.cpp:84)not called0.0%
iso15118::d20::state::SessionSetup::enter() (src/iso15118/d20/state/session_setup.cpp:37)not called0.0%
iso15118::d20::state::SessionSetup::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/session_setup.cpp:41)not called0.0%
iso15118::d20::state::SessionStop::enter() (src/iso15118/d20/state/session_stop.cpp:38)not called0.0%
iso15118::d20::state::SessionStop::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/session_stop.cpp:42)not called0.0%
iso15118::d20::state::SupportedAppProtocol::enter() (src/iso15118/d20/state/supported_app_protocol.cpp:35)not called0.0%
iso15118::d20::state::SupportedAppProtocol::handle_event(fsm::states::StateAllocator<void>&, iso15118::d20::FsmEvent) (src/iso15118/d20/state/supported_app_protocol.cpp:39)called 2 times61.0%
iso15118::d20::state::find_auth_service_in_offered_services(iso15118::message_20::datatypes::Authorization const&, iso15118::d20::Session const&) (src/iso15118/d20/state/authorization.cpp:18)called 8 times90.0%
iso15118::d20::state::find_service_id(std::vector<unsigned short, std::allocator<unsigned short> > const&, unsigned short) (src/iso15118/d20/state/service_discovery.cpp:18)called 6 times89.0%
iso15118::d20::state::handle_request(iso15118::message_20::AuthorizationRequest const&, iso15118::d20::Session const&, iso15118::message_20::datatypes::AuthStatus const&) (src/iso15118/d20/state/authorization.cpp:25)called 10 times91.0%
iso15118::d20::state::handle_request(iso15118::message_20::AuthorizationSetupRequest const&, iso15118::d20::Session&, bool, std::vector<iso15118::message_20::datatypes::Authorization, std::allocator<iso15118::message_20::datatypes::Authorization> > const&) (src/iso15118/d20/state/authorization_setup.cpp:18)called 8 times80.0%
iso15118::d20::state::handle_request(iso15118::message_20::DC_CableCheckRequest const&, iso15118::d20::Session const&, bool) (src/iso15118/d20/state/dc_cable_check.cpp:15)called 6 times100.0%
iso15118::d20::state::handle_request(iso15118::message_20::DC_ChargeLoopRequest const&, iso15118::d20::Session const&, float, float, bool, iso15118::d20::DcTransferLimits const&, iso15118::d20::UpdateDynamicModeParameters const&) (src/iso15118/d20/state/dc_charge_loop.cpp:87)called 18 times69.0%
iso15118::d20::state::handle_request(iso15118::message_20::DC_ChargeParameterDiscoveryRequest const&, iso15118::d20::Session const&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_parameter_discovery.cpp:52)called 12 times94.0%
iso15118::d20::state::handle_request(iso15118::message_20::DC_PreChargeRequest const&, iso15118::d20::Session const&, float) (src/iso15118/d20/state/dc_pre_charge.cpp:15)called 4 times92.0%
iso15118::d20::state::handle_request(iso15118::message_20::DC_WeldingDetectionRequest const&, iso15118::d20::Session const&, float) (src/iso15118/d20/state/dc_welding_detection.cpp:14)called 4 times92.0%
iso15118::d20::state::handle_request(iso15118::message_20::PowerDeliveryRequest const&, iso15118::d20::Session const&) (src/iso15118/d20/state/power_delivery.cpp:16)called 4 times85.0%
iso15118::d20::state::handle_request(iso15118::message_20::ScheduleExchangeRequest const&, iso15118::d20::Session const&, iso15118::message_20::datatypes::RationalNumber const&, iso15118::d20::UpdateDynamicModeParameters const&) (src/iso15118/d20/state/schedule_exchange.cpp:60)called 8 times86.0%
iso15118::d20::state::handle_request(iso15118::message_20::ServiceDetailRequest const&, iso15118::d20::Session&, iso15118::d20::SessionConfig const&) (src/iso15118/d20/state/service_detail.cpp:16)called 16 times77.0%
iso15118::d20::state::handle_request(iso15118::message_20::ServiceDiscoveryRequest const&, iso15118::d20::Session&, std::vector<iso15118::message_20::datatypes::ServiceCategory, std::allocator<iso15118::message_20::datatypes::ServiceCategory> > const&, std::vector<iso15118::message_20::datatypes::ServiceCategory, std::allocator<iso15118::message_20::datatypes::ServiceCategory> > const&) (src/iso15118/d20/state/service_discovery.cpp:22)called 8 times81.0%
iso15118::d20::state::handle_request(iso15118::message_20::ServiceSelectionRequest const&, iso15118::d20::Session&) (src/iso15118/d20/state/service_selection.cpp:18)called 18 times94.0%
iso15118::d20::state::handle_request(iso15118::message_20::SessionSetupRequest const&, iso15118::d20::Session const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (src/iso15118/d20/state/session_setup.cpp:20)not called0.0%
iso15118::d20::state::handle_request(iso15118::message_20::SessionStopRequest const&, iso15118::d20::Session const&) (src/iso15118/d20/state/session_stop.cpp:13)called 6 times75.0%
iso15118::d20::state::handle_request(iso15118::message_20::SupportedAppProtocolRequest const&) (src/iso15118/d20/state/supported_app_protocol.cpp:17)called 2 times67.0%
iso15118::d20::validate_and_setup_header(iso15118::message_20::Header&, iso15118::d20::Session const&, std::array<unsigned char, 8ul> const&) (src/iso15118/d20/context_helper.cpp:29)called 122 times100.0%
iso15118::get_current_time_point() (include/iso15118/io/time.hpp:11)not called0.0%
iso15118::get_timeout_ms_until(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, int) (include/iso15118/io/time.hpp:19)not called0.0%
iso15118::io::(anonymous namespace)::choose_first_ipv6_interface() (src/iso15118/io/socket_helper.cpp:19)not called0.0%
iso15118::io::ConnectionPlain::ConnectionPlain(iso15118::io::PollManager&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/io/connection_plain.cpp:21)not called0.0%
iso15118::io::ConnectionPlain::ConnectionPlain(iso15118::io::PollManager&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda()#1}::operator()() const (src/iso15118/io/connection_plain.cpp:63)not called0.0%
iso15118::io::ConnectionPlain::close() (src/iso15118/io/connection_plain.cpp:143)not called0.0%
iso15118::io::ConnectionPlain::get_public_endpoint() const (src/iso15118/io/connection_plain.cpp:72)not called0.0%
iso15118::io::ConnectionPlain::handle_connect() (src/iso15118/io/connection_plain.cpp:107)not called0.0%
iso15118::io::ConnectionPlain::handle_connect()::{lambda()#1}::operator()() const (src/iso15118/io/connection_plain.cpp:134)not called0.0%
iso15118::io::ConnectionPlain::handle_data() (src/iso15118/io/connection_plain.cpp:137)not called0.0%
iso15118::io::ConnectionPlain::read(unsigned char*, unsigned long) (src/iso15118/io/connection_plain.cpp:88)not called0.0%
iso15118::io::ConnectionPlain::set_event_callback(std::function<void (iso15118::io::ConnectionEvent)> const&) (src/iso15118/io/connection_plain.cpp:68)not called0.0%
iso15118::io::ConnectionPlain::write(unsigned char const*, unsigned long) (src/iso15118/io/connection_plain.cpp:76)not called0.0%
iso15118::io::ConnectionPlain::~ConnectionPlain() (src/iso15118/io/connection_plain.cpp:66)not called0.0%
iso15118::io::ConnectionSSL::ConnectionSSL(iso15118::io::PollManager&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, iso15118::config::SSLConfig const&) (src/iso15118/io/connection_openssl.cpp:121)not called0.0%
iso15118::io::ConnectionSSL::ConnectionSSL(iso15118::io::PollManager&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, iso15118::config::SSLConfig const&)::{lambda()#1}::operator()() const (src/iso15118/io/connection_openssl.cpp:182)not called0.0%
iso15118::io::ConnectionSSL::close() (src/iso15118/io/connection_openssl.cpp:313)not called0.0%
iso15118::io::ConnectionSSL::get_public_endpoint() const (src/iso15118/io/connection_openssl.cpp:191)not called0.0%
iso15118::io::ConnectionSSL::handle_connect() (src/iso15118/io/connection_openssl.cpp:235)not called0.0%
iso15118::io::ConnectionSSL::handle_connect()::{lambda()#1}::operator()() const (src/iso15118/io/connection_openssl.cpp:274)not called0.0%
iso15118::io::ConnectionSSL::handle_data() (src/iso15118/io/connection_openssl.cpp:282)not called0.0%
iso15118::io::ConnectionSSL::read(unsigned char*, unsigned long) (src/iso15118/io/connection_openssl.cpp:211)not called0.0%
iso15118::io::ConnectionSSL::set_event_callback(std::function<void (iso15118::io::ConnectionEvent)> const&) (src/iso15118/io/connection_openssl.cpp:187)not called0.0%
iso15118::io::ConnectionSSL::write(unsigned char const*, unsigned long) (src/iso15118/io/connection_openssl.cpp:195)not called0.0%
iso15118::io::ConnectionSSL::~ConnectionSSL() (src/iso15118/io/connection_openssl.cpp:185)not called0.0%
iso15118::io::IConnection::~IConnection() (include/iso15118/io/connection_abstract.hpp:36)not called0.0%
iso15118::io::PeerRequestContext::PeerRequestContext(bool) (include/iso15118/io/sdp_server.hpp:16)not called0.0%
iso15118::io::PeerRequestContext::operator bool() const (include/iso15118/io/sdp_server.hpp:21)not called0.0%
iso15118::io::PollManager::PollManager() (src/iso15118/io/poll_manager.cpp:34)not called0.0%
iso15118::io::PollManager::abort() (src/iso15118/io/poll_manager.cpp:83)not called0.0%
iso15118::io::PollManager::poll(int) (src/iso15118/io/poll_manager.cpp:51)not called0.0%
iso15118::io::PollManager::register_fd(int, std::function<void ()> const&) (src/iso15118/io/poll_manager.cpp:41)not called0.0%
iso15118::io::PollManager::unregister_fd(int) (src/iso15118/io/poll_manager.cpp:46)not called0.0%
iso15118::io::SdpPacket::get_current_buffer_pos() (include/iso15118/io/sdp_packet.hpp:52)not called0.0%
iso15118::io::SdpPacket::get_payload_buffer() const (include/iso15118/io/sdp_packet.hpp:44)not called0.0%
iso15118::io::SdpPacket::get_payload_length() const (include/iso15118/io/sdp_packet.hpp:38)not called0.0%
iso15118::io::SdpPacket::get_payload_type() const (src/iso15118/io/sdp_packet.cpp:12)not called0.0%
iso15118::io::SdpPacket::get_remaining_bytes_to_read() const (src/iso15118/io/sdp_packet.cpp:19)not called0.0%
iso15118::io::SdpPacket::get_state() const (include/iso15118/io/sdp_packet.hpp:30)not called0.0%
iso15118::io::SdpPacket::is_complete() const (include/iso15118/io/sdp_packet.hpp:34)not called0.0%
iso15118::io::SdpPacket::parse_header() (src/iso15118/io/sdp_packet.cpp:47)not called0.0%
iso15118::io::SdpPacket::update_read_bytes(unsigned long) (src/iso15118/io/sdp_packet.cpp:30)not called0.0%
iso15118::io::SdpServer::SdpServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/io/sdp_server.cpp:41)not called0.0%
iso15118::io::SdpServer::get_fd() const (include/iso15118/io/sdp_server.hpp:36)not called0.0%
iso15118::io::SdpServer::get_peer_request() (src/iso15118/io/sdp_server.cpp:95)not called0.0%
iso15118::io::SdpServer::send_response(iso15118::io::PeerRequestContext const&, iso15118::io::Ipv6EndPoint const&) (src/iso15118/io/sdp_server.cpp:137)not called0.0%
iso15118::io::SdpServer::~SdpServer() (src/iso15118/io/sdp_server.cpp:87)not called0.0%
iso15118::io::TlsKeyLoggingServer::TlsKeyLoggingServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short) (src/iso15118/io/sdp_server.cpp:156)not called0.0%
iso15118::io::TlsKeyLoggingServer::get_fd() const (include/iso15118/io/sdp_server.hpp:52)not called0.0%
iso15118::io::TlsKeyLoggingServer::send(char const*) (src/iso15118/io/sdp_server.cpp:216)not called0.0%
iso15118::io::TlsKeyLoggingServer::~TlsKeyLoggingServer() (src/iso15118/io/sdp_server.cpp:209)not called0.0%
iso15118::io::add_error_str(char const*, unsigned long, void*) (src/iso15118/misc/helper_openssl.cpp:12)not called0.0%
iso15118::io::check_and_update_interface(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (src/iso15118/io/socket_helper.cpp:49)not called0.0%
iso15118::io::create_poll_set(std::map<int, std::function<void ()> const, std::less<int>, std::allocator<std::pair<int const, std::function<void ()> const> > > const&, int) (src/iso15118/io/poll_manager.cpp:16)not called0.0%
iso15118::io::get_first_sockaddr_in6_for_interface(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sockaddr_in6&) (src/iso15118/io/socket_helper.cpp:65)not called0.0%
iso15118::io::init_ssl(iso15118::config::SSLConfig const&) (src/iso15118/io/connection_openssl.cpp:53)not called0.0%
iso15118::io::init_ssl(iso15118::config::SSLConfig const&)::{lambda(ssl_st const*, char const*)#1}::operator()(ssl_st const*, char const*) const (src/iso15118/io/connection_openssl.cpp:101)not called0.0%
iso15118::io::log_and_raise(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/misc/helper_openssl.cpp:19)not called0.0%
iso15118::io::log_and_raise_openssl_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/misc/helper_openssl.cpp:23)not called0.0%
iso15118::io::set_logging_callback(std::function<void (iso15118::LogLevel, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)> const&) (src/iso15118/io/logging.cpp:89)called 26 times100.0%
iso15118::io::sockaddr_in6_to_name(sockaddr_in6 const&) (src/iso15118/io/socket_helper.cpp:111)not called0.0%
iso15118::log(iso15118::LogLevel const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/io/logging.cpp:16)called 40 times71.0%
iso15118::log_and_throw(char const*) (src/iso15118/misc/helper.cpp:16)not called0.0%
iso15118::log_packet_from_car(iso15118::io::SdpPacket const&, iso15118::session::SessionLogger&) (src/iso15118/session/iso.cpp:32)not called0.0%
iso15118::log_peer_hostname(sockaddr_in6 const&) (src/iso15118/io/sdp_server.cpp:25)not called0.0%
iso15118::log_sdp_packet(iso15118::io::SdpPacket const&) (src/iso15118/session/iso.cpp:20)not called0.0%
iso15118::logf(char const*, ...) (src/iso15118/io/logging.cpp:38)called 4 times100.0%
iso15118::logf(iso15118::LogLevel const&, char const*, ...) (src/iso15118/io/logging.cpp:47)called 2 times100.0%
iso15118::logf_debug(char const*, ...) (src/iso15118/io/logging.cpp:75)called 4 times75.0%
iso15118::logf_error(char const*, ...) (src/iso15118/io/logging.cpp:57)called 8 times75.0%
iso15118::logf_info(char const*, ...) (src/iso15118/io/logging.cpp:69)called 14 times75.0%
iso15118::logf_trace(char const*, ...) (src/iso15118/io/logging.cpp:81)called 4 times75.0%
iso15118::logf_warning(char const*, ...) (src/iso15118/io/logging.cpp:63)called 4 times75.0%
iso15118::make_variant_from_packet(iso15118::io::SdpPacket const&) (src/iso15118/session/iso.cpp:37)not called0.0%
iso15118::message_20::AuthorizationModeVisitor::AuthorizationModeVisitor(iso20_AuthorizationSetupResType&) (src/iso15118/message/authorization_setup.cpp:18)called 4 times100.0%
iso15118::message_20::AuthorizationModeVisitor::operator()(iso15118::message_20::datatypes::EIM_ASResAuthorizationMode const&) (src/iso15118/message/authorization_setup.cpp:19)called 2 times100.0%
iso15118::message_20::AuthorizationModeVisitor::operator()(iso15118::message_20::datatypes::PnC_ASResAuthorizationMode const&) (src/iso15118/message/authorization_setup.cpp:23)called 2 times64.0%
iso15118::message_20::AuthorizationResponse iso15118::d20::handle_sequence_error<iso15118::message_20::AuthorizationResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::AuthorizationResponse& iso15118::d20::response_with_code<iso15118::message_20::AuthorizationResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::AuthorizationResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 10 times100.0%
iso15118::message_20::AuthorizationSetupResponse iso15118::d20::handle_sequence_error<iso15118::message_20::AuthorizationSetupResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::AuthorizationSetupResponse& iso15118::d20::response_with_code<iso15118::message_20::AuthorizationSetupResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::AuthorizationSetupResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 8 times100.0%
iso15118::message_20::ControlModeVisitor::ControlModeVisitor(iso20_ac_AC_ChargeLoopResType&) (src/iso15118/message/ac_charge_loop.cpp:232)not called0.0%
iso15118::message_20::ControlModeVisitor::ControlModeVisitor(iso20_dc_DC_ChargeLoopResType&) (src/iso15118/message/dc_charge_loop.cpp:203)called 2 times100.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::BPT_Dynamic_AC_CLResControlMode const&) (src/iso15118/message/ac_charge_loop.cpp:255)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode const&) (src/iso15118/message/dc_charge_loop.cpp:222)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::BPT_Scheduled_AC_CLResControlMode const&) (src/iso15118/message/ac_charge_loop.cpp:241)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::BPT_Scheduled_DC_CLResControlMode const&) (src/iso15118/message/dc_charge_loop.cpp:210)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::Dynamic_AC_CLResControlMode const&) (src/iso15118/message/ac_charge_loop.cpp:248)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode const&) (src/iso15118/message/dc_charge_loop.cpp:216)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::Scheduled_AC_CLResControlMode const&) (src/iso15118/message/ac_charge_loop.cpp:234)not called0.0%
iso15118::message_20::ControlModeVisitor::operator()(iso15118::message_20::datatypes::Scheduled_DC_CLResControlMode const&) (src/iso15118/message/dc_charge_loop.cpp:204)called 2 times100.0%
iso15118::message_20::DC_CableCheckResponse iso15118::d20::handle_sequence_error<iso15118::message_20::DC_CableCheckResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::DC_CableCheckResponse& iso15118::d20::response_with_code<iso15118::message_20::DC_CableCheckResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::DC_CableCheckResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 6 times100.0%
iso15118::message_20::DC_ChargeLoopResponse iso15118::d20::handle_sequence_error<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::DC_ChargeLoopResponse& iso15118::d20::response_with_code<iso15118::message_20::DC_ChargeLoopResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::DC_ChargeLoopResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 18 times100.0%
iso15118::message_20::DC_ChargeParameterDiscoveryResponse iso15118::d20::handle_sequence_error<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::DC_ChargeParameterDiscoveryResponse& iso15118::d20::response_with_code<iso15118::message_20::DC_ChargeParameterDiscoveryResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 12 times100.0%
iso15118::message_20::DC_PreChargeResponse iso15118::d20::handle_sequence_error<iso15118::message_20::DC_PreChargeResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::DC_PreChargeResponse& iso15118::d20::response_with_code<iso15118::message_20::DC_PreChargeResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::DC_PreChargeResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 4 times100.0%
iso15118::message_20::DC_WeldingDetectionRequest const* iso15118::message_20::Variant::get_if<iso15118::message_20::DC_WeldingDetectionRequest>() const (include/iso15118/message/variant.hpp:38)not called0.0%
iso15118::message_20::DC_WeldingDetectionResponse iso15118::d20::handle_sequence_error<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::DC_WeldingDetectionResponse& iso15118::d20::response_with_code<iso15118::message_20::DC_WeldingDetectionResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::DC_WeldingDetectionResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 4 times100.0%
iso15118::message_20::ModeResponseVisitor::ModeResponseVisitor(iso20_ScheduleExchangeResType&) (src/iso15118/message/schedule_exchange.cpp:301)called 6 times100.0%
iso15118::message_20::ModeResponseVisitor::ModeResponseVisitor(iso20_ac_AC_ChargeParameterDiscoveryResType&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:63)not called0.0%
iso15118::message_20::ModeResponseVisitor::ModeResponseVisitor(iso20_dc_DC_ChargeParameterDiscoveryResType&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:70)called 2 times100.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::AC_CPDResEnergyTransferMode const&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:64)not called0.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::BPT_AC_CPDResEnergyTransferMode const&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:71)not called0.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::BPT_DC_CPDResEnergyTransferMode const&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:78)not called0.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::DC_CPDResEnergyTransferMode const&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:71)called 2 times100.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::Dynamic_SEResControlMode const&) (src/iso15118/message/schedule_exchange.cpp:302)called 2 times78.0%
iso15118::message_20::ModeResponseVisitor::operator()(iso15118::message_20::datatypes::Scheduled_SEResControlMode const&) (src/iso15118/message/schedule_exchange.cpp:315)called 4 times75.0%
iso15118::message_20::ParamterValueVisitor::ParamterValueVisitor(iso20_ParameterType&) (src/iso15118/message/service_detail.cpp:122)called 8 times100.0%
iso15118::message_20::ParamterValueVisitor::operator()(bool const&) (src/iso15118/message/service_detail.cpp:123)not called0.0%
iso15118::message_20::ParamterValueVisitor::operator()(int const&) (src/iso15118/message/service_detail.cpp:135)called 8 times100.0%
iso15118::message_20::ParamterValueVisitor::operator()(iso15118::message_20::datatypes::RationalNumber const&) (src/iso15118/message/service_detail.cpp:143)not called0.0%
iso15118::message_20::ParamterValueVisitor::operator()(short const&) (src/iso15118/message/service_detail.cpp:131)not called0.0%
iso15118::message_20::ParamterValueVisitor::operator()(signed char const&) (src/iso15118/message/service_detail.cpp:127)not called0.0%
iso15118::message_20::ParamterValueVisitor::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/message/service_detail.cpp:139)not called0.0%
iso15118::message_20::PowerDeliveryResponse iso15118::d20::handle_sequence_error<iso15118::message_20::PowerDeliveryResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::PowerDeliveryResponse& iso15118::d20::response_with_code<iso15118::message_20::PowerDeliveryResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::PowerDeliveryResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 4 times100.0%
iso15118::message_20::ScheduleExchangeResponse iso15118::d20::handle_sequence_error<iso15118::message_20::ScheduleExchangeResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::ScheduleExchangeResponse& iso15118::d20::response_with_code<iso15118::message_20::ScheduleExchangeResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::ScheduleExchangeResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 8 times100.0%
iso15118::message_20::ServiceDetailResponse iso15118::d20::handle_sequence_error<iso15118::message_20::ServiceDetailResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::ServiceDetailResponse& iso15118::d20::response_with_code<iso15118::message_20::ServiceDetailResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::ServiceDetailResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 16 times100.0%
iso15118::message_20::ServiceDiscoveryResponse iso15118::d20::handle_sequence_error<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::ServiceDiscoveryResponse& iso15118::d20::response_with_code<iso15118::message_20::ServiceDiscoveryResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::ServiceDiscoveryResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 8 times100.0%
iso15118::message_20::ServiceSelectionResponse iso15118::d20::handle_sequence_error<iso15118::message_20::ServiceSelectionResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::ServiceSelectionResponse& iso15118::d20::response_with_code<iso15118::message_20::ServiceSelectionResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::ServiceSelectionResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 18 times100.0%
iso15118::message_20::SessionSetupRequest const* iso15118::message_20::Variant::get_if<iso15118::message_20::SessionSetupRequest>() const (include/iso15118/message/variant.hpp:38)not called0.0%
iso15118::message_20::SessionSetupResponse iso15118::d20::handle_sequence_error<iso15118::message_20::SessionSetupResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::SessionSetupResponse& iso15118::d20::response_with_code<iso15118::message_20::SessionSetupResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::SessionSetupResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)not called0.0%
iso15118::message_20::SessionStopRequest const* iso15118::message_20::Variant::get_if<iso15118::message_20::SessionStopRequest>() const (include/iso15118/message/variant.hpp:38)not called0.0%
iso15118::message_20::SessionStopResponse iso15118::d20::handle_sequence_error<iso15118::message_20::SessionStopResponse>(iso15118::d20::Session const&) (src/iso15118/d20/context_helper.cpp:42)not called0.0%
iso15118::message_20::SessionStopResponse& iso15118::d20::response_with_code<iso15118::message_20::SessionStopResponse, iso15118::message_20::datatypes::ResponseCode>(iso15118::message_20::SessionStopResponse&, iso15118::message_20::datatypes::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 6 times100.0%
iso15118::message_20::SupportedAppProtocolRequest const* iso15118::message_20::Variant::get_if<iso15118::message_20::SupportedAppProtocolRequest>() const (include/iso15118/message/variant.hpp:38)called 2 times75.0%
iso15118::message_20::SupportedAppProtocolResponse& iso15118::d20::response_with_code<iso15118::message_20::SupportedAppProtocolResponse, iso15118::message_20::SupportedAppProtocolResponse::ResponseCode>(iso15118::message_20::SupportedAppProtocolResponse&, iso15118::message_20::SupportedAppProtocolResponse::ResponseCode) (include/iso15118/detail/d20/context_helper.hpp:12)called 2 times100.0%
iso15118::message_20::Variant::Variant(iso15118::io::v2gtp::PayloadType, iso15118::io::StreamInputView const&) (src/iso15118/message/variant.cpp:114)called 36 times59.0%
iso15118::message_20::Variant::get_error[abi:cxx11]() const (src/iso15118/message/variant.cpp:151)not called0.0%
iso15118::message_20::Variant::get_type() const (src/iso15118/message/variant.cpp:147)called 34 times100.0%
iso15118::message_20::Variant::~Variant() (src/iso15118/message/variant.cpp:141)called 36 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AC_ChargeLoopRequest, iso20_ac_AC_ChargeLoopReqType>(iso20_ac_AC_ChargeLoopReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)not called0.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AC_ChargeParameterDiscoveryRequest, iso20_ac_AC_ChargeParameterDiscoveryReqType>(iso20_ac_AC_ChargeParameterDiscoveryReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)not called0.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AuthorizationRequest, iso20_AuthorizationReqType>(iso20_AuthorizationReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AuthorizationSetupRequest, iso20_AuthorizationSetupReqType>(iso20_AuthorizationSetupReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_CableCheckRequest, iso20_dc_DC_CableCheckReqType>(iso20_dc_DC_CableCheckReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_ChargeLoopRequest, iso20_dc_DC_ChargeLoopReqType>(iso20_dc_DC_ChargeLoopReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 4 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_ChargeParameterDiscoveryRequest, iso20_dc_DC_ChargeParameterDiscoveryReqType>(iso20_dc_DC_ChargeParameterDiscoveryReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_PreChargeRequest, iso20_dc_DC_PreChargeReqType>(iso20_dc_DC_PreChargeReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_WeldingDetectionRequest, iso20_dc_DC_WeldingDetectionReqType>(iso20_dc_DC_WeldingDetectionReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::PowerDeliveryRequest, iso20_PowerDeliveryReqType>(iso20_PowerDeliveryReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ScheduleExchangeRequest, iso20_ScheduleExchangeReqType>(iso20_ScheduleExchangeReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 4 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceDetailRequest, iso20_ServiceDetailReqType>(iso20_ServiceDetailReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceDiscoveryRequest, iso20_ServiceDiscoveryReqType>(iso20_ServiceDiscoveryReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceSelectionRequest, iso20_ServiceSelectionReqType>(iso20_ServiceSelectionReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SessionSetupRequest, iso20_SessionSetupReqType>(iso20_SessionSetupReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SessionStopRequest, iso20_SessionStopReqType>(iso20_SessionStopReqType const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 2 times100.0%
iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SupportedAppProtocolRequest, appHand_supportedAppProtocolReq>(appHand_supportedAppProtocolReq const&)::{lambda(void*)#1}::operator()(void*) const (include/iso15118/detail/variant_access.hpp:28)called 4 times100.0%
iso15118::message_20::convert(iso20_channelSelectionType, iso15118::message_20::datatypes::ChannelSelection&) (src/iso15118/message/power_delivery.cpp:50)not called0.0%
iso15118::message_20::datatypes::ParameterSet::ParameterSet() (src/iso15118/message/service_detail.cpp:15)called 18 times38.0%
iso15118::message_20::datatypes::ParameterSet::ParameterSet(unsigned short, iso15118::message_20::datatypes::DcBptParameterList const&) (src/iso15118/message/service_detail.cpp:59)called 2 times88.0%
iso15118::message_20::datatypes::ParameterSet::ParameterSet(unsigned short, iso15118::message_20::datatypes::DcParameterList const&) (src/iso15118/message/service_detail.cpp:35)called 10 times95.0%
iso15118::message_20::datatypes::ParameterSet::ParameterSet(unsigned short, iso15118::message_20::datatypes::InternetParameterList const&) (src/iso15118/message/service_detail.cpp:92)called 2 times85.0%
iso15118::message_20::datatypes::ParameterSet::ParameterSet(unsigned short, iso15118::message_20::datatypes::ParkingParameterList const&) (src/iso15118/message/service_detail.cpp:104)called 2 times90.0%
iso15118::message_20::datatypes::from_Protocol[abi:cxx11](iso15118::message_20::datatypes::Protocol const&) (src/iso15118/message/common_types.cpp:133)called 2 times23.0%
iso15118::message_20::datatypes::from_RationalNumber(iso15118::message_20::datatypes::RationalNumber const&) (src/iso15118/message/common_types.cpp:116)called 224 times100.0%
iso15118::message_20::datatypes::from_control_mode[abi:cxx11](iso15118::message_20::datatypes::ControlMode const&) (src/iso15118/message/common_types.cpp:146)called 10 times30.0%
iso15118::message_20::datatypes::from_float(float) (src/iso15118/message/common_types.cpp:120)called 28 times80.0%
iso15118::message_20::datatypes::from_mobility_needs_mode[abi:cxx11](iso15118::message_20::datatypes::MobilityNeedsMode const&) (src/iso15118/message/common_types.cpp:156)called 10 times30.0%
iso15118::message_20::handle_ac(iso15118::message_20::VariantAccess&) (src/iso15118/message/variant.cpp:95)not called0.0%
iso15118::message_20::handle_dc(iso15118::message_20::VariantAccess&) (src/iso15118/message/variant.cpp:70)called 12 times58.0%
iso15118::message_20::handle_main(iso15118::message_20::VariantAccess&) (src/iso15118/message/variant.cpp:37)called 20 times68.0%
iso15118::message_20::handle_sap(iso15118::message_20::VariantAccess&) (src/iso15118/message/variant.cpp:20)called 4 times39.0%
iso15118::offset_time_point_by_ms(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, int) (include/iso15118/io/time.hpp:15)not called0.0%
iso15118::raise_invalid_packet_state(iso15118::io::SdpPacket const&) (src/iso15118/session/iso.cpp:42)not called0.0%
iso15118::read_single_sdp_packet(iso15118::io::IConnection&, iso15118::io::SdpPacket&) (src/iso15118/session/iso.cpp:62)not called0.0%
iso15118::session::Feedback::Feedback(iso15118::session::feedback::Callbacks) (src/iso15118/session/feedback.cpp:9)called 24 times100.0%
iso15118::session::Feedback::dc_charge_loop_req(std::variant<std::variant<iso15118::message_20::datatypes::Scheduled_DC_CLReqControlMode, iso15118::message_20::datatypes::BPT_Scheduled_DC_CLReqControlMode, iso15118::message_20::datatypes::Dynamic_DC_CLReqControlMode, iso15118::message_20::datatypes::BPT_Dynamic_DC_CLReqControlMode>, iso15118::message_20::datatypes::DisplayParameters, iso15118::message_20::datatypes::RationalNumber, bool> const&) const (src/iso15118/session/feedback.cpp:20)called 10 times100.0%
iso15118::session::Feedback::dc_max_limits(iso15118::session::feedback::DcMaximumLimits const&) const (src/iso15118/session/feedback.cpp:24)called 2 times100.0%
iso15118::session::Feedback::dc_pre_charge_target_voltage(float) const (src/iso15118/session/feedback.cpp:16)called 2 times100.0%
iso15118::session::Feedback::evcc_id(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (src/iso15118/session/feedback.cpp:32)called 2 times71.0%
iso15118::session::Feedback::selected_protocol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (src/iso15118/session/feedback.cpp:36)called 2 times71.0%
iso15118::session::Feedback::signal(iso15118::session::feedback::Signal) const (src/iso15118/session/feedback.cpp:12)called 2 times100.0%
iso15118::session::Feedback::v2g_message(iso15118::message_20::Type const&) const (src/iso15118/session/feedback.cpp:28)called 2 times100.0%
iso15118::session::SessionLogger::SessionLogger(void*) (src/iso15118/session/logger.cpp:11)called 2 times100.0%
iso15118::session::SessionLogger::enter_state(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (src/iso15118/session/logger.cpp:27)not called0.0%
iso15118::session::SessionLogger::event(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (src/iso15118/session/logger.cpp:13)not called0.0%
iso15118::session::SessionLogger::exi(unsigned short, unsigned char const*, unsigned long, iso15118::session::logging::ExiMessageDirection) const (src/iso15118/session/logger.cpp:18)not called0.0%
iso15118::session::SessionLogger::operator()(char const*, ...) const (src/iso15118/session/logger.cpp:41)not called0.0%
iso15118::session::SessionLogger::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (src/iso15118/session/logger.cpp:37)not called0.0%
iso15118::session::logging::set_session_log_callback(std::function<void (unsigned long, std::variant<iso15118::session::logging::SimpleEvent, iso15118::session::logging::ExiMessageEvent> const&)> const&) (src/iso15118/session/logger.cpp:56)not called0.0%
iso15118::setup_response_header(unsigned char*, iso15118::io::v2gtp::PayloadType, unsigned long) (src/iso15118/session/iso.cpp:108)not called0.0%
iso15118::vlogf(char const*, __va_list_tag*) (src/iso15118/io/logging.cpp:20)called 4 times50.0%
iso15118::vlogf(iso15118::LogLevel const&, char const*, __va_list_tag*) (src/iso15118/io/logging.cpp:29)called 36 times54.0%
logging_callback::{lambda(iso15118::LogLevel const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(iso15118::LogLevel const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const) const (src/iso15118/io/logging.cpp:9)called 14 times100.0%
session_is_zero(iso15118::message_20::Header const&) (src/iso15118/d20/state/session_setup.cpp:12)not called0.0%
session_is_zero(iso15118::message_20::Header const&)::{lambda(int)#1}::operator()(int) const (src/iso15118/d20/state/session_setup.cpp:13)not called0.0%
std::default_delete<ssl_ctx_st>::operator()(ssl_ctx_st*) const (src/iso15118/io/connection_openssl.cpp:31)not called0.0%
std::default_delete<ssl_st>::operator()(ssl_st*) const (src/iso15118/io/connection_openssl.cpp:25)not called0.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::AC_ChargeLoopResponse>(iso15118::message_20::AC_ChargeLoopResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/ac_charge_loop.cpp:292)not called0.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::AC_ChargeParameterDiscoveryResponse>(iso15118::message_20::AC_ChargeParameterDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:130)not called0.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::AuthorizationResponse>(iso15118::message_20::AuthorizationResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/authorization.cpp:53)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::AuthorizationSetupResponse>(iso15118::message_20::AuthorizationSetupResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/authorization_setup.cpp:68)called 4 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::DC_CableCheckResponse>(iso15118::message_20::DC_CableCheckResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/dc_cable_check.cpp:40)called 4 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::message_20::DC_ChargeLoopResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/dc_charge_loop.cpp:263)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:130)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::DC_PreChargeResponse>(iso15118::message_20::DC_PreChargeResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/dc_pre_charge.cpp:45)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::message_20::DC_WeldingDetectionResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/dc_welding_detection.cpp:43)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::PowerDeliveryResponse>(iso15118::message_20::PowerDeliveryResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/power_delivery.cpp:88)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::ScheduleExchangeResponse>(iso15118::message_20::ScheduleExchangeResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/schedule_exchange.cpp:363)called 6 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::ServiceDetailResponse>(iso15118::message_20::ServiceDetailResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/service_detail.cpp:194)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::message_20::ServiceDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/service_discovery.cpp:66)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::ServiceSelectionResponse>(iso15118::message_20::ServiceSelectionResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/service_selection.cpp:56)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::SessionSetupResponse>(iso15118::message_20::SessionSetupResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/session_setup.cpp:46)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::SessionStopResponse>(iso15118::message_20::SessionStopResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/session_stop.cpp:46)called 2 times100.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::SupportedAppProtocolRequest>(iso15118::message_20::SupportedAppProtocolRequest const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/supported_app_protocol.cpp:90)not called0.0%
unsigned long iso15118::message_20::serialize<iso15118::message_20::SupportedAppProtocolResponse>(iso15118::message_20::SupportedAppProtocolResponse const&, iso15118::io::StreamOutputView const&) (src/iso15118/message/supported_app_protocol.cpp:86)called 2 times100.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::AC_ChargeLoopResponse>(iso15118::message_20::AC_ChargeLoopResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)not called0.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::AC_ChargeParameterDiscoveryResponse>(iso15118::message_20::AC_ChargeParameterDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)not called0.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::AuthorizationResponse>(iso15118::message_20::AuthorizationResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::AuthorizationSetupResponse>(iso15118::message_20::AuthorizationSetupResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 4 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::DC_CableCheckResponse>(iso15118::message_20::DC_CableCheckResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 4 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::message_20::DC_ChargeLoopResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::DC_PreChargeResponse>(iso15118::message_20::DC_PreChargeResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::message_20::DC_WeldingDetectionResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::PowerDeliveryResponse>(iso15118::message_20::PowerDeliveryResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::ScheduleExchangeResponse>(iso15118::message_20::ScheduleExchangeResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 6 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::ServiceDetailResponse>(iso15118::message_20::ServiceDetailResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::message_20::ServiceDiscoveryResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::ServiceSelectionResponse>(iso15118::message_20::ServiceSelectionResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::SessionSetupResponse>(iso15118::message_20::SessionSetupResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
unsigned long iso15118::message_20::serialize_helper<iso15118::message_20::SessionStopResponse>(iso15118::message_20::SessionStopResponse const&, iso15118::io::StreamOutputView const&) (include/iso15118/detail/cb_exi.hpp:76)called 2 times35.0%
void cb_convert_enum<iso15118::message_20::SupportedAppProtocolResponse::ResponseCode, appHand_responseCodeType>(iso15118::message_20::SupportedAppProtocolResponse::ResponseCode const&, appHand_responseCodeType&) (include/iso15118/detail/cb_exi.hpp:64)called 2 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::Authorization, iso20_authorizationType>(iso15118::message_20::datatypes::Authorization const&, iso20_authorizationType&) (include/iso15118/detail/cb_exi.hpp:64)called 6 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::EvseNotification, iso20_ac_evseNotificationType>(iso15118::message_20::datatypes::EvseNotification const&, iso20_ac_evseNotificationType&) (include/iso15118/detail/cb_exi.hpp:64)not called0.0%
void cb_convert_enum<iso15118::message_20::datatypes::EvseNotification, iso20_dc_evseNotificationType>(iso15118::message_20::datatypes::EvseNotification const&, iso20_dc_evseNotificationType&) (include/iso15118/detail/cb_exi.hpp:64)not called0.0%
void cb_convert_enum<iso15118::message_20::datatypes::EvseNotification, iso20_evseNotificationType>(iso15118::message_20::datatypes::EvseNotification const&, iso20_evseNotificationType&) (include/iso15118/detail/cb_exi.hpp:64)not called0.0%
void cb_convert_enum<iso15118::message_20::datatypes::Processing, iso20_dc_processingType>(iso15118::message_20::datatypes::Processing const&, iso20_dc_processingType&) (include/iso15118/detail/cb_exi.hpp:64)called 4 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::Processing, iso20_processingType>(iso15118::message_20::datatypes::Processing const&, iso20_processingType&) (include/iso15118/detail/cb_exi.hpp:64)called 6 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::ResponseCode, iso20_ac_responseCodeType>(iso15118::message_20::datatypes::ResponseCode const&, iso20_ac_responseCodeType&) (include/iso15118/detail/cb_exi.hpp:64)not called0.0%
void cb_convert_enum<iso15118::message_20::datatypes::ResponseCode, iso20_dc_responseCodeType>(iso15118::message_20::datatypes::ResponseCode const&, iso20_dc_responseCodeType&) (include/iso15118/detail/cb_exi.hpp:64)called 12 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::ResponseCode, iso20_responseCodeType>(iso15118::message_20::datatypes::ResponseCode const&, iso20_responseCodeType&) (include/iso15118/detail/cb_exi.hpp:64)called 22 times100.0%
void cb_convert_enum<iso15118::message_20::datatypes::ServiceCategory, unsigned short>(iso15118::message_20::datatypes::ServiceCategory const&, unsigned short&) (include/iso15118/detail/cb_exi.hpp:64)called 6 times100.0%
void cb_convert_enum<iso20_channelSelectionType, iso15118::message_20::datatypes::ChannelSelection>(iso20_channelSelectionType const&, iso15118::message_20::datatypes::ChannelSelection&) (include/iso15118/detail/cb_exi.hpp:64)not called0.0%
void cb_convert_enum<iso20_chargeProgressType, iso15118::message_20::datatypes::Progress>(iso20_chargeProgressType const&, iso15118::message_20::datatypes::Progress&) (include/iso15118/detail/cb_exi.hpp:64)called 2 times100.0%
void cb_convert_enum<iso20_chargingSessionType, iso15118::message_20::datatypes::ChargingSession>(iso20_chargingSessionType const&, iso15118::message_20::datatypes::ChargingSession&) (include/iso15118/detail/cb_exi.hpp:64)called 2 times100.0%
void cb_convert_enum<iso20_dc_processingType, iso15118::message_20::datatypes::Processing>(iso20_dc_processingType const&, iso15118::message_20::datatypes::Processing&) (include/iso15118/detail/cb_exi.hpp:64)called 4 times100.0%
void cb_convert_enum<iso20_processingType, iso15118::message_20::datatypes::Processing>(iso20_processingType const&, iso15118::message_20::datatypes::Processing&) (include/iso15118/detail/cb_exi.hpp:64)called 2 times100.0%
void cb_convert_enum<unsigned short, iso15118::message_20::datatypes::ServiceCategory>(unsigned short const&, iso15118::message_20::datatypes::ServiceCategory&) (include/iso15118/detail/cb_exi.hpp:64)called 2 times100.0%
void iso15118::d20::Context::respond<iso15118::message_20::AuthorizationResponse>(iso15118::message_20::AuthorizationResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::AuthorizationSetupResponse>(iso15118::message_20::AuthorizationSetupResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::DC_CableCheckResponse>(iso15118::message_20::DC_CableCheckResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::message_20::DC_ChargeLoopResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::DC_PreChargeResponse>(iso15118::message_20::DC_PreChargeResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::message_20::DC_WeldingDetectionResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::PowerDeliveryResponse>(iso15118::message_20::PowerDeliveryResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::ScheduleExchangeResponse>(iso15118::message_20::ScheduleExchangeResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::ServiceDetailResponse>(iso15118::message_20::ServiceDetailResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::message_20::ServiceDiscoveryResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::ServiceSelectionResponse>(iso15118::message_20::ServiceSelectionResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::SessionSetupResponse>(iso15118::message_20::SessionSetupResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::SessionStopResponse>(iso15118::message_20::SessionStopResponse const&) (include/iso15118/d20/context.hpp:64)not called0.0%
void iso15118::d20::Context::respond<iso15118::message_20::SupportedAppProtocolResponse>(iso15118::message_20::SupportedAppProtocolResponse const&) (include/iso15118/d20/context.hpp:64)called 2 times100.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::AuthorizationResponse>(iso15118::message_20::AuthorizationResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::AuthorizationSetupResponse>(iso15118::message_20::AuthorizationSetupResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::DC_CableCheckResponse>(iso15118::message_20::DC_CableCheckResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::DC_ChargeLoopResponse>(iso15118::message_20::DC_ChargeLoopResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::DC_ChargeParameterDiscoveryResponse>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::DC_PreChargeResponse>(iso15118::message_20::DC_PreChargeResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::DC_WeldingDetectionResponse>(iso15118::message_20::DC_WeldingDetectionResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::PowerDeliveryResponse>(iso15118::message_20::PowerDeliveryResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::ScheduleExchangeResponse>(iso15118::message_20::ScheduleExchangeResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::ServiceDetailResponse>(iso15118::message_20::ServiceDetailResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::ServiceDiscoveryResponse>(iso15118::message_20::ServiceDiscoveryResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::ServiceSelectionResponse>(iso15118::message_20::ServiceSelectionResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::SessionSetupResponse>(iso15118::message_20::SessionSetupResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::SessionStopResponse>(iso15118::message_20::SessionStopResponse const&) (include/iso15118/d20/context.hpp:32)not called0.0%
void iso15118::d20::MessageExchange::set_response<iso15118::message_20::SupportedAppProtocolResponse>(iso15118::message_20::SupportedAppProtocolResponse const&) (include/iso15118/d20/context.hpp:32)called 2 times100.0%
void iso15118::d20::state::(anonymous namespace)::set_dynamic_parameters_in_res<iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode>(iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode&, iso15118::d20::UpdateDynamicModeParameters const&, unsigned long) (src/iso15118/d20/state/dc_charge_loop.cpp:73)called 2 times100.0%
void iso15118::d20::state::(anonymous namespace)::set_dynamic_parameters_in_res<iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode>(iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode&, iso15118::d20::UpdateDynamicModeParameters const&, unsigned long) (src/iso15118/d20/state/dc_charge_loop.cpp:73)called 2 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::BPT_DC_CPDResEnergyTransferMode>(iso15118::message_20::datatypes::BPT_DC_CPDResEnergyTransferMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_parameter_discovery.cpp:33)called 2 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode>(iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_loop.cpp:56)called 4 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::BPT_Scheduled_DC_CLResControlMode>(iso15118::message_20::datatypes::BPT_Scheduled_DC_CLResControlMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_loop.cpp:34)called 2 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::DC_CPDResEnergyTransferMode>(iso15118::message_20::datatypes::DC_CPDResEnergyTransferMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_parameter_discovery.cpp:23)called 2 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode>(iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_loop.cpp:49)called 4 times100.0%
void iso15118::d20::state::convert<iso15118::d20::DcTransferLimits, iso15118::message_20::datatypes::Scheduled_DC_CLResControlMode>(iso15118::message_20::datatypes::Scheduled_DC_CLResControlMode&, iso15118::d20::DcTransferLimits const&) (src/iso15118/d20/state/dc_charge_loop.cpp:27)called 2 times100.0%
void iso15118::message_20::ModeResponseVisitor::convert_common<iso15118::message_20::datatypes::AC_CPDResEnergyTransferMode, iso20_ac_AC_CPDResEnergyTransferModeType>(iso15118::message_20::datatypes::AC_CPDResEnergyTransferMode const&, iso20_ac_AC_CPDResEnergyTransferModeType&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:89)not called0.0%
void iso15118::message_20::ModeResponseVisitor::convert_common<iso15118::message_20::datatypes::BPT_AC_CPDResEnergyTransferMode, iso20_ac_BPT_AC_CPDResEnergyTransferModeType>(iso15118::message_20::datatypes::BPT_AC_CPDResEnergyTransferMode const&, iso20_ac_BPT_AC_CPDResEnergyTransferModeType&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:89)not called0.0%
void iso15118::message_20::ModeResponseVisitor::convert_common<iso15118::message_20::datatypes::BPT_DC_CPDResEnergyTransferMode, iso20_dc_BPT_DC_CPDResEnergyTransferModeType>(iso15118::message_20::datatypes::BPT_DC_CPDResEnergyTransferMode const&, iso20_dc_BPT_DC_CPDResEnergyTransferModeType&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:93)not called0.0%
void iso15118::message_20::ModeResponseVisitor::convert_common<iso15118::message_20::datatypes::DC_CPDResEnergyTransferMode, iso20_dc_DC_CPDResEnergyTransferModeType>(iso15118::message_20::datatypes::DC_CPDResEnergyTransferMode const&, iso20_dc_DC_CPDResEnergyTransferModeType&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:93)called 2 times83.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AC_ChargeLoopRequest, iso20_ac_AC_ChargeLoopReqType>(iso20_ac_AC_ChargeLoopReqType const&) (include/iso15118/detail/variant_access.hpp:23)not called0.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AC_ChargeParameterDiscoveryRequest, iso20_ac_AC_ChargeParameterDiscoveryReqType>(iso20_ac_AC_ChargeParameterDiscoveryReqType const&) (include/iso15118/detail/variant_access.hpp:23)not called0.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AuthorizationRequest, iso20_AuthorizationReqType>(iso20_AuthorizationReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::AuthorizationSetupRequest, iso20_AuthorizationSetupReqType>(iso20_AuthorizationSetupReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_CableCheckRequest, iso20_dc_DC_CableCheckReqType>(iso20_dc_DC_CableCheckReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_ChargeLoopRequest, iso20_dc_DC_ChargeLoopReqType>(iso20_dc_DC_ChargeLoopReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 4 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_ChargeParameterDiscoveryRequest, iso20_dc_DC_ChargeParameterDiscoveryReqType>(iso20_dc_DC_ChargeParameterDiscoveryReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_PreChargeRequest, iso20_dc_DC_PreChargeReqType>(iso20_dc_DC_PreChargeReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::DC_WeldingDetectionRequest, iso20_dc_DC_WeldingDetectionReqType>(iso20_dc_DC_WeldingDetectionReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::PowerDeliveryRequest, iso20_PowerDeliveryReqType>(iso20_PowerDeliveryReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ScheduleExchangeRequest, iso20_ScheduleExchangeReqType>(iso20_ScheduleExchangeReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 4 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceDetailRequest, iso20_ServiceDetailReqType>(iso20_ServiceDetailReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceDiscoveryRequest, iso20_ServiceDiscoveryReqType>(iso20_ServiceDiscoveryReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::ServiceSelectionRequest, iso20_ServiceSelectionReqType>(iso20_ServiceSelectionReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SessionSetupRequest, iso20_SessionSetupReqType>(iso20_SessionSetupReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SessionStopRequest, iso20_SessionStopReqType>(iso20_SessionStopReqType const&) (include/iso15118/detail/variant_access.hpp:23)called 2 times86.0%
void iso15118::message_20::VariantAccess::insert_type<iso15118::message_20::SupportedAppProtocolRequest, appHand_supportedAppProtocolReq>(appHand_supportedAppProtocolReq const&) (include/iso15118/detail/variant_access.hpp:23)called 4 times86.0%
void iso15118::message_20::convert<appHand_supportedAppProtocolReq, iso15118::message_20::SupportedAppProtocolRequest>(appHand_supportedAppProtocolReq const&, iso15118::message_20::SupportedAppProtocolRequest&) (src/iso15118/message/supported_app_protocol.cpp:14)called 4 times80.0%
void iso15118::message_20::convert<iso15118::message_20::AC_ChargeLoopResponse, iso20_ac_AC_ChargeLoopResType>(iso15118::message_20::AC_ChargeLoopResponse const&, iso20_ac_AC_ChargeLoopResType&) (src/iso15118/message/ac_charge_loop.cpp:266)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::AC_ChargeParameterDiscoveryResponse, iso20_ac_AC_ChargeParameterDiscoveryResType>(iso15118::message_20::AC_ChargeParameterDiscoveryResponse const&, iso20_ac_AC_ChargeParameterDiscoveryResType&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:109)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::AuthorizationResponse, iso20_AuthorizationResType>(iso15118::message_20::AuthorizationResponse const&, iso20_AuthorizationResType&) (src/iso15118/message/authorization.cpp:29)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::AuthorizationSetupResponse, iso20_AuthorizationSetupResType>(iso15118::message_20::AuthorizationSetupResponse const&, iso20_AuthorizationSetupResType&) (src/iso15118/message/authorization_setup.cpp:34)called 4 times100.0%
void iso15118::message_20::convert<iso15118::message_20::DC_CableCheckResponse, iso20_dc_DC_CableCheckResType>(iso15118::message_20::DC_CableCheckResponse const&, iso20_dc_DC_CableCheckResType&) (src/iso15118/message/dc_cable_check.cpp:22)called 4 times100.0%
void iso15118::message_20::convert<iso15118::message_20::DC_ChargeLoopResponse, iso20_dc_DC_ChargeLoopResType>(iso15118::message_20::DC_ChargeLoopResponse const&, iso20_dc_DC_ChargeLoopResType&) (src/iso15118/message/dc_charge_loop.cpp:233)called 2 times75.0%
void iso15118::message_20::convert<iso15118::message_20::DC_ChargeParameterDiscoveryResponse, iso20_dc_DC_ChargeParameterDiscoveryResType>(iso15118::message_20::DC_ChargeParameterDiscoveryResponse const&, iso20_dc_DC_ChargeParameterDiscoveryResType&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:112)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::DC_PreChargeResponse, iso20_dc_DC_PreChargeResType>(iso15118::message_20::DC_PreChargeResponse const&, iso20_dc_DC_PreChargeResType&) (src/iso15118/message/dc_pre_charge.cpp:26)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::DC_WeldingDetectionResponse, iso20_dc_DC_WeldingDetectionResType>(iso15118::message_20::DC_WeldingDetectionResponse const&, iso20_dc_DC_WeldingDetectionResType&) (src/iso15118/message/dc_welding_detection.cpp:24)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::Header, iso20_MessageHeaderType>(iso15118::message_20::Header const&, iso20_MessageHeaderType&) (src/iso15118/message/common_types.cpp:36)called 24 times100.0%
void iso15118::message_20::convert<iso15118::message_20::Header, iso20_ac_MessageHeaderType>(iso15118::message_20::Header const&, iso20_ac_MessageHeaderType&) (src/iso15118/message/common_types.cpp:46)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::Header, iso20_dc_MessageHeaderType>(iso15118::message_20::Header const&, iso20_dc_MessageHeaderType&) (src/iso15118/message/common_types.cpp:41)called 12 times100.0%
void iso15118::message_20::convert<iso15118::message_20::PowerDeliveryResponse, iso20_PowerDeliveryResType>(iso15118::message_20::PowerDeliveryResponse const&, iso20_PowerDeliveryResType&) (src/iso15118/message/power_delivery.cpp:64)called 2 times78.0%
void iso15118::message_20::convert<iso15118::message_20::ScheduleExchangeResponse, iso20_ScheduleExchangeResType>(iso15118::message_20::ScheduleExchangeResponse const&, iso20_ScheduleExchangeResType&) (src/iso15118/message/schedule_exchange.cpp:335)called 6 times85.0%
void iso15118::message_20::convert<iso15118::message_20::ServiceDetailResponse, iso20_ServiceDetailResType>(iso15118::message_20::ServiceDetailResponse const&, iso20_ServiceDetailResType&) (src/iso15118/message/service_detail.cpp:153)called 2 times79.0%
void iso15118::message_20::convert<iso15118::message_20::ServiceDiscoveryResponse, iso20_ServiceDiscoveryResType>(iso15118::message_20::ServiceDiscoveryResponse const&, iso20_ServiceDiscoveryResType&) (src/iso15118/message/service_discovery.cpp:23)called 2 times56.0%
void iso15118::message_20::convert<iso15118::message_20::ServiceSelectionResponse, iso20_ServiceSelectionResType>(iso15118::message_20::ServiceSelectionResponse const&, iso20_ServiceSelectionResType&) (src/iso15118/message/service_selection.cpp:33)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::SessionSetupResponse, iso20_SessionSetupResType>(iso15118::message_20::SessionSetupResponse const&, iso20_SessionSetupResType&) (src/iso15118/message/session_setup.cpp:22)called 2 times71.0%
void iso15118::message_20::convert<iso15118::message_20::SessionStopResponse, iso20_SessionStopResType>(iso15118::message_20::SessionStopResponse const&, iso20_SessionStopResType&) (src/iso15118/message/session_stop.cpp:29)called 2 times100.0%
void iso15118::message_20::convert<iso15118::message_20::SupportedAppProtocolRequest, appHand_supportedAppProtocolReq>(iso15118::message_20::SupportedAppProtocolRequest const&, appHand_supportedAppProtocolReq&) (src/iso15118/message/supported_app_protocol.cpp:30)called 2 times78.0%
void iso15118::message_20::convert<iso15118::message_20::SupportedAppProtocolResponse, appHand_supportedAppProtocolRes>(iso15118::message_20::SupportedAppProtocolResponse const&, appHand_supportedAppProtocolRes&) (src/iso15118/message/supported_app_protocol.cpp:49)called 2 times71.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::AbsolutePriceSchedule, iso20_AbsolutePriceScheduleType>(iso15118::message_20::datatypes::AbsolutePriceSchedule const&, iso20_AbsolutePriceScheduleType&) (src/iso15118/message/schedule_exchange.cpp:167)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::BPT_Dynamic_AC_CLResControlMode, iso20_ac_BPT_Dynamic_AC_CLResControlModeType>(iso15118::message_20::datatypes::BPT_Dynamic_AC_CLResControlMode const&, iso20_ac_BPT_Dynamic_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:221)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode, iso20_dc_BPT_Dynamic_DC_CLResControlModeType>(iso15118::message_20::datatypes::BPT_Dynamic_DC_CLResControlMode const&, iso20_dc_BPT_Dynamic_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:187)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::BPT_Scheduled_AC_CLResControlMode, iso20_ac_BPT_Scheduled_AC_CLResControlModeType>(iso15118::message_20::datatypes::BPT_Scheduled_AC_CLResControlMode const&, iso20_ac_BPT_Scheduled_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:192)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::BPT_Scheduled_DC_CLResControlMode, iso20_dc_BPT_Scheduled_DC_CLResControlModeType>(iso15118::message_20::datatypes::BPT_Scheduled_DC_CLResControlMode const&, iso20_dc_BPT_Scheduled_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:167)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::ChargingSchedule, iso20_ChargingScheduleType>(iso15118::message_20::datatypes::ChargingSchedule const&, iso20_ChargingScheduleType&) (src/iso15118/message/schedule_exchange.cpp:285)called 4 times100.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::DetailedCost, iso20_ac_DetailedCostType>(iso15118::message_20::datatypes::DetailedCost const&, iso20_ac_DetailedCostType&) (src/iso15118/message/ac_charge_loop.cpp:147)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::DetailedCost, iso20_dc_DetailedCostType>(iso15118::message_20::datatypes::DetailedCost const&, iso20_dc_DetailedCostType&) (src/iso15118/message/dc_charge_loop.cpp:122)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::DetailedTax, iso20_ac_DetailedTaxType>(iso15118::message_20::datatypes::DetailedTax const&, iso20_ac_DetailedTaxType&) (src/iso15118/message/ac_charge_loop.cpp:153)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::DetailedTax, iso20_dc_DetailedTaxType>(iso15118::message_20::datatypes::DetailedTax const&, iso20_dc_DetailedTaxType&) (src/iso15118/message/dc_charge_loop.cpp:128)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::EvseStatus, iso20_EVSEStatusType>(iso15118::message_20::datatypes::EvseStatus const&, iso20_EVSEStatusType&) (src/iso15118/message/common_types.cpp:109)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::EvseStatus, iso20_ac_EVSEStatusType>(iso15118::message_20::datatypes::EvseStatus const&, iso20_ac_EVSEStatusType&) (src/iso15118/message/common_types.cpp:76)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::EvseStatus, iso20_dc_EVSEStatusType>(iso15118::message_20::datatypes::EvseStatus const&, iso20_dc_EVSEStatusType&) (src/iso15118/message/common_types.cpp:71)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::MeterInfo, iso20_ac_MeterInfoType>(iso15118::message_20::datatypes::MeterInfo const&, iso20_ac_MeterInfoType&) (src/iso15118/message/common_types.cpp:104)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::MeterInfo, iso20_dc_MeterInfoType>(iso15118::message_20::datatypes::MeterInfo const&, iso20_dc_MeterInfoType&) (src/iso15118/message/common_types.cpp:99)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::OverstayRule, iso20_OverstayRuleType>(iso15118::message_20::datatypes::OverstayRule const&, iso20_OverstayRuleType&) (src/iso15118/message/schedule_exchange.cpp:160)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::PowerSchedule, iso20_PowerScheduleType>(iso15118::message_20::datatypes::PowerSchedule const&, iso20_PowerScheduleType&) (src/iso15118/message/schedule_exchange.cpp:104)called 4 times67.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::PriceLevelSchedule, iso20_PriceLevelScheduleType>(iso15118::message_20::datatypes::PriceLevelSchedule const&, iso20_PriceLevelScheduleType&) (src/iso15118/message/schedule_exchange.cpp:239)called 2 times33.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::PriceRule, iso20_PriceRuleType>(iso15118::message_20::datatypes::PriceRule const&, iso20_PriceRuleType&) (src/iso15118/message/schedule_exchange.cpp:139)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::PriceRuleStack, iso20_PriceRuleStackType>(iso15118::message_20::datatypes::PriceRuleStack const&, iso20_PriceRuleStackType&) (src/iso15118/message/schedule_exchange.cpp:148)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::Receipt, iso20_ac_ReceiptType>(iso15118::message_20::datatypes::Receipt const&, iso20_ac_ReceiptType&) (src/iso15118/message/ac_charge_loop.cpp:159)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::Receipt, iso20_dc_ReceiptType>(iso15118::message_20::datatypes::Receipt const&, iso20_dc_ReceiptType&) (src/iso15118/message/dc_charge_loop.cpp:134)not called0.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::ScheduleTuple, iso20_ScheduleTupleType>(iso15118::message_20::datatypes::ScheduleTuple const&, iso20_ScheduleTupleType&) (src/iso15118/message/schedule_exchange.cpp:292)called 4 times75.0%
void iso15118::message_20::convert<iso15118::message_20::datatypes::TaxRule, iso20_TaxRuleType>(iso15118::message_20::datatypes::TaxRule const&, iso20_TaxRuleType&) (src/iso15118/message/schedule_exchange.cpp:128)not called0.0%
void iso15118::message_20::convert<iso20_AuthorizationReqType, iso15118::message_20::AuthorizationRequest>(iso20_AuthorizationReqType const&, iso15118::message_20::AuthorizationRequest&) (src/iso15118/message/authorization.cpp:13)called 2 times21.0%
void iso15118::message_20::convert<iso20_AuthorizationSetupReqType, iso15118::message_20::AuthorizationSetupRequest>(iso20_AuthorizationSetupReqType const&, iso15118::message_20::AuthorizationSetupRequest&) (src/iso15118/message/authorization_setup.cpp:13)called 2 times100.0%
void iso15118::message_20::convert<iso20_Dynamic_SEReqControlModeType, iso15118::message_20::datatypes::Dynamic_SEReqControlMode>(iso20_Dynamic_SEReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_SEReqControlMode&) (src/iso15118/message/schedule_exchange.cpp:77)called 2 times100.0%
void iso15118::message_20::convert<iso20_EVAbsolutePriceScheduleType, iso15118::message_20::datatypes::EVAbsolutePriceSchedule>(iso20_EVAbsolutePriceScheduleType const&, iso15118::message_20::datatypes::EVAbsolutePriceSchedule&) (src/iso15118/message/schedule_exchange.cpp:48)called 2 times72.0%
void iso15118::message_20::convert<iso20_EVEnergyOfferType, iso15118::message_20::datatypes::EVEnergyOffer>(iso20_EVEnergyOfferType const&, iso15118::message_20::datatypes::EVEnergyOffer&) (src/iso15118/message/schedule_exchange.cpp:62)called 2 times100.0%
void iso15118::message_20::convert<iso20_EVPowerProfileType, iso15118::message_20::datatypes::PowerProfile>(iso20_EVPowerProfileType const&, iso15118::message_20::datatypes::PowerProfile&) (src/iso15118/message/power_delivery.cpp:28)called 2 times71.0%
void iso15118::message_20::convert<iso20_EVPowerScheduleEntryType, iso15118::message_20::datatypes::EVPowerScheduleEntry>(iso20_EVPowerScheduleEntryType const&, iso15118::message_20::datatypes::EVPowerScheduleEntry&) (src/iso15118/message/schedule_exchange.cpp:15)called 2 times100.0%
void iso15118::message_20::convert<iso20_EVPowerScheduleType, iso15118::message_20::datatypes::EVPowerSchedule>(iso20_EVPowerScheduleType const&, iso15118::message_20::datatypes::EVPowerSchedule&) (src/iso15118/message/schedule_exchange.cpp:20)called 2 times100.0%
void iso15118::message_20::convert<iso20_EVPriceRuleStackType, iso15118::message_20::datatypes::EVPriceRuleStack>(iso20_EVPriceRuleStackType const&, iso15118::message_20::datatypes::EVPriceRuleStack&) (src/iso15118/message/schedule_exchange.cpp:36)called 2 times100.0%
void iso15118::message_20::convert<iso20_EVPriceRuleType, iso15118::message_20::datatypes::EVPriceRule>(iso20_EVPriceRuleType const&, iso15118::message_20::datatypes::EVPriceRule&) (src/iso15118/message/schedule_exchange.cpp:31)called 2 times100.0%
void iso15118::message_20::convert<iso20_MessageHeaderType>(iso20_MessageHeaderType const&, iso15118::message_20::Header&) (src/iso15118/message/common_types.cpp:16)called 20 times100.0%
void iso15118::message_20::convert<iso20_PowerDeliveryReqType, iso15118::message_20::PowerDeliveryRequest>(iso20_PowerDeliveryReqType const&, iso15118::message_20::PowerDeliveryRequest&) (src/iso15118/message/power_delivery.cpp:54)called 2 times80.0%
void iso15118::message_20::convert<iso20_PowerScheduleEntryType, iso15118::message_20::datatypes::PowerScheduleEntry>(iso20_PowerScheduleEntryType const&, iso15118::message_20::datatypes::PowerScheduleEntry&) (src/iso15118/message/power_delivery.cpp:21)called 2 times50.0%
void iso15118::message_20::convert<iso20_RationalNumberType>(iso15118::message_20::datatypes::RationalNumber const&, iso20_RationalNumberType&) (src/iso15118/message/common_types.cpp:62)called 4 times100.0%
void iso15118::message_20::convert<iso20_RationalNumberType>(iso20_RationalNumberType const&, iso15118::message_20::datatypes::RationalNumber&) (src/iso15118/message/common_types.cpp:52)called 24 times100.0%
void iso15118::message_20::convert<iso20_ScheduleExchangeReqType, iso15118::message_20::ScheduleExchangeRequest>(iso20_ScheduleExchangeReqType const&, iso15118::message_20::ScheduleExchangeRequest&) (src/iso15118/message/schedule_exchange.cpp:88)called 4 times69.0%
void iso15118::message_20::convert<iso20_Scheduled_EVPPTControlModeType, iso15118::message_20::datatypes::Scheduled_EVPPTControlMode>(iso20_Scheduled_EVPPTControlModeType const&, iso15118::message_20::datatypes::Scheduled_EVPPTControlMode&) (src/iso15118/message/power_delivery.cpp:14)called 2 times100.0%
void iso15118::message_20::convert<iso20_Scheduled_SEReqControlModeType, iso15118::message_20::datatypes::Scheduled_SEReqControlMode>(iso20_Scheduled_SEReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_SEReqControlMode&) (src/iso15118/message/schedule_exchange.cpp:68)called 2 times100.0%
void iso15118::message_20::convert<iso20_ServiceDetailReqType, iso15118::message_20::ServiceDetailRequest>(iso20_ServiceDetailReqType const&, iso15118::message_20::ServiceDetailRequest&) (src/iso15118/message/service_detail.cpp:116)called 2 times100.0%
void iso15118::message_20::convert<iso20_ServiceDiscoveryReqType, iso15118::message_20::ServiceDiscoveryRequest>(iso20_ServiceDiscoveryReqType const&, iso15118::message_20::ServiceDiscoveryRequest&) (src/iso15118/message/service_discovery.cpp:13)called 2 times40.0%
void iso15118::message_20::convert<iso20_ServiceSelectionReqType, iso15118::message_20::ServiceSelectionRequest>(iso20_ServiceSelectionReqType const&, iso15118::message_20::ServiceSelectionRequest&) (src/iso15118/message/service_selection.cpp:13)called 2 times33.0%
void iso15118::message_20::convert<iso20_SessionSetupReqType, iso15118::message_20::SessionSetupRequest>(iso20_SessionSetupReqType const&, iso15118::message_20::SessionSetupRequest&) (src/iso15118/message/session_setup.cpp:17)called 2 times73.0%
void iso15118::message_20::convert<iso20_SessionStopReqType, iso15118::message_20::SessionStopRequest>(iso20_SessionStopReqType const&, iso15118::message_20::SessionStopRequest&) (src/iso15118/message/session_stop.cpp:13)called 2 times24.0%
void iso15118::message_20::convert<iso20_ac_AC_CPDReqEnergyTransferModeType, iso15118::message_20::datatypes::AC_CPDReqEnergyTransferMode>(iso20_ac_AC_CPDReqEnergyTransferModeType const&, iso15118::message_20::datatypes::AC_CPDReqEnergyTransferMode&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:20)not called0.0%
void iso15118::message_20::convert<iso20_ac_AC_ChargeLoopReqType, iso15118::message_20::AC_ChargeLoopRequest>(iso20_ac_AC_ChargeLoopReqType const&, iso15118::message_20::AC_ChargeLoopRequest&) (src/iso15118/message/ac_charge_loop.cpp:120)not called0.0%
void iso15118::message_20::convert<iso20_ac_AC_ChargeParameterDiscoveryReqType, iso15118::message_20::AC_ChargeParameterDiscoveryRequest>(iso20_ac_AC_ChargeParameterDiscoveryReqType const&, iso15118::message_20::AC_ChargeParameterDiscoveryRequest&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:46)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_AC_CPDReqEnergyTransferModeType, iso15118::message_20::datatypes::BPT_AC_CPDReqEnergyTransferMode>(iso20_ac_BPT_AC_CPDReqEnergyTransferModeType const&, iso15118::message_20::datatypes::BPT_AC_CPDReqEnergyTransferMode&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:29)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Dynamic_AC_CLReqControlModeType, iso15118::message_20::datatypes::BPT_Dynamic_AC_CLReqControlMode>(iso20_ac_BPT_Dynamic_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::BPT_Dynamic_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:104)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Dynamic_AC_CLReqControlModeType>(iso20_ac_BPT_Dynamic_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:81)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Dynamic_AC_CLReqControlModeType>(iso20_ac_BPT_Dynamic_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:74)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Dynamic_AC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_AC_CLResControlMode const&, iso20_ac_BPT_Dynamic_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:204)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Dynamic_AC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_CLResControlMode const&, iso20_ac_BPT_Dynamic_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:197)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Scheduled_AC_CLReqControlModeType, iso15118::message_20::datatypes::BPT_Scheduled_AC_CLReqControlMode>(iso20_ac_BPT_Scheduled_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::BPT_Scheduled_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:60)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Scheduled_AC_CLReqControlModeType>(iso20_ac_BPT_Scheduled_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:37)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Scheduled_AC_CLReqControlModeType>(iso20_ac_BPT_Scheduled_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:31)not called0.0%
void iso15118::message_20::convert<iso20_ac_BPT_Scheduled_AC_CLResControlModeType>(iso15118::message_20::datatypes::Scheduled_AC_CLResControlMode const&, iso20_ac_BPT_Scheduled_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:177)not called0.0%
void iso15118::message_20::convert<iso20_ac_DisplayParametersType, iso15118::message_20::datatypes::DisplayParameters>(iso20_ac_DisplayParametersType const&, iso15118::message_20::datatypes::DisplayParameters&) (src/iso15118/message/ac_charge_loop.cpp:14)not called0.0%
void iso15118::message_20::convert<iso20_ac_Dynamic_AC_CLReqControlModeType>(iso20_ac_Dynamic_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:81)not called0.0%
void iso15118::message_20::convert<iso20_ac_Dynamic_AC_CLReqControlModeType>(iso20_ac_Dynamic_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:74)not called0.0%
void iso15118::message_20::convert<iso20_ac_Dynamic_AC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_AC_CLResControlMode const&, iso20_ac_Dynamic_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:204)not called0.0%
void iso15118::message_20::convert<iso20_ac_Dynamic_AC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_CLResControlMode const&, iso20_ac_Dynamic_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:197)not called0.0%
void iso15118::message_20::convert<iso20_ac_MessageHeaderType>(iso20_ac_MessageHeaderType const&, iso15118::message_20::Header&) (src/iso15118/message/common_types.cpp:16)not called0.0%
void iso15118::message_20::convert<iso20_ac_RationalNumberType>(iso15118::message_20::datatypes::RationalNumber const&, iso20_ac_RationalNumberType&) (src/iso15118/message/common_types.cpp:62)not called0.0%
void iso15118::message_20::convert<iso20_ac_RationalNumberType>(iso20_ac_RationalNumberType const&, iso15118::message_20::datatypes::RationalNumber&) (src/iso15118/message/common_types.cpp:52)not called0.0%
void iso15118::message_20::convert<iso20_ac_Scheduled_AC_CLReqControlModeType>(iso20_ac_Scheduled_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_AC_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:37)not called0.0%
void iso15118::message_20::convert<iso20_ac_Scheduled_AC_CLReqControlModeType>(iso20_ac_Scheduled_AC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_CLReqControlMode&) (src/iso15118/message/ac_charge_loop.cpp:31)not called0.0%
void iso15118::message_20::convert<iso20_ac_Scheduled_AC_CLResControlModeType>(iso15118::message_20::datatypes::Scheduled_AC_CLResControlMode const&, iso20_ac_Scheduled_AC_CLResControlModeType&) (src/iso15118/message/ac_charge_loop.cpp:177)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_DC_CPDReqEnergyTransferModeType, iso15118::message_20::datatypes::BPT_DC_CPDReqEnergyTransferMode>(iso20_dc_BPT_DC_CPDReqEnergyTransferModeType const&, iso15118::message_20::datatypes::BPT_DC_CPDReqEnergyTransferMode&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:32)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Dynamic_DC_CLReqControlModeType, iso15118::message_20::datatypes::BPT_Dynamic_DC_CLReqControlMode>(iso20_dc_BPT_Dynamic_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::BPT_Dynamic_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:82)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Dynamic_DC_CLReqControlModeType>(iso20_dc_BPT_Dynamic_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:62)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Dynamic_DC_CLReqControlModeType>(iso20_dc_BPT_Dynamic_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:69)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Dynamic_DC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_CLResControlMode const&, iso20_dc_BPT_Dynamic_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:159)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Dynamic_DC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode const&, iso20_dc_BPT_Dynamic_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:177)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Scheduled_DC_CLReqControlModeType, iso15118::message_20::datatypes::BPT_Scheduled_DC_CLReqControlMode>(iso20_dc_BPT_Scheduled_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::BPT_Scheduled_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:52)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Scheduled_DC_CLReqControlModeType>(iso20_dc_BPT_Scheduled_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:30)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Scheduled_DC_CLReqControlModeType>(iso20_dc_BPT_Scheduled_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:36)not called0.0%
void iso15118::message_20::convert<iso20_dc_BPT_Scheduled_DC_CLResControlModeType>(iso15118::message_20::datatypes::Scheduled_DC_CLResControlMode const&, iso20_dc_BPT_Scheduled_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:152)not called0.0%
void iso15118::message_20::convert<iso20_dc_DC_CPDReqEnergyTransferModeType, iso15118::message_20::datatypes::DC_CPDReqEnergyTransferMode>(iso20_dc_DC_CPDReqEnergyTransferModeType const&, iso15118::message_20::datatypes::DC_CPDReqEnergyTransferMode&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:20)called 2 times89.0%
void iso15118::message_20::convert<iso20_dc_DC_CableCheckReqType, iso15118::message_20::DC_CableCheckRequest>(iso20_dc_DC_CableCheckReqType const&, iso15118::message_20::DC_CableCheckRequest&) (src/iso15118/message/dc_cable_check.cpp:14)called 2 times100.0%
void iso15118::message_20::convert<iso20_dc_DC_ChargeLoopReqType, iso15118::message_20::DC_ChargeLoopRequest>(iso20_dc_DC_ChargeLoopReqType const&, iso15118::message_20::DC_ChargeLoopRequest&) (src/iso15118/message/dc_charge_loop.cpp:93)called 4 times68.0%
void iso15118::message_20::convert<iso20_dc_DC_ChargeParameterDiscoveryReqType, iso15118::message_20::DC_ChargeParameterDiscoveryRequest>(iso20_dc_DC_ChargeParameterDiscoveryReqType const&, iso15118::message_20::DC_ChargeParameterDiscoveryRequest&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:50)called 2 times62.0%
void iso15118::message_20::convert<iso20_dc_DC_PreChargeReqType, iso15118::message_20::DC_PreChargeRequest>(iso20_dc_DC_PreChargeReqType const&, iso15118::message_20::DC_PreChargeRequest&) (src/iso15118/message/dc_pre_charge.cpp:14)called 2 times100.0%
void iso15118::message_20::convert<iso20_dc_DC_WeldingDetectionReqType, iso15118::message_20::DC_WeldingDetectionRequest>(iso20_dc_DC_WeldingDetectionReqType const&, iso15118::message_20::DC_WeldingDetectionRequest&) (src/iso15118/message/dc_welding_detection.cpp:14)called 2 times100.0%
void iso15118::message_20::convert<iso20_dc_DisplayParametersType, iso15118::message_20::datatypes::DisplayParameters>(iso20_dc_DisplayParametersType const&, iso15118::message_20::datatypes::DisplayParameters&) (src/iso15118/message/dc_charge_loop.cpp:14)called 2 times52.0%
void iso15118::message_20::convert<iso20_dc_Dynamic_DC_CLReqControlModeType>(iso20_dc_Dynamic_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:62)called 2 times71.0%
void iso15118::message_20::convert<iso20_dc_Dynamic_DC_CLReqControlModeType>(iso20_dc_Dynamic_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Dynamic_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:69)called 2 times100.0%
void iso15118::message_20::convert<iso20_dc_Dynamic_DC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_CLResControlMode const&, iso20_dc_Dynamic_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:159)not called0.0%
void iso15118::message_20::convert<iso20_dc_Dynamic_DC_CLResControlModeType>(iso15118::message_20::datatypes::Dynamic_DC_CLResControlMode const&, iso20_dc_Dynamic_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:177)not called0.0%
void iso15118::message_20::convert<iso20_dc_MessageHeaderType>(iso20_dc_MessageHeaderType const&, iso15118::message_20::Header&) (src/iso15118/message/common_types.cpp:16)called 12 times100.0%
void iso15118::message_20::convert<iso20_dc_RationalNumberType>(iso15118::message_20::datatypes::RationalNumber const&, iso20_dc_RationalNumberType&) (src/iso15118/message/common_types.cpp:62)called 20 times100.0%
void iso15118::message_20::convert<iso20_dc_RationalNumberType>(iso20_dc_RationalNumberType const&, iso15118::message_20::datatypes::RationalNumber&) (src/iso15118/message/common_types.cpp:52)called 40 times100.0%
void iso15118::message_20::convert<iso20_dc_Scheduled_DC_CLReqControlModeType>(iso20_dc_Scheduled_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:30)called 2 times40.0%
void iso15118::message_20::convert<iso20_dc_Scheduled_DC_CLReqControlModeType>(iso20_dc_Scheduled_DC_CLReqControlModeType const&, iso15118::message_20::datatypes::Scheduled_DC_CLReqControlMode&) (src/iso15118/message/dc_charge_loop.cpp:36)called 2 times47.0%
void iso15118::message_20::convert<iso20_dc_Scheduled_DC_CLResControlModeType>(iso15118::message_20::datatypes::Scheduled_DC_CLResControlMode const&, iso20_dc_Scheduled_DC_CLResControlModeType&) (src/iso15118/message/dc_charge_loop.cpp:152)called 2 times62.0%
void iso15118::message_20::convert<std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule>, iso20_ChargingScheduleType>(std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule> const&, iso20_ChargingScheduleType&) (src/iso15118/message/schedule_exchange.cpp:278)called 4 times100.0%
void iso15118::message_20::convert<std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule>, iso20_Dynamic_SEResControlModeType>(std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule> const&, iso20_Dynamic_SEResControlModeType&) (src/iso15118/message/schedule_exchange.cpp:281)called 2 times100.0%
void iso15118::message_20::convert_header<iso20_MessageHeaderType>(iso15118::message_20::Header const&, iso20_MessageHeaderType&) (src/iso15118/message/common_types.cpp:28)called 24 times100.0%
void iso15118::message_20::convert_header<iso20_ac_MessageHeaderType>(iso15118::message_20::Header const&, iso20_ac_MessageHeaderType&) (src/iso15118/message/common_types.cpp:28)not called0.0%
void iso15118::message_20::convert_header<iso20_dc_MessageHeaderType>(iso15118::message_20::Header const&, iso20_dc_MessageHeaderType&) (src/iso15118/message/common_types.cpp:28)called 12 times100.0%
void iso15118::message_20::convert_meterinfo<iso20_ac_MeterInfoType>(iso15118::message_20::datatypes::MeterInfo const&, iso20_ac_MeterInfoType&) (src/iso15118/message/common_types.cpp:81)not called0.0%
void iso15118::message_20::convert_meterinfo<iso20_dc_MeterInfoType>(iso15118::message_20::datatypes::MeterInfo const&, iso20_dc_MeterInfoType&) (src/iso15118/message/common_types.cpp:81)not called0.0%
void iso15118::message_20::convert_price_schedule<iso20_ChargingScheduleType>(std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule> const&, iso20_ChargingScheduleType&) (src/iso15118/message/schedule_exchange.cpp:264)called 4 times80.0%
void iso15118::message_20::convert_price_schedule<iso20_Dynamic_SEResControlModeType>(std::variant<std::monostate, iso15118::message_20::datatypes::AbsolutePriceSchedule, iso15118::message_20::datatypes::PriceLevelSchedule> const&, iso20_Dynamic_SEResControlModeType&) (src/iso15118/message/schedule_exchange.cpp:264)called 2 times60.0%
void iso15118::message_20::insert_type<appHand_supportedAppProtocolReq>(iso15118::message_20::VariantAccess&, appHand_supportedAppProtocolReq const&) (src/iso15118/message/supported_app_protocol.cpp:60)called 4 times100.0%
void iso15118::message_20::insert_type<iso20_AuthorizationReqType>(iso15118::message_20::VariantAccess&, iso20_AuthorizationReqType const&) (src/iso15118/message/authorization.cpp:38)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_AuthorizationSetupReqType>(iso15118::message_20::VariantAccess&, iso20_AuthorizationSetupReqType const&) (src/iso15118/message/authorization_setup.cpp:53)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_PowerDeliveryReqType>(iso15118::message_20::VariantAccess&, iso20_PowerDeliveryReqType const&) (src/iso15118/message/power_delivery.cpp:73)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_ScheduleExchangeReqType>(iso15118::message_20::VariantAccess&, iso20_ScheduleExchangeReqType const&) (src/iso15118/message/schedule_exchange.cpp:348)called 4 times100.0%
void iso15118::message_20::insert_type<iso20_ServiceDetailReqType>(iso15118::message_20::VariantAccess&, iso20_ServiceDetailReqType const&) (src/iso15118/message/service_detail.cpp:179)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_ServiceDiscoveryReqType>(iso15118::message_20::VariantAccess&, iso20_ServiceDiscoveryReqType const&) (src/iso15118/message/service_discovery.cpp:51)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_ServiceSelectionReqType>(iso15118::message_20::VariantAccess&, iso20_ServiceSelectionReqType const&) (src/iso15118/message/service_selection.cpp:41)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_SessionSetupReqType>(iso15118::message_20::VariantAccess&, iso20_SessionSetupReqType const&) (src/iso15118/message/session_setup.cpp:32)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_SessionStopReqType>(iso15118::message_20::VariantAccess&, iso20_SessionStopReqType const&) (src/iso15118/message/session_stop.cpp:25)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_ac_AC_ChargeLoopReqType>(iso15118::message_20::VariantAccess&, iso20_ac_AC_ChargeLoopReqType const&) (src/iso15118/message/ac_charge_loop.cpp:143)not called0.0%
void iso15118::message_20::insert_type<iso20_ac_AC_ChargeParameterDiscoveryReqType>(iso15118::message_20::VariantAccess&, iso20_ac_AC_ChargeParameterDiscoveryReqType const&) (src/iso15118/message/ac_charge_parameter_discovery.cpp:57)not called0.0%
void iso15118::message_20::insert_type<iso20_dc_DC_CableCheckReqType>(iso15118::message_20::VariantAccess&, iso20_dc_DC_CableCheckReqType const&) (src/iso15118/message/dc_cable_check.cpp:18)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_dc_DC_ChargeLoopReqType>(iso15118::message_20::VariantAccess&, iso20_dc_DC_ChargeLoopReqType const&) (src/iso15118/message/dc_charge_loop.cpp:118)called 4 times100.0%
void iso15118::message_20::insert_type<iso20_dc_DC_ChargeParameterDiscoveryReqType>(iso15118::message_20::VariantAccess&, iso20_dc_DC_ChargeParameterDiscoveryReqType const&) (src/iso15118/message/dc_charge_parameter_discovery.cpp:65)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_dc_DC_PreChargeReqType>(iso15118::message_20::VariantAccess&, iso20_dc_DC_PreChargeReqType const&) (src/iso15118/message/dc_pre_charge.cpp:22)called 2 times100.0%
void iso15118::message_20::insert_type<iso20_dc_DC_WeldingDetectionReqType>(iso15118::message_20::VariantAccess&, iso20_dc_DC_WeldingDetectionReqType const&) (src/iso15118/message/dc_welding_detection.cpp:20)called 2 times100.0%
+ +
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.cpp.17ed95eb78fe6481b69603a77247f5cc.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.cpp.17ed95eb78fe6481b69603a77247f5cc.html new file mode 100644 index 000000000..3f418568b --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.cpp.17ed95eb78fe6481b69603a77247f5cc.html @@ -0,0 +1,243 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/misc/helper.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:040.0%
Functions:020.0%
Branches:0160.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/detail/helper.hpp>
4 +
5 + #include <cerrno>
6 + #include <cstdio>
7 + #include <cstring>
8 + #include <stdexcept>
9 +
10 + namespace iso15118 {
11 +
12 + std::string adding_err_msg(const std::string& msg) {
13 + return (msg + " (reason: " + strerror(errno) + ")");
14 + }
15 +
16 + void log_and_throw(const char* msg) {
17 + throw std::runtime_error(std::string(msg) + " (reason: " + strerror(errno) + ")");
18 + }
19 +
20 + } // namespace iso15118
21 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.hpp.71e61f5fe360e6a860e459e45116142f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.hpp.71e61f5fe360e6a860e459e45116142f.html new file mode 100644 index 000000000..62fd05da4 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper.hpp.71e61f5fe360e6a860e459e45116142f.html @@ -0,0 +1,474 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/detail/helper.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:4757.1%
Functions:020.0%
Branches:060.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2024 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <iso15118/io/log_levels.hpp>
6 +
7 + #include <cstdarg>
8 + #include <cstdint>
9 + #include <cstdio>
10 + #include <functional>
11 + #include <string>
12 +
13 + namespace iso15118 {
14 +
15 + void logf(const char* fmt, ...);
16 + void logf(const LogLevel&, const char* fmt, ...);
17 +
18 + void logf_error(const char* fmt, ...);
19 + void logf_warning(const char* fmt, ...);
20 + void logf_info(const char* fmt, ...);
21 + void logf_debug(const char* fmt, ...);
22 + void logf_trace(const char* fmt, ...);
23 +
24 + void vlogf(const char* fmt, va_list ap);
25 + void vlogf(const LogLevel&, const char* fmt, va_list ap);
26 +
27 + void log(const LogLevel&, const std::string&);
28 +
29 + void log_and_throw(const char* msg);
30 +
31 + std::string adding_err_msg(const std::string& msg);
32 +
33 + 22template <typename CallbackType, typename... Args> bool call_if_available(const CallbackType& callback, Args... args) {
34 +
+ 0/2 +
+
✗ Branch 1 not taken.
+
✗ Branch 2 not taken.
+
+
+
22 if (not callback) {
35 + return false;
36 + }
37 +
38 + 22 std::invoke(callback, std::forward<Args>(args)...);
39 + 22 return true;
40 + }
41 +
42 + // Note(sl): Copied from https://en.cppreference.com/w/cpp/utility/intcmp because libiso15118 uses C++17
43 + template <class T, class U> constexpr bool cmp_equal(T t, U u) noexcept {
44 + if constexpr (std::is_signed_v<T> == std::is_signed_v<U>)
45 + return t == u;
46 + else if constexpr (std::is_signed_v<T>)
47 + return t >= 0 && std::make_unsigned_t<T>(t) == u;
48 + else
49 + return u >= 0 && std::make_unsigned_t<U>(u) == t;
50 + }
51 +
52 + } // namespace iso15118
53 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper_openssl.cpp.33d422763233065894d4a335938eeef8.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper_openssl.cpp.33d422763233065894d4a335938eeef8.html new file mode 100644 index 000000000..76d10f9c0 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.helper_openssl.cpp.33d422763233065894d4a335938eeef8.html @@ -0,0 +1,307 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/misc/helper_openssl.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0120.0%
Functions:030.0%
Branches:0160.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2024 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/detail/io/helper_openssl.hpp>
4 +
5 + #include <cassert>
6 + #include <stdexcept>
7 +
8 + #include <openssl/err.h>
9 +
10 + namespace iso15118::io {
11 +
12 + static int add_error_str(const char* str, std::size_t len, void* u) {
13 + assert(u);
14 + auto& text = *reinterpret_cast<std::string*>(u);
15 + text += ": " + std::string(str, len);
16 + return 0;
17 + }
18 +
19 + static void log_and_raise(const std::string& error_msg) {
20 + throw std::runtime_error(error_msg);
21 + }
22 +
23 + void log_and_raise_openssl_error(const std::string& error_msg) {
24 + std::string error_message = {error_msg};
25 + ERR_print_errors_cb(&add_error_str, &error_message);
26 + log_and_raise(error_message);
27 + }
28 +
29 + } // namespace iso15118::io
30 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.html new file mode 100644 index 000000000..f2c327e38 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.html @@ -0,0 +1,1165 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
Date:2024-12-09 13:28:44
Coverage: + low: ≥ 0% + medium: ≥ 75.0% + high: ≥ 90.0% +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:1442343342.0%
Functions:28658149.2%
Branches:646318420.3%
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileLinesFunctionsBranches
+ include/iso15118/d20/context.hpp + + 60.0 + 60.0%9 / 155.7%2 / 350.0%0 / 4
+ include/iso15118/d20/control_event.hpp + + 0.0 + 0.0%0 / 60.0%0 / 3-%0 / 0
+ include/iso15118/d20/session.hpp + + 91.3 + 91.3%21 / 2380.0%4 / 5-%0 / 0
+ include/iso15118/detail/cb_exi.hpp + + 88.9 + 88.9%8 / 978.8%26 / 3333.3%4 / 12
+ include/iso15118/detail/d20/context_helper.hpp + + 100.0 + 100.0%3 / 393.3%14 / 15-%0 / 0
+ include/iso15118/detail/helper.hpp + + 57.1 + 57.1%4 / 70.0%0 / 20.0%0 / 6
+ include/iso15118/detail/variant_access.hpp + + 100.0 + 100.0%7 / 788.2%30 / 3450.0%2 / 4
+ include/iso15118/io/connection_abstract.hpp + + 0.0 + 0.0%0 / 10.0%0 / 1-%0 / 0
+ include/iso15118/io/sdp_packet.hpp + + 0.0 + 0.0%0 / 100.0%0 / 50.0%0 / 2
+ include/iso15118/io/sdp_server.hpp + + 0.0 + 0.0%0 / 70.0%0 / 4-%0 / 0
+ include/iso15118/io/time.hpp + + 0.0 + 0.0%0 / 100.0%0 / 30.0%0 / 8
+ include/iso15118/message/variant.hpp + + 75.0 + 75.0%3 / 425.0%1 / 450.0%1 / 2
+ include/iso15118/session/iso.hpp + + 0.0 + 0.0%0 / 20.0%0 / 1-%0 / 0
+ src/iso15118/d20/config.cpp + + 81.6 + 81.6%31 / 38100.0%5 / 544.4%16 / 36
+ src/iso15118/d20/context.cpp + + 51.4 + 51.4%19 / 3755.6%5 / 925.0%4 / 16
+ src/iso15118/d20/context_helper.cpp + + 16.7 + 16.7%10 / 6016.7%3 / 181.1%1 / 90
+ src/iso15118/d20/control_event_queue.cpp + + 0.0 + 0.0%0 / 120.0%0 / 20.0%0 / 8
+ src/iso15118/d20/fsm.cpp + + 0.0 + 0.0%0 / 20.0%0 / 1-%0 / 0
+ src/iso15118/d20/session.cpp + + 86.7 + 86.7%72 / 8383.3%5 / 650.9%54 / 106
+ src/iso15118/d20/state/authorization.cpp + + 42.0 + 42.0%29 / 6950.0%2 / 419.0%11 / 58
+ src/iso15118/d20/state/authorization_setup.cpp + + 38.8 + 38.8%19 / 4933.3%1 / 330.8%24 / 78
+ src/iso15118/d20/state/dc_cable_check.cpp + + 18.2 + 18.2%8 / 4433.3%1 / 310.0%5 / 50
+ src/iso15118/d20/state/dc_charge_loop.cpp + + 57.9 + 57.9%81 / 14077.8%7 / 928.6%44 / 154
+ src/iso15118/d20/state/dc_charge_parameter_discovery.cpp + + 52.4 + 52.4%43 / 8260.0%3 / 519.8%17 / 86
+ src/iso15118/d20/state/dc_pre_charge.cpp + + 15.8 + 15.8%6 / 3833.3%1 / 38.3%4 / 48
+ src/iso15118/d20/state/dc_welding_detection.cpp + + 17.6 + 17.6%6 / 3433.3%1 / 310.0%4 / 40
+ src/iso15118/d20/state/power_delivery.cpp + + 14.0 + 14.0%6 / 4333.3%1 / 37.4%4 / 54
+ src/iso15118/d20/state/schedule_exchange.cpp + + 42.1 + 42.1%32 / 7640.0%2 / 528.1%27 / 96
+ src/iso15118/d20/state/service_detail.cpp + + 60.0 + 60.0%48 / 8033.3%1 / 342.6%43 / 101
+ src/iso15118/d20/state/service_discovery.cpp + + 52.3 + 52.3%34 / 6550.0%2 / 438.0%38 / 100
+ src/iso15118/d20/state/service_selection.cpp + + 50.7 + 50.7%34 / 6733.3%1 / 339.0%32 / 82
+ src/iso15118/d20/state/session_setup.cpp + + 0.0 + 0.0%0 / 370.0%0 / 50.0%0 / 56
+ src/iso15118/d20/state/session_stop.cpp + + 33.3 + 33.3%10 / 3033.3%1 / 319.0%8 / 42
+ src/iso15118/d20/state/supported_app_protocol.cpp + + 60.7 + 60.7%17 / 2866.7%2 / 332.4%11 / 34
+ src/iso15118/io/connection_openssl.cpp + + 0.0 + 0.0%0 / 1690.0%0 / 150.0%0 / 208
+ src/iso15118/io/connection_plain.cpp + + 0.0 + 0.0%0 / 870.0%0 / 110.0%0 / 80
+ src/iso15118/io/logging.cpp + + 100.0 + 100.0%52 / 52100.0%12 / 1250.0%13 / 26
+ src/iso15118/io/poll_manager.cpp + + 0.0 + 0.0%0 / 420.0%0 / 60.0%0 / 26
+ src/iso15118/io/sdp_packet.cpp + + 0.0 + 0.0%0 / 290.0%0 / 40.0%0 / 23
+ src/iso15118/io/sdp_server.cpp + + 0.0 + 0.0%0 / 1230.0%0 / 80.0%0 / 126
+ src/iso15118/io/socket_helper.cpp + + 0.0 + 0.0%0 / 560.0%0 / 40.0%0 / 58
+ src/iso15118/message/ac_charge_loop.cpp + + 0.0 + 0.0%0 / 1920.0%0 / 320.0%0 / 172
+ src/iso15118/message/ac_charge_parameter_discovery.cpp + + 0.0 + 0.0%0 / 790.0%0 / 120.0%0 / 62
+ src/iso15118/message/authorization.cpp + + 84.6 + 84.6%22 / 26100.0%5 / 525.0%4 / 16
+ src/iso15118/message/authorization_setup.cpp + + 100.0 + 100.0%34 / 34100.0%8 / 850.0%7 / 14
+ src/iso15118/message/common_types.cpp + + 47.9 + 47.9%46 / 9655.6%15 / 2713.5%7 / 52
+ src/iso15118/message/dc_cable_check.cpp + + 100.0 + 100.0%19 / 19100.0%5 / 550.0%3 / 6
+ src/iso15118/message/dc_charge_loop.cpp + + 50.3 + 50.3%89 / 17740.6%13 / 3232.7%36 / 110
+ src/iso15118/message/dc_charge_parameter_discovery.cpp + + 61.8 + 61.8%47 / 7675.0%9 / 1238.9%7 / 18
+ src/iso15118/message/dc_pre_charge.cpp + + 100.0 + 100.0%22 / 22100.0%5 / 550.0%3 / 6
+ src/iso15118/message/dc_welding_detection.cpp + + 100.0 + 100.0%20 / 20100.0%5 / 550.0%3 / 6
+ src/iso15118/message/power_delivery.cpp + + 90.4 + 90.4%47 / 5288.9%8 / 950.0%13 / 26
+ src/iso15118/message/schedule_exchange.cpp + + 65.6 + 65.6%162 / 24782.8%24 / 2925.0%47 / 188
+ src/iso15118/message/service_detail.cpp + + 82.0 + 82.0%100 / 12270.6%12 / 1746.3%50 / 108
+ src/iso15118/message/service_discovery.cpp + + 73.0 + 73.0%27 / 37100.0%5 / 543.8%7 / 16
+ src/iso15118/message/service_selection.cpp + + 75.0 + 75.0%21 / 28100.0%5 / 540.0%4 / 10
+ src/iso15118/message/session_setup.cpp + + 100.0 + 100.0%20 / 20100.0%5 / 541.7%5 / 12
+ src/iso15118/message/session_stop.cpp + + 91.3 + 91.3%21 / 23100.0%5 / 535.7%5 / 14
+ src/iso15118/message/supported_app_protocol.cpp + + 91.8 + 91.8%45 / 4987.5%7 / 854.2%13 / 24
+ src/iso15118/message/variant.cpp + + 69.9 + 69.9%58 / 8375.0%6 / 846.9%61 / 130
+ src/iso15118/misc/cb_exi.cpp + + 100.0 + 100.0%6 / 6100.0%2 / 2-%0 / 0
+ src/iso15118/misc/helper.cpp + + 0.0 + 0.0%0 / 40.0%0 / 20.0%0 / 16
+ src/iso15118/misc/helper_openssl.cpp + + 0.0 + 0.0%0 / 120.0%0 / 30.0%0 / 16
+ src/iso15118/session/feedback.cpp + + 100.0 + 100.0%23 / 23100.0%8 / 850.0%4 / 8
+ src/iso15118/session/iso.cpp + + 0.0 + 0.0%0 / 1130.0%0 / 120.0%0 / 138
+ src/iso15118/session/logger.cpp + + 3.6 + 3.6%1 / 2814.3%1 / 70.0%0 / 12
+ src/iso15118/tbd_controller.cpp + + 0.0 + 0.0%0 / 690.0%0 / 80.0%0 / 84
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.cpp.545732d18aceadd3ee4cd2e5d9b55998.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.cpp.545732d18aceadd3ee4cd2e5d9b55998.html new file mode 100644 index 000000000..ef7004b7b --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.cpp.545732d18aceadd3ee4cd2e5d9b55998.html @@ -0,0 +1,1779 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/session/iso.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:01130.0%
Functions:0120.0%
Branches:01380.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/session/iso.hpp>
4 +
5 + #include <cassert>
6 + #include <chrono>
7 + #include <cstring>
8 + #include <thread>
9 +
10 + #include <endian.h>
11 +
12 + #include <iso15118/d20/state/supported_app_protocol.hpp>
13 +
14 + #include <iso15118/detail/helper.hpp>
15 +
16 + namespace iso15118 {
17 +
18 + static constexpr auto SESSION_IDLE_TIMEOUT_MS = 5000;
19 +
20 + static void log_sdp_packet(const iso15118::io::SdpPacket& sdp) {
21 + static constexpr auto ESCAPED_BYTE_CHAR_COUNT = 4;
22 + auto payload_string_buffer = std::make_unique<char[]>(sdp.get_payload_length() * ESCAPED_BYTE_CHAR_COUNT + 1);
23 + for (std::size_t i = 0; i < sdp.get_payload_length(); ++i) {
24 + snprintf(payload_string_buffer.get() + i * ESCAPED_BYTE_CHAR_COUNT, ESCAPED_BYTE_CHAR_COUNT + 1, "\\x%02hx",
25 + sdp.get_payload_buffer()[i]);
26 + }
27 +
28 + iso15118::logf_info("[SDP Packet in]: Header: %04hx, Payload: %s", sdp.get_payload_type(),
29 + payload_string_buffer.get());
30 + }
31 +
32 + static void log_packet_from_car(const iso15118::io::SdpPacket& packet, session::SessionLogger& logger) {
33 + logger.exi(static_cast<uint16_t>(packet.get_payload_type()), packet.get_payload_buffer(),
34 + packet.get_payload_length(), session::logging::ExiMessageDirection::FROM_EV);
35 + }
36 +
37 + static std::unique_ptr<message_20::Variant> make_variant_from_packet(const iso15118::io::SdpPacket& packet) {
38 + return std::make_unique<message_20::Variant>(
39 + packet.get_payload_type(), io::StreamInputView{packet.get_payload_buffer(), packet.get_payload_length()});
40 + }
41 +
42 + void raise_invalid_packet_state(const io::SdpPacket& sdp_packet) {
43 + using PacketState = io::SdpPacket::State;
44 +
45 + auto error = std::string("Error while reading sdp packet: ");
46 + switch (sdp_packet.get_state()) {
47 + case PacketState::INVALID_HEADER:
48 + error += "invalid sdp packet header";
49 + break;
50 + case PacketState::PAYLOAD_TO_LONG:
51 + error += "packet too large for buffer";
52 + break;
53 + default:
54 + assert(false);
55 + }
56 +
57 + log_and_throw(error.c_str());
58 + }
59 +
60 + // NOTE (aw): this function return true, if it would block to read a complete packet
61 + // if it returns false, the packet is complete
62 + bool read_single_sdp_packet(io::IConnection& connection, io::SdpPacket& sdp_packet) {
63 + // NOTE (aw): not happy with this function
64 + // main problem is, that it combines too much logic of the sdp packet and io related stuff
65 + using PacketState = io::SdpPacket::State;
66 +
67 + assert(sdp_packet.get_state() == PacketState::EMPTY || sdp_packet.get_state() == PacketState::HEADER_READ);
68 +
69 + const auto first_try =
70 + connection.read(sdp_packet.get_current_buffer_pos(), sdp_packet.get_remaining_bytes_to_read());
71 +
72 + sdp_packet.update_read_bytes(first_try.bytes_read);
73 +
74 + if (first_try.would_block) {
75 + // need more data for at least the header
76 + return true;
77 + }
78 +
79 + if (sdp_packet.get_state() == PacketState::COMPLETE) {
80 + // done
81 + return false;
82 + }
83 +
84 + // packet not finished
85 + if (sdp_packet.get_state() != PacketState::HEADER_READ) {
86 + raise_invalid_packet_state(sdp_packet);
87 + }
88 +
89 + // header read successfully, try to read the rest
90 + const auto second_try =
91 + connection.read(sdp_packet.get_current_buffer_pos(), sdp_packet.get_remaining_bytes_to_read());
92 +
93 + sdp_packet.update_read_bytes(second_try.bytes_read);
94 +
95 + if (second_try.would_block) {
96 + // need more data for the rest of the packet!
97 + return true;
98 + }
99 +
100 + // assert finished packet
101 + if (sdp_packet.get_state() != PacketState::COMPLETE) {
102 + raise_invalid_packet_state(sdp_packet);
103 + }
104 +
105 + return false;
106 + }
107 +
108 + static size_t setup_response_header(uint8_t* buffer, iso15118::io::v2gtp::PayloadType payload_type, size_t size) {
109 + buffer[0] = iso15118::io::SDP_PROTOCOL_VERSION;
110 + buffer[1] = iso15118::io::SDP_INVERSE_PROTOCOL_VERSION;
111 +
112 + const uint16_t response_payload_type =
113 + htobe16(static_cast<std::underlying_type_t<iso15118::io::v2gtp::PayloadType>>(payload_type));
114 +
115 + std::memcpy(buffer + 2, &response_payload_type, sizeof(response_payload_type));
116 +
117 + const uint32_t tmp32 = htobe32(size);
118 +
119 + std::memcpy(buffer + 4, &tmp32, sizeof(tmp32));
120 +
121 + return size + iso15118::io::SdpPacket::V2GTP_HEADER_SIZE;
122 + }
123 +
124 + Session::Session(std::unique_ptr<io::IConnection> connection_, d20::SessionConfig session_config,
125 + const session::feedback::Callbacks& callbacks) :
126 + connection(std::move(connection_)),
127 + log(this),
128 + ctx(callbacks, log, std::move(session_config), active_control_event, message_exchange) {
129 +
130 + next_session_event = offset_time_point_by_ms(get_current_time_point(), SESSION_IDLE_TIMEOUT_MS);
131 + connection->set_event_callback([this](io::ConnectionEvent event) { this->handle_connection_event(event); });
132 + fsm.reset<d20::state::SupportedAppProtocol>(ctx);
133 + }
134 +
135 + Session::~Session() = default;
136 +
137 + void Session::push_control_event(const d20::ControlEvent& event) {
138 + control_event_queue.push(event);
139 + }
140 +
141 + TimePoint const& Session::poll() {
142 + const auto now = get_current_time_point();
143 +
144 + if (not state.connected) {
145 + // nothing happened so far, just return
146 + next_session_event = offset_time_point_by_ms(now, SESSION_IDLE_TIMEOUT_MS);
147 + return next_session_event;
148 + }
149 +
150 + // check for new data to read
151 + if (state.new_data) {
152 + const bool would_block = read_single_sdp_packet(*connection, packet);
153 +
154 + if (would_block) {
155 + state.new_data = false;
156 + }
157 + }
158 +
159 + // send all of our queued control events
160 + while ((active_control_event = control_event_queue.pop()) != std::nullopt) {
161 +
162 + // TODO(sl): Save UpdateDynamicParameters as well for ScheduleExchange
163 + if (const auto control_data = ctx.get_control_event<d20::DcTransferLimits>()) {
164 + ctx.session_config.dc_limits = *control_data;
165 + }
166 +
167 + [[maybe_unused]] const auto res = fsm.handle_event(d20::FsmEvent::CONTROL_MESSAGE);
168 + // FIXME (aw): check result!
169 + }
170 +
171 + // check for complete sdp packet
172 + if (packet.is_complete()) {
173 + // FIXME (aw): this event loop only acts on new packets, seems to be enough for now ...
174 + log_packet_from_car(packet, log);
175 +
176 + message_exchange.set_request(make_variant_from_packet(packet));
177 +
178 + packet = {}; // reset the packet
179 +
180 + const auto request_msg_type = ctx.peek_request_type();
181 + ctx.feedback.v2g_message(request_msg_type);
182 +
183 + [[maybe_unused]] const auto res = fsm.handle_event(d20::FsmEvent::V2GTP_MESSAGE);
184 + // FIXME(sl): check result!
185 + }
186 +
187 + const auto [got_response, payload_size, payload_type, response_type] = message_exchange.check_and_clear_response();
188 +
189 + if (got_response) {
190 + const auto response_size = setup_response_header(response_buffer, payload_type, payload_size);
191 + connection->write(response_buffer, response_size);
192 +
193 + // FIXME (aw): this is hacky ...
194 + log.exi(static_cast<uint16_t>(payload_type), response_buffer + io::SdpPacket::V2GTP_HEADER_SIZE, payload_size,
195 + session::logging::ExiMessageDirection::TO_EV);
196 +
197 + ctx.feedback.v2g_message(response_type);
198 +
199 + if (ctx.session_stopped) {
200 + // Wait for 5 seconds [V2G20-1643]
201 + std::this_thread::sleep_for(std::chrono::seconds(5));
202 + connection->close();
203 + ctx.feedback.signal(session::feedback::Signal::DLINK_TERMINATE);
204 + }
205 + }
206 +
207 + // FIXME (aw): proper timeout handling!
208 + next_session_event = offset_time_point_by_ms(now, SESSION_IDLE_TIMEOUT_MS);
209 + return next_session_event;
210 + }
211 +
212 + void Session::handle_connection_event(io::ConnectionEvent event) {
213 + using Event = io::ConnectionEvent;
214 + switch (event) {
215 + case Event::ACCEPTED:
216 + assert(state.connected == false);
217 + state.connected = true;
218 + log("Accepted connection on port %d", connection->get_public_endpoint().port);
219 + return;
220 +
221 + case Event::NEW_DATA:
222 + assert(state.connected);
223 + state.new_data = true;
224 + return;
225 +
226 + case Event::OPEN:
227 + assert(state.connected);
228 + // NOTE (aw): for now, we don't really need this information ...
229 + return;
230 +
231 + case Event::CLOSED:
232 + state.connected = false;
233 + logf_info("Connection is closed");
234 + return;
235 + }
236 + }
237 +
238 + } // namespace iso15118
239 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.hpp.72a55b758a74723885ffb706ed2dd19e.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.hpp.72a55b758a74723885ffb706ed2dd19e.html new file mode 100644 index 000000000..9334c3340 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.iso.hpp.72a55b758a74723885ffb706ed2dd19e.html @@ -0,0 +1,592 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/session/iso.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:020.0%
Functions:010.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <memory>
6 + #include <optional>
7 +
8 + #include <iso15118/config.hpp>
9 +
10 + #include <iso15118/d20/config.hpp>
11 + #include <iso15118/d20/context.hpp>
12 + #include <iso15118/d20/control_event_queue.hpp>
13 + #include <iso15118/d20/fsm.hpp>
14 +
15 + #include <iso15118/io/connection_abstract.hpp>
16 + #include <iso15118/io/poll_manager.hpp>
17 + #include <iso15118/io/sdp_packet.hpp>
18 + #include <iso15118/io/time.hpp>
19 +
20 + #include <iso15118/session/feedback.hpp>
21 + #include <iso15118/session/logger.hpp>
22 +
23 + namespace iso15118 {
24 +
25 + struct SessionState {
26 + bool connected{false};
27 + bool new_data{false};
28 + bool fsm_needs_call{false};
29 + };
30 +
31 + class Session {
32 + public:
33 + Session(std::unique_ptr<io::IConnection>, d20::SessionConfig, const session::feedback::Callbacks&);
34 + ~Session();
35 +
36 + TimePoint const& poll();
37 + void push_control_event(const d20::ControlEvent&);
38 +
39 + bool is_finished() const {
40 + return ctx.session_stopped;
41 + }
42 +
43 + private:
44 + std::unique_ptr<io::IConnection> connection;
45 + session::SessionLogger log;
46 +
47 + SessionState state;
48 + // input buffer
49 + io::SdpPacket packet;
50 +
51 + // output buffer
52 + uint8_t response_buffer[1028];
53 +
54 + d20::MessageExchange message_exchange{{response_buffer + io::SdpPacket::V2GTP_HEADER_SIZE,
55 + sizeof(response_buffer) - io::SdpPacket::V2GTP_HEADER_SIZE}};
56 +
57 + // control event buffer
58 + d20::ControlEventQueue control_event_queue;
59 + std::optional<d20::ControlEvent> active_control_event{std::nullopt};
60 +
61 + d20::Context ctx;
62 +
63 + d20::Fsm fsm;
64 +
65 + TimePoint next_session_event;
66 +
67 + void handle_connection_event(io::ConnectionEvent event);
68 + };
69 +
70 + } // namespace iso15118
71 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logger.cpp.e18c737deda2f2ae5bf9a8c919c4548e.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logger.cpp.e18c737deda2f2ae5bf9a8c919c4548e.html new file mode 100644 index 000000000..d7fab8f59 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logger.cpp.e18c737deda2f2ae5bf9a8c919c4548e.html @@ -0,0 +1,535 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/session/logger.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:1283.6%
Functions:1714.3%
Branches:0120.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/session/logger.hpp>
4 +
5 + #include <iso15118/detail/helper.hpp>
6 +
7 + static iso15118::session::logging::Callback session_log_callback{nullptr};
8 +
9 + namespace iso15118::session {
10 +
11 + 2SessionLogger::SessionLogger(void* id_) : id(reinterpret_cast<std::uintptr_t>(id_)){};
12 +
13 + void SessionLogger::event(const std::string& info) const {
14 + logging::SimpleEvent event{std::chrono::system_clock::now(), info};
15 + session_log_callback(this->id, std::move(event));
16 + }
17 +
18 + void SessionLogger::exi(uint16_t payload_type, uint8_t const* data, size_t len,
19 + logging::ExiMessageDirection direction) const {
20 + logging::ExiMessageEvent event{
21 + std::chrono::system_clock::now(), payload_type, data, len, direction,
22 + };
23 +
24 + session_log_callback(this->id, std::move(event));
25 + }
26 +
27 + void SessionLogger::enter_state(const std::string& new_state) {
28 + if (last_state_name.size()) {
29 + this->operator()("Transition (%s -> %s)", last_state_name.c_str(), new_state.c_str());
30 + } else {
31 + this->operator()("Transition (entered %s)", new_state.c_str());
32 + }
33 +
34 + last_state_name = std::move(new_state);
35 + }
36 +
37 + void SessionLogger::operator()(const std::string& info) const {
38 + event(info);
39 + }
40 +
41 + void SessionLogger::operator()(const char* format, ...) const {
42 + static constexpr auto MAX_FMT_LOG_BUFSIZE = 1024;
43 + char msg_buf[MAX_FMT_LOG_BUFSIZE];
44 +
45 + va_list args;
46 + va_start(args, format);
47 +
48 + vsnprintf(msg_buf, MAX_FMT_LOG_BUFSIZE, format, args);
49 +
50 + va_end(args);
51 +
52 + event(msg_buf);
53 + }
54 +
55 + namespace logging {
56 + void set_session_log_callback(const logging::Callback& callback) {
57 + session_log_callback = callback;
58 + }
59 + } // namespace logging
60 +
61 + } // namespace iso15118::session
62 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logging.cpp.7dfc9361f01f79722522cabaaf3943af.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logging.cpp.7dfc9361f01f79722522cabaaf3943af.html new file mode 100644 index 000000000..10de18864 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.logging.cpp.7dfc9361f01f79722522cabaaf3943af.html @@ -0,0 +1,847 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/logging.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:5252100.0%
Functions:1212100.0%
Branches:132650.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/logging.hpp>
4 +
5 + #include <cstdarg>
6 + #include <cstdio>
7 + #include <iostream>
8 +
9 + 14static std::function<void(iso15118::LogLevel, std::string)> logging_callback = [](const iso15118::LogLevel& level,
10 + const std::string& msg) {
11 + 14 std::cout << msg << ", level: " << static_cast<int>(level);
12 + 14};
13 +
14 + namespace iso15118 {
15 +
16 + 40void log(const LogLevel& level, const std::string& msg) {
17 +
+ 2/4 +
+
✓ Branch 1 taken 40 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 40 times.
+
✗ Branch 5 not taken.
+
+
+
40 logging_callback(level, msg);
18 + 40}
19 +
20 + 4void vlogf(const char* fmt, va_list ap) {
21 + static constexpr auto MAX_FMT_LOG_BUFSIZE = 1024;
22 + char msg_buf[MAX_FMT_LOG_BUFSIZE];
23 +
24 + 4 vsnprintf(msg_buf, MAX_FMT_LOG_BUFSIZE, fmt, ap);
25 +
26 +
+ 2/4 +
+
✓ Branch 2 taken 4 times.
+
✗ Branch 3 not taken.
+
✓ Branch 5 taken 4 times.
+
✗ Branch 6 not taken.
+
+
+
4 log(LogLevel::Info, msg_buf);
27 + 4}
28 +
29 + 36void vlogf(const LogLevel& level, const char* fmt, va_list ap) {
30 + static constexpr auto MAX_FMT_LOG_BUFSIZE = 1024;
31 + char msg_buf[MAX_FMT_LOG_BUFSIZE];
32 +
33 + 36 vsnprintf(msg_buf, MAX_FMT_LOG_BUFSIZE, fmt, ap);
34 +
35 +
+ 2/4 +
+
✓ Branch 2 taken 36 times.
+
✗ Branch 3 not taken.
+
✓ Branch 5 taken 36 times.
+
✗ Branch 6 not taken.
+
+
+
36 log(level, msg_buf);
36 + 36}
37 +
38 + 4void logf(const char* fmt, ...) {
39 + va_list args;
40 + 4 va_start(args, fmt);
41 +
42 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 vlogf(fmt, args);
43 +
44 + 4 va_end(args);
45 + 4}
46 +
47 + 2void logf(const LogLevel& level, const char* fmt, ...) {
48 +
49 + va_list args;
50 + 2 va_start(args, fmt);
51 +
52 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 vlogf(level, fmt, args);
53 +
54 + 2 va_end(args);
55 + 2}
56 +
57 + 8void logf_error(const char* fmt, ...) {
58 + va_list args;
59 + 8 va_start(args, fmt);
60 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 vlogf(LogLevel::Error, fmt, args);
61 + 8 va_end(args);
62 + 8}
63 + 4void logf_warning(const char* fmt, ...) {
64 + va_list args;
65 + 4 va_start(args, fmt);
66 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 vlogf(LogLevel::Warning, fmt, args);
67 + 4 va_end(args);
68 + 4}
69 + 14void logf_info(const char* fmt, ...) {
70 + va_list args;
71 + 14 va_start(args, fmt);
72 +
+ 1/2 +
+
✓ Branch 1 taken 14 times.
+
✗ Branch 2 not taken.
+
+
+
14 vlogf(LogLevel::Info, fmt, args);
73 + 14 va_end(args);
74 + 14}
75 + 4void logf_debug(const char* fmt, ...) {
76 + va_list args;
77 + 4 va_start(args, fmt);
78 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 vlogf(LogLevel::Debug, fmt, args);
79 + 4 va_end(args);
80 + 4}
81 + 4void logf_trace(const char* fmt, ...) {
82 + va_list args;
83 + 4 va_start(args, fmt);
84 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 vlogf(LogLevel::Trace, fmt, args);
85 + 4 va_end(args);
86 + 4}
87 +
88 + namespace io {
89 + 26void set_logging_callback(const std::function<void(LogLevel, std::string)>& callback) {
90 + 26 logging_callback = callback;
91 + 26}
92 + } // namespace io
93 +
94 + } // namespace iso15118
95 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.poll_manager.cpp.8895b00de5fe708b61fc6595820a77f2.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.poll_manager.cpp.8895b00de5fe708b61fc6595820a77f2.html new file mode 100644 index 000000000..a448d0c87 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.poll_manager.cpp.8895b00de5fe708b61fc6595820a77f2.html @@ -0,0 +1,716 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/poll_manager.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0420.0%
Functions:060.0%
Branches:0260.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/poll_manager.hpp>
4 +
5 + #include <type_traits>
6 + #include <vector>
7 +
8 + #include <poll.h>
9 + #include <sys/eventfd.h>
10 + #include <unistd.h>
11 +
12 + #include <iso15118/detail/helper.hpp>
13 +
14 + namespace iso15118::io {
15 +
16 + static PollSet create_poll_set(const std::map<int, PollCallback>& map, int event_fd) {
17 + const auto total_size = map.size() + 1; // including event_fd
18 + decltype(PollSet::fds) fds(total_size);
19 + decltype(PollSet::callbacks) callbacks(total_size);
20 +
21 + auto index = 0;
22 + for (auto it = map.begin(); it != map.end(); ++it, ++index) {
23 + fds[index].fd = it->first;
24 + fds[index].events = POLLIN;
25 + callbacks[index] = &it->second;
26 + }
27 +
28 + fds[index].fd = event_fd;
29 + fds[index].events = POLLIN;
30 +
31 + return {std::move(fds), std::move(callbacks)};
32 + }
33 +
34 + PollManager::PollManager() {
35 + event_fd = eventfd(0, 0);
36 + if (event_fd == -1) {
37 + log_and_throw("Failed to create eventfd");
38 + }
39 + }
40 +
41 + void PollManager::register_fd(int fd, PollCallback& poll_callback) {
42 + registered_fds.emplace(fd, poll_callback);
43 + poll_set = create_poll_set(registered_fds, event_fd);
44 + }
45 +
46 + void PollManager::unregister_fd(int fd) {
47 + registered_fds.erase(fd);
48 + poll_set = create_poll_set(registered_fds, event_fd);
49 + }
50 +
51 + void PollManager::poll(int timeout_ms) {
52 +
53 + auto& pollfds = poll_set.fds;
54 +
55 + const auto ret = ::poll(pollfds.data(), pollfds.size(), timeout_ms);
56 +
57 + if (ret == -1) {
58 + log_and_throw("Poll failed\n");
59 + }
60 +
61 + if (ret == 0) {
62 + // timeout
63 + return;
64 + }
65 +
66 + // first check for event_fd
67 + if (pollfds[pollfds.size() - 1].revents & POLLIN) {
68 + eventfd_t tmp;
69 + eventfd_read(event_fd, &tmp);
70 +
71 + // just break;
72 + return;
73 + }
74 +
75 + // check fds
76 + for (std::size_t i = 0; i < pollfds.size() - 1; ++i) {
77 + if (pollfds[i].revents & POLLIN) {
78 + (*poll_set.callbacks[i])();
79 + }
80 + }
81 + }
82 +
83 + void PollManager::abort() {
84 + eventfd_write(event_fd, 1);
85 + }
86 +
87 + } // namespace iso15118::io
88 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.9623e1bbf468167f371343559e90db4d.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.9623e1bbf468167f371343559e90db4d.html new file mode 100644 index 000000000..8e229f8be --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.9623e1bbf468167f371343559e90db4d.html @@ -0,0 +1,838 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/power_delivery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:475290.4%
Functions:8988.9%
Branches:132650.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/power_delivery.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + template <>
14 + 2void convert(const struct iso20_Scheduled_EVPPTControlModeType& in, datatypes::Scheduled_EVPPTControlMode& out) {
15 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 if (in.PowerToleranceAcceptance_isUsed) {
16 + 2 out.power_tolerance_acceptance = static_cast<datatypes::PowerToleranceAcceptance>(in.PowerToleranceAcceptance);
17 + }
18 + 2 out.selected_schedule = in.SelectedScheduleTupleID;
19 + 2}
20 +
21 + 2template <> void convert(const struct iso20_PowerScheduleEntryType& in, datatypes::PowerScheduleEntry& out) {
22 + 2 out.duration = in.Duration;
23 + 2 convert(in.Power, out.power);
24 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.Power_L2, out.power_l2);
25 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.Power_L3, out.power_l3);
26 + 2}
27 +
28 + 2template <> void convert(const struct iso20_EVPowerProfileType& in, datatypes::PowerProfile& out) {
29 + 2 out.time_anchor = in.TimeAnchor;
30 +
31 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.Dynamic_EVPPTControlMode_isUsed) {
32 + out.control_mode.emplace<datatypes::Dynamic_EVPPTControlMode>();
33 + // NOTE (aw): nothing more to do here because Dynamic_EVPPTControlMode is empty
34 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (in.Scheduled_EVPPTControlMode_isUsed) {
35 + 2 auto& cm = out.control_mode.emplace<datatypes::Scheduled_EVPPTControlMode>();
36 + 2 convert(in.Scheduled_EVPPTControlMode, cm);
37 + } else {
38 + throw std::runtime_error("PowerProfile control mode not defined");
39 + }
40 +
41 + 2 auto& entries_in = in.EVPowerProfileEntries.EVPowerProfileEntry;
42 + 2 out.entries.reserve(entries_in.arrayLen);
43 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 for (auto i = 0; i < entries_in.arrayLen; ++i) {
44 + 2 auto& entry_out = out.entries.emplace_back();
45 + 2 const auto& entry_in = entries_in.array[i];
46 + 2 convert(entry_in, entry_out);
47 + }
48 + 2}
49 +
50 + void convert(const iso20_channelSelectionType in, datatypes::ChannelSelection& out) {
51 + cb_convert_enum(in, out);
52 + }
53 +
54 + 2template <> void convert(const struct iso20_PowerDeliveryReqType& in, PowerDeliveryRequest& out) {
55 + 2 convert(in.Header, out.header);
56 +
57 + 2 cb_convert_enum(in.EVProcessing, out.processing);
58 + 2 cb_convert_enum(in.ChargeProgress, out.charge_progress);
59 +
60 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVPowerProfile, out.power_profile);
61 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.BPT_ChannelSelection, out.channel_selection);
62 + 2}
63 +
64 + 2template <> void convert(const PowerDeliveryResponse& in, iso20_PowerDeliveryResType& out) {
65 + 2 init_iso20_PowerDeliveryResType(&out);
66 +
67 + 2 convert(in.header, out.Header);
68 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
69 +
70 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_CONVERT_IF_USED(in.status, out.EVSEStatus);
71 + 2}
72 +
73 + 2template <> void insert_type(VariantAccess& va, const struct iso20_PowerDeliveryReqType& in) {
74 + 2 va.insert_type<PowerDeliveryRequest>(in);
75 + 2};
76 +
77 + 2template <> int serialize_to_exi(const PowerDeliveryResponse& in, exi_bitstream_t& out) {
78 + iso20_exiDocument doc;
79 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
80 +
81 + 2 CB_SET_USED(doc.PowerDeliveryRes);
82 +
83 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.PowerDeliveryRes);
84 +
85 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
86 + }
87 +
88 + 2template <> size_t serialize(const PowerDeliveryResponse& in, const io::StreamOutputView& out) {
89 + 2 return serialize_helper(in, out);
90 + }
91 +
92 + } // namespace iso15118::message_20
93 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.a8f39bba8e297c8edb55d1042988bb8f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.a8f39bba8e297c8edb55d1042988bb8f.html new file mode 100644 index 000000000..148dd3de1 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.power_delivery.cpp.a8f39bba8e297c8edb55d1042988bb8f.html @@ -0,0 +1,813 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/power_delivery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:64314.0%
Functions:1333.3%
Branches:4547.4%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_charge_loop.hpp>
4 + #include <iso15118/d20/state/power_delivery.hpp>
5 + #include <iso15118/d20/state/session_stop.hpp>
6 +
7 + #include <iso15118/detail/d20/context_helper.hpp>
8 + #include <iso15118/detail/d20/state/dc_pre_charge.hpp>
9 + #include <iso15118/detail/d20/state/power_delivery.hpp>
10 + #include <iso15118/detail/helper.hpp>
11 +
12 + namespace iso15118::d20::state {
13 +
14 + namespace dt = message_20::datatypes;
15 +
16 + 4message_20::PowerDeliveryResponse handle_request(const message_20::PowerDeliveryRequest& req,
17 + const d20::Session& session) {
18 +
19 + 4 message_20::PowerDeliveryResponse res;
20 +
21 +
+ 3/4 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 2 times.
+
+
+
4 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
22 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
23 + }
24 +
25 + // TODO(sl): Check Req PowerProfile & ChannelSelection
26 +
27 + // Todo(sl): Add standby feature and define as everest module config
28 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 if (req.charge_progress == dt::Progress::Standby) {
29 + 2 return response_with_code(res, dt::ResponseCode::WARNING_StandbyNotAllowed);
30 + }
31 +
32 + return response_with_code(res, dt::ResponseCode::OK);
33 + }
34 +
35 + void PowerDelivery::enter() {
36 + ctx.log.enter_state("PowerDelivery");
37 + }
38 +
39 + FsmSimpleState::HandleEventReturnType PowerDelivery::handle_event(AllocatorType& sa, FsmEvent ev) {
40 +
41 + if (ev == FsmEvent::CONTROL_MESSAGE) {
42 + const auto control_data = ctx.get_control_event<PresentVoltageCurrent>();
43 + if (not control_data) {
44 + // Ignore control message
45 + return sa.HANDLED_INTERNALLY;
46 + }
47 +
48 + present_voltage = control_data->voltage;
49 +
50 + return sa.HANDLED_INTERNALLY;
51 + }
52 +
53 + if (ev != FsmEvent::V2GTP_MESSAGE) {
54 + return sa.PASS_ON;
55 + }
56 +
57 + const auto variant = ctx.pull_request();
58 +
59 + if (const auto req = variant->get_if<message_20::DC_PreChargeRequest>()) {
60 + const auto res = handle_request(*req, ctx.session, present_voltage);
61 +
62 + ctx.feedback.dc_pre_charge_target_voltage(dt::from_RationalNumber(req->target_voltage));
63 +
64 + ctx.respond(res);
65 +
66 + if (res.response_code >= dt::ResponseCode::FAILED) {
67 + ctx.session_stopped = true;
68 + return sa.PASS_ON;
69 + }
70 +
71 + return sa.HANDLED_INTERNALLY;
72 + } else if (const auto req = variant->get_if<message_20::PowerDeliveryRequest>()) {
73 + if (req->charge_progress == dt::Progress::Start) {
74 + ctx.feedback.signal(session::feedback::Signal::SETUP_FINISHED);
75 + }
76 +
77 + const auto& res = handle_request(*req, ctx.session);
78 +
79 + ctx.respond(res);
80 +
81 + if (res.response_code >= dt::ResponseCode::FAILED) {
82 + ctx.session_stopped = true;
83 + return sa.PASS_ON;
84 + }
85 +
86 + return sa.create_simple<DC_ChargeLoop>(ctx);
87 + } else {
88 + ctx.log("Expected DC_PreChargeReq or PowerDeliveryReq! But code type id: %d", variant->get_type());
89 +
90 + // Sequence Error
91 + const message_20::Type req_type = variant->get_type();
92 + send_sequence_error(req_type, ctx);
93 +
94 + ctx.session_stopped = true;
95 + return sa.PASS_ON;
96 + }
97 + }
98 +
99 + } // namespace iso15118::d20::state
100 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.0094768003b242296011c986d1ab79e0.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.0094768003b242296011c986d1ab79e0.html new file mode 100644 index 000000000..222abd525 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.0094768003b242296011c986d1ab79e0.html @@ -0,0 +1,1414 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/schedule_exchange.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:327642.1%
Functions:2540.0%
Branches:279628.1%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <ctime>
4 +
5 + #include <iso15118/d20/state/dc_cable_check.hpp>
6 + #include <iso15118/d20/state/schedule_exchange.hpp>
7 +
8 + #include <iso15118/detail/d20/context_helper.hpp>
9 + #include <iso15118/detail/d20/state/schedule_exchange.hpp>
10 + #include <iso15118/detail/d20/state/session_stop.hpp>
11 + #include <iso15118/detail/helper.hpp>
12 +
13 + namespace iso15118::d20::state {
14 +
15 + namespace dt = message_20::datatypes;
16 +
17 + using ScheduledReqControlMode = message_20::datatypes::Scheduled_SEReqControlMode;
18 + using ScheduledResControlMode = message_20::datatypes::Scheduled_SEResControlMode;
19 +
20 + using DynamicReqControlMode = message_20::datatypes::Dynamic_SEReqControlMode;
21 + using DynamicResControlMode = message_20::datatypes::Dynamic_SEResControlMode;
22 +
23 + namespace {
24 + 2auto create_default_scheduled_control_mode(const dt::RationalNumber& max_power) {
25 + 2 dt::ScheduleTuple schedule;
26 + 2 schedule.schedule_tuple_id = 1;
27 + 2 schedule.charging_schedule.power_schedule.time_anchor =
28 + 2 static_cast<uint64_t>(std::time(nullptr)); // PowerSchedule is now active
29 +
30 + 2 dt::PowerScheduleEntry power_schedule;
31 + 2 power_schedule.power = max_power;
32 + 2 power_schedule.duration = dt::SCHEDULED_POWER_DURATION_S;
33 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 schedule.charging_schedule.power_schedule.entries.push_back(power_schedule);
34 +
35 + 2 ScheduledResControlMode scheduled_mode{};
36 +
37 + // Providing no price schedule!
38 + // NOTE: Agreement on iso15118.elaad.io: [V2G20-2176] is not required and should be ignored.
39 +
+ 2/4 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
✗ Branch 3 not taken.
+
✗ Branch 4 not taken.
+
+
+
4 scheduled_mode.schedule_tuple = {schedule};
40 + 4 return scheduled_mode;
41 +
+ 2/8 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 7 not taken.
+
✗ Branch 8 not taken.
+
✗ Branch 9 not taken.
+
✗ Branch 10 not taken.
+
+
+
4}
42 +
43 + namespace {
44 + void set_dynamic_parameters_in_res(DynamicResControlMode& res_mode, const UpdateDynamicModeParameters& parameters,
45 + uint64_t header_timestamp) {
46 + if (parameters.departure_time) {
47 + const auto departure_time = static_cast<uint64_t>(parameters.departure_time.value());
48 + if (departure_time > header_timestamp) {
49 + res_mode.departure_time = static_cast<uint32_t>(departure_time - header_timestamp);
50 + }
51 + }
52 + res_mode.target_soc = parameters.target_soc;
53 + res_mode.minimum_soc = parameters.min_soc;
54 + }
55 + } // namespace
56 + } // namespace
57 +
58 + namespace dt = message_20::datatypes;
59 +
60 + 8message_20::ScheduleExchangeResponse handle_request(const message_20::ScheduleExchangeRequest& req,
61 + const d20::Session& session, const dt::RationalNumber& max_power,
62 + const UpdateDynamicModeParameters& dynamic_parameters) {
63 +
64 + 8 message_20::ScheduleExchangeResponse res;
65 +
66 +
+ 3/4 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 6 times.
+
+
+
8 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
67 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
68 + }
69 +
70 + 6 const auto selected_services = session.get_selected_services();
71 + 6 const auto selected_control_mode = selected_services.selected_control_mode;
72 + 6 const auto selected_mobility_needs_mode = selected_services.selected_mobility_needs_mode;
73 +
74 + // Todo(SL): Publish data from request?
75 +
76 +
+ 6/6 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 4 times.
+
+
+
10 if (selected_control_mode == dt::ControlMode::Scheduled &&
77 + 4 std::holds_alternative<dt::Scheduled_SEReqControlMode>(req.control_mode)) {
78 +
79 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 res.control_mode.emplace<ScheduledResControlMode>(create_default_scheduled_control_mode(max_power));
80 +
81 + // TODO(sl): Adding price schedule
82 + // TODO(sl): Adding discharging schedule
83 +
84 +
+ 5/6 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
+
+
6 } else if (selected_control_mode == dt::ControlMode::Dynamic &&
85 + 2 std::holds_alternative<DynamicReqControlMode>(req.control_mode)) {
86 +
87 + // TODO(sl): Publish req dynamic mode parameters
88 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& mode = res.control_mode.emplace<DynamicResControlMode>();
89 +
90 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (selected_mobility_needs_mode == dt::MobilityNeedsMode::ProvidedBySecc) {
91 + set_dynamic_parameters_in_res(mode, dynamic_parameters, res.header.timestamp);
92 + }
93 +
94 + } else {
95 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 logf_error("The control mode of the req message does not match the previously agreed contol mode.");
96 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED);
97 + }
98 +
99 + 4 res.processing = dt::Processing::Finished;
100 +
101 +
+ 1/2 +
+
✓ Branch 2 taken 4 times.
+
✗ Branch 3 not taken.
+
+
+
4 return response_with_code(res, dt::ResponseCode::OK);
102 + 8}
103 +
104 + void ScheduleExchange::enter() {
105 + ctx.log.enter_state("ScheduleExchange");
106 + }
107 +
108 + FsmSimpleState::HandleEventReturnType ScheduleExchange::handle_event(AllocatorType& sa, FsmEvent ev) {
109 +
110 + if (ev == FsmEvent::CONTROL_MESSAGE) {
111 +
112 + // TODO(sl): Not sure if the data comes here just in time?
113 + if (const auto* control_data = ctx.get_control_event<UpdateDynamicModeParameters>()) {
114 + dynamic_parameters = *control_data;
115 + }
116 +
117 + // Ignore control message
118 + return sa.HANDLED_INTERNALLY;
119 + }
120 +
121 + if (ev != FsmEvent::V2GTP_MESSAGE) {
122 + return sa.PASS_ON;
123 + }
124 +
125 + const auto variant = ctx.pull_request();
126 +
127 + if (const auto req = variant->get_if<message_20::ScheduleExchangeRequest>()) {
128 +
129 + dt::RationalNumber max_charge_power = {0, 0};
130 +
131 + const auto selected_energy_service = ctx.session.get_selected_services().selected_energy_service;
132 +
133 + if (selected_energy_service == dt::ServiceCategory::DC or
134 + selected_energy_service == dt::ServiceCategory::DC_BPT) {
135 + max_charge_power = ctx.session_config.dc_limits.charge_limits.power.max;
136 + }
137 +
138 + const auto res = handle_request(*req, ctx.session, max_charge_power, dynamic_parameters);
139 +
140 + ctx.respond(res);
141 +
142 + if (res.response_code >= dt::ResponseCode::FAILED) {
143 + ctx.session_stopped = true;
144 + return sa.PASS_ON;
145 + }
146 +
147 + if (res.processing == dt::Processing::Ongoing) {
148 + return sa.HANDLED_INTERNALLY;
149 + }
150 +
151 + return sa.create_simple<DC_CableCheck>(ctx);
152 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
153 + const auto res = handle_request(*req, ctx.session);
154 +
155 + ctx.respond(res);
156 + ctx.session_stopped = true;
157 +
158 + return sa.PASS_ON;
159 + } else {
160 + ctx.log("expected ScheduleExchangeReq! But code type id: %d", variant->get_type());
161 +
162 + // Sequence Error
163 + const message_20::Type req_type = variant->get_type();
164 + send_sequence_error(req_type, ctx);
165 +
166 + ctx.session_stopped = true;
167 + return sa.PASS_ON;
168 + }
169 + }
170 +
171 + } // namespace iso15118::d20::state
172 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.7e536b3b516e04cfd0d1689e4d094dc4.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.7e536b3b516e04cfd0d1689e4d094dc4.html new file mode 100644 index 000000000..b0617738b --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.schedule_exchange.cpp.7e536b3b516e04cfd0d1689e4d094dc4.html @@ -0,0 +1,2980 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/schedule_exchange.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:16224765.6%
Functions:242982.8%
Branches:4718825.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/schedule_exchange.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/cb_exi.hpp>
8 + #include <iso15118/detail/variant_access.hpp>
9 +
10 + #include <cbv2g/iso_20/iso20_CommonMessages_Decoder.h>
11 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
12 +
13 + namespace iso15118::message_20 {
14 +
15 + 2template <> void convert(const struct iso20_EVPowerScheduleEntryType& in, datatypes::EVPowerScheduleEntry& out) {
16 + 2 out.duration = in.Duration;
17 + 2 convert(in.Power, out.power);
18 + 2}
19 +
20 + 2template <> void convert(const struct iso20_EVPowerScheduleType& in, datatypes::EVPowerSchedule& out) {
21 + 2 out.time_anchor = in.TimeAnchor;
22 + 2 const auto& entries_in = in.EVPowerScheduleEntries.EVPowerScheduleEntry;
23 + 2 out.entries.reserve(entries_in.arrayLen);
24 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 for (auto i = 0; i < entries_in.arrayLen; ++i) {
25 + 2 const auto& entry_in = entries_in.array[i];
26 + 2 auto& entry_out = out.entries.emplace_back();
27 + 2 convert(entry_in, entry_out);
28 + }
29 + 2}
30 +
31 + 2template <> void convert(const struct iso20_EVPriceRuleType& in, datatypes::EVPriceRule& out) {
32 + 2 convert(in.EnergyFee, out.energy_fee);
33 + 2 convert(in.PowerRangeStart, out.power_range_start);
34 + 2}
35 +
36 + 2template <> void convert(const struct iso20_EVPriceRuleStackType& in, datatypes::EVPriceRuleStack& out) {
37 + 2 out.duration = in.Duration;
38 +
39 + 2 const auto& rules_in = in.EVPriceRule;
40 + 2 out.price_rules.reserve(rules_in.arrayLen);
41 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 for (auto i = 0; i < rules_in.arrayLen; ++i) {
42 + 2 const auto& rule_in = rules_in.array[i];
43 + 2 auto& rule_out = out.price_rules.emplace_back();
44 + 2 convert(rule_in, rule_out);
45 + }
46 + 2}
47 +
48 + 2template <> void convert(const struct iso20_EVAbsolutePriceScheduleType& in, datatypes::EVAbsolutePriceSchedule& out) {
49 + 2 out.time_anchor = in.TimeAnchor;
50 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 out.currency = CB2CPP_STRING(in.Currency);
51 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 out.price_algorithm = CB2CPP_STRING(in.PriceAlgorithm);
52 +
53 + 2 const auto& stacks_in = in.EVPriceRuleStacks.EVPriceRuleStack;
54 + 2 out.price_rule_stacks.reserve(stacks_in.arrayLen);
55 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 for (auto i = 0; i < stacks_in.arrayLen; ++i) {
56 + 2 const auto& stack_in = stacks_in.array[i];
57 + 2 auto& stack_out = out.price_rule_stacks.emplace_back();
58 + 2 convert(stack_in, stack_out);
59 + }
60 + 2}
61 +
62 + 2template <> void convert(const struct iso20_EVEnergyOfferType& in, datatypes::EVEnergyOffer& out) {
63 + 2 convert(in.EVPowerSchedule, out.power_schedule);
64 + 2 convert(in.EVAbsolutePriceSchedule, out.absolute_price_schedule);
65 + 2}
66 +
67 + template <>
68 + 2void convert(const struct iso20_Scheduled_SEReqControlModeType& in, datatypes::Scheduled_SEReqControlMode& out) {
69 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.DepartureTime, out.departure_time);
70 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVTargetEnergyRequest, out.target_energy);
71 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVMaximumEnergyRequest, out.max_energy);
72 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVMinimumEnergyRequest, out.min_energy);
73 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVEnergyOffer, out.energy_offer);
74 + 2}
75 +
76 + template <>
77 + 2void convert(const struct iso20_Dynamic_SEReqControlModeType& in, datatypes::Dynamic_SEReqControlMode& out) {
78 + 2 out.departure_time = in.DepartureTime;
79 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.MinimumSOC, out.minimum_soc);
80 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_ASSIGN_IF_USED(in.TargetSOC, out.target_soc);
81 + 2 convert(in.EVTargetEnergyRequest, out.target_energy);
82 + 2 convert(in.EVMaximumEnergyRequest, out.max_energy);
83 + 2 convert(in.EVMinimumEnergyRequest, out.min_energy);
84 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVMaximumV2XEnergyRequest, out.max_v2x_energy);
85 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 CB2CPP_CONVERT_IF_USED(in.EVMinimumV2XEnergyRequest, out.min_v2x_energy);
86 + 2}
87 +
88 + 4template <> void convert(const struct iso20_ScheduleExchangeReqType& in, ScheduleExchangeRequest& out) {
89 + 4 convert(in.Header, out.header);
90 +
91 + 4 out.max_supporting_points = in.MaximumSupportingPoints;
92 +
93 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (in.Dynamic_SEReqControlMode_isUsed) {
94 + 2 auto& mode_out = out.control_mode.emplace<datatypes::Dynamic_SEReqControlMode>();
95 + 2 convert(in.Dynamic_SEReqControlMode, mode_out);
96 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (in.Scheduled_SEReqControlMode_isUsed) {
97 + 2 auto& mode_out = out.control_mode.emplace<datatypes::Scheduled_SEReqControlMode>();
98 + 2 convert(in.Scheduled_SEReqControlMode, mode_out);
99 + } else {
100 + throw std::runtime_error("No control mode selected in iso20_ScheduleExchangeReqType");
101 + }
102 + 4}
103 +
104 + 4template <> void convert(const datatypes::PowerSchedule& in, struct iso20_PowerScheduleType& out) {
105 + 4 init_iso20_PowerScheduleType(&out);
106 +
107 + 4 out.TimeAnchor = in.time_anchor;
108 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.available_energy, out.AvailableEnergy);
109 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.power_tolerance, out.PowerTolerance);
110 +
111 + 4 if ((sizeof(out.PowerScheduleEntries.PowerScheduleEntry.array) /
112 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 sizeof(out.PowerScheduleEntries.PowerScheduleEntry.array[0])) < in.entries.size()) {
113 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
114 + }
115 +
116 +
+ 2/2 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 4 times.
+
+
+
8 for (std::size_t i = 0; i < in.entries.size(); i++) {
117 + 4 auto& out_entry = out.PowerScheduleEntries.PowerScheduleEntry.array[i];
118 + 4 const auto& in_entry = in.entries[i];
119 +
120 + 4 out_entry.Duration = in_entry.duration;
121 + 4 convert(in_entry.power, out_entry.Power);
122 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in_entry.power_l2, out_entry.Power_L2);
123 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in_entry.power_l3, out_entry.Power_L3);
124 + }
125 + 4 out.PowerScheduleEntries.PowerScheduleEntry.arrayLen = in.entries.size();
126 + 4}
127 +
128 + template <> void convert(const datatypes::TaxRule& in, struct iso20_TaxRuleType& out) {
129 + out.TaxRuleID = in.tax_rule_id;
130 + CPP2CB_STRING_IF_USED(in.tax_rule_name, out.TaxRuleName);
131 + convert(in.tax_rate, out.TaxRate);
132 + CPP2CB_ASSIGN_IF_USED(in.tax_included_in_price, out.TaxIncludedInPrice);
133 + out.AppliesToEnergyFee = in.applies_to_energy_fee;
134 + out.AppliesToParkingFee = in.applies_to_parking_fee;
135 + out.AppliesToOverstayFee = in.applies_to_overstay_fee;
136 + out.AppliesMinimumMaximumCost = in.applies_to_minimum_maximum_cost;
137 + }
138 +
139 + template <> void convert(const datatypes::PriceRule& in, struct iso20_PriceRuleType& out) {
140 + convert(in.energy_fee, out.EnergyFee);
141 + CPP2CB_CONVERT_IF_USED(in.parking_fee, out.ParkingFee);
142 + CPP2CB_ASSIGN_IF_USED(in.parking_fee_period, out.ParkingFeePeriod);
143 + CPP2CB_ASSIGN_IF_USED(in.carbon_dioxide_emission, out.CarbonDioxideEmission);
144 + CPP2CB_ASSIGN_IF_USED(in.renewable_generation_percentage, out.RenewableGenerationPercentage);
145 + convert(in.power_range_start, out.PowerRangeStart);
146 + }
147 +
148 + template <> void convert(const datatypes::PriceRuleStack& in, struct iso20_PriceRuleStackType& out) {
149 + out.Duration = in.duration;
150 +
151 + if ((sizeof(out.PriceRule.array) / sizeof(out.PriceRule.array[0])) < in.price_rule.size()) {
152 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
153 + }
154 + for (std::size_t i = 0; i < in.price_rule.size(); i++) {
155 + convert(in.price_rule.at(i), out.PriceRule.array[i]);
156 + }
157 + out.PriceRule.arrayLen = in.price_rule.size();
158 + }
159 +
160 + template <> void convert(const datatypes::OverstayRule& in, struct iso20_OverstayRuleType& out) {
161 + CPP2CB_STRING_IF_USED(in.overstay_rule_description, out.OverstayRuleDescription);
162 + out.StartTime = in.start_time;
163 + convert(in.overstay_fee, out.OverstayFee);
164 + out.OverstayFeePeriod = in.overstay_fee_period;
165 + }
166 +
167 + template <> void convert(const datatypes::AbsolutePriceSchedule& in, struct iso20_AbsolutePriceScheduleType& out) {
168 +
169 + CPP2CB_STRING_IF_USED(in.id, out.Id);
170 + out.TimeAnchor = in.time_anchor;
171 + out.PriceScheduleID = in.price_schedule_id;
172 + CPP2CB_STRING_IF_USED(in.price_schedule_description, out.PriceScheduleDescription);
173 + CPP2CB_STRING(in.currency, out.Currency);
174 + CPP2CB_STRING(in.language, out.Language);
175 + CPP2CB_STRING(in.price_algorithm, out.PriceAlgorithm);
176 + CPP2CB_CONVERT_IF_USED(in.minimum_cost, out.MaximumCost);
177 + CPP2CB_CONVERT_IF_USED(in.maximum_cost, out.MaximumCost);
178 +
179 + if (in.tax_rules.has_value()) {
180 + out.TaxRules_isUsed = true;
181 + const auto& in_tax_rules = in.tax_rules.value();
182 +
183 + if ((sizeof(out.TaxRules.TaxRule.array) / sizeof(out.TaxRules.TaxRule.array[0])) < in_tax_rules.size()) {
184 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
185 + }
186 +
187 + for (std::size_t i = 0; i < in_tax_rules.size(); i++) {
188 + convert(in_tax_rules.at(i), out.TaxRules.TaxRule.array[i]);
189 + }
190 + out.TaxRules.TaxRule.arrayLen = in_tax_rules.size();
191 + }
192 +
193 + if ((sizeof(out.PriceRuleStacks.PriceRuleStack.array) / sizeof(out.PriceRuleStacks.PriceRuleStack.array[0])) <
194 + in.price_rule_stacks.size()) {
195 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
196 + }
197 + for (std::size_t i = 0; i < in.price_rule_stacks.size(); i++) {
198 + convert(in.price_rule_stacks.at(i), out.PriceRuleStacks.PriceRuleStack.array[i]);
199 + }
200 + out.PriceRuleStacks.PriceRuleStack.arrayLen = in.price_rule_stacks.size();
201 +
202 + if (in.overstay_rules.has_value()) {
203 + out.OverstayRules_isUsed = true;
204 + const auto& in_overstay_rules = in.overstay_rules.value();
205 +
206 + CPP2CB_ASSIGN_IF_USED(in_overstay_rules.overstay_time_threshold, out.OverstayRules.OverstayTimeThreshold);
207 + CPP2CB_CONVERT_IF_USED(in_overstay_rules.overstay_power_threshold, out.OverstayRules.OverstayPowerThreshold);
208 +
209 + if ((sizeof(out.OverstayRules.OverstayRule.array) / sizeof(out.OverstayRules.OverstayRule.array[0])) <
210 + in_overstay_rules.overstay_rule.size()) {
211 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
212 + }
213 +
214 + for (std::size_t i = 0; i < in_overstay_rules.overstay_rule.size(); i++) {
215 + convert(in_overstay_rules.overstay_rule.at(i), out.OverstayRules.OverstayRule.array[i]);
216 + }
217 + out.OverstayRules.OverstayRule.arrayLen = in_overstay_rules.overstay_rule.size();
218 + }
219 +
220 + if (in.additional_selected_services.has_value()) {
221 + out.AdditionalSelectedServices_isUsed = true;
222 + const auto& in_add_services = in.additional_selected_services.value();
223 +
224 + if ((sizeof(out.AdditionalSelectedServices.AdditionalService.array) /
225 + sizeof(out.AdditionalSelectedServices.AdditionalService.array[0])) < in_add_services.size()) {
226 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
227 + }
228 +
229 + for (std::size_t i = 0; i < in_add_services.size(); i++) {
230 + CPP2CB_STRING(in_add_services.at(i).service_name,
231 + out.AdditionalSelectedServices.AdditionalService.array[i].ServiceName);
232 + convert(in_add_services.at(i).service_fee,
233 + out.AdditionalSelectedServices.AdditionalService.array[i].ServiceFee);
234 + }
235 + out.AdditionalSelectedServices.AdditionalService.arrayLen = in_add_services.size();
236 + }
237 + }
238 +
239 + 2template <> void convert(const datatypes::PriceLevelSchedule& in, struct iso20_PriceLevelScheduleType& out) {
240 +
241 +
+ 1/6 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
✗ Branch 9 not taken.
+
✗ Branch 10 not taken.
+
+
+
2 CPP2CB_STRING_IF_USED(in.id, out.Id);
242 + 2 out.TimeAnchor = in.time_anchor;
243 + 2 out.PriceScheduleID = in.price_schedule_id;
244 +
+ 1/6 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
✗ Branch 9 not taken.
+
✗ Branch 10 not taken.
+
+
+
2 CPP2CB_STRING_IF_USED(in.price_schedule_description, out.PriceScheduleDescription);
245 + 2 out.NumberOfPriceLevels = in.number_of_price_levels;
246 +
247 + 2 if ((sizeof(out.PriceLevelScheduleEntries.PriceLevelScheduleEntry.array) /
248 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 sizeof(out.PriceLevelScheduleEntries.PriceLevelScheduleEntry.array[0])) <
249 + 2 in.price_level_schedule_entries.size()) {
250 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
251 + }
252 +
253 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
+
+
4 for (std::size_t i = 0; i < in.price_level_schedule_entries.size(); i++) {
254 + 2 out.PriceLevelScheduleEntries.PriceLevelScheduleEntry.array[i].Duration =
255 + 2 in.price_level_schedule_entries.at(i).duration;
256 + 2 out.PriceLevelScheduleEntries.PriceLevelScheduleEntry.array[i].PriceLevel =
257 + 2 in.price_level_schedule_entries.at(i).price_level;
258 + }
259 +
260 + 2 out.PriceLevelScheduleEntries.PriceLevelScheduleEntry.arrayLen = in.price_level_schedule_entries.size();
261 + 2}
262 +
263 + using PriceSchedule = std::variant<std::monostate, datatypes::AbsolutePriceSchedule, datatypes::PriceLevelSchedule>;
264 + 12template <typename CbMessageType> void convert_price_schedule(const PriceSchedule& in, CbMessageType& out) {
265 +
266 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 6 times.
+
+
+
12 if (const auto* absolute_price = std::get_if<datatypes::AbsolutePriceSchedule>(&in)) {
267 + convert(*absolute_price, out.AbsolutePriceSchedule);
268 + out.AbsolutePriceSchedule_isUsed = true;
269 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 4 times.
+
+
+
12 } else if (const auto* price_level_schedule = std::get_if<datatypes::PriceLevelSchedule>(&in)) {
270 + 4 convert(*price_level_schedule, out.PriceLevelSchedule);
271 + 4 out.PriceLevelSchedule_isUsed = true;
272 + } else {
273 + 8 out.AbsolutePriceSchedule_isUsed = false;
274 + 8 out.PriceLevelSchedule_isUsed = false;
275 + }
276 + 12}
277 +
278 + 4template <> void convert(const PriceSchedule& in, struct iso20_ChargingScheduleType& out) {
279 + 4 convert_price_schedule(in, out);
280 + 4}
281 + 2template <> void convert(const PriceSchedule& in, struct iso20_Dynamic_SEResControlModeType& out) {
282 + 2 convert_price_schedule(in, out);
283 + 2}
284 +
285 + 4template <> void convert(const datatypes::ChargingSchedule& in, struct iso20_ChargingScheduleType& out) {
286 + 4 init_iso20_ChargingScheduleType(&out);
287 +
288 + 4 convert(in.power_schedule, out.PowerSchedule);
289 + 4 convert(in.price_schedule, out);
290 + 4}
291 +
292 + 4template <> void convert(const datatypes::ScheduleTuple& in, struct iso20_ScheduleTupleType& out) {
293 + 4 init_iso20_ScheduleTupleType(&out);
294 +
295 + 4 out.ScheduleTupleID = in.schedule_tuple_id;
296 + 4 convert(in.charging_schedule, out.ChargingSchedule);
297 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 CPP2CB_CONVERT_IF_USED(in.discharging_schedule, out.DischargingSchedule);
298 + 4}
299 +
300 + struct ModeResponseVisitor {
301 + 6 ModeResponseVisitor(iso20_ScheduleExchangeResType& res_) : res(res_){};
302 + 2 void operator()(const datatypes::Dynamic_SEResControlMode& in) {
303 + 2 init_iso20_Dynamic_SEResControlModeType(&res.Dynamic_SEResControlMode);
304 + 2 CB_SET_USED(res.Dynamic_SEResControlMode);
305 +
306 + 2 auto& out = res.Dynamic_SEResControlMode;
307 +
308 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 CPP2CB_ASSIGN_IF_USED(in.departure_time, out.DepartureTime)
309 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_ASSIGN_IF_USED(in.minimum_soc, out.MinimumSOC);
310 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 CPP2CB_ASSIGN_IF_USED(in.target_soc, out.TargetSOC);
311 +
312 + 2 convert(in.price_schedule, out);
313 + 2 }
314 +
315 + 4 void operator()(const datatypes::Scheduled_SEResControlMode& in) {
316 + 4 init_iso20_Scheduled_SEResControlModeType(&res.Scheduled_SEResControlMode);
317 + 4 CB_SET_USED(res.Scheduled_SEResControlMode);
318 +
319 + 4 auto& out = res.Scheduled_SEResControlMode;
320 +
321 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 4 times.
+
+
+
4 if ((sizeof(out.ScheduleTuple.array) / sizeof(out.ScheduleTuple.array[0])) < in.schedule_tuple.size()) {
322 + throw std::runtime_error("array is too large"); // FIXME(SL): Change error message
323 + }
324 +
325 +
+ 2/2 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 4 times.
+
+
+
8 for (std::size_t i = 0; i < in.schedule_tuple.size(); i++) {
326 + 4 convert(in.schedule_tuple[i], out.ScheduleTuple.array[i]);
327 + }
328 + 4 out.ScheduleTuple.arrayLen = in.schedule_tuple.size();
329 + 4 }
330 +
331 + private:
332 + iso20_ScheduleExchangeResType& res;
333 + };
334 +
335 + 6template <> void convert(const ScheduleExchangeResponse& in, struct iso20_ScheduleExchangeResType& out) {
336 + 6 init_iso20_ScheduleExchangeResType(&out);
337 +
338 + 6 convert(in.header, out.Header);
339 + 6 cb_convert_enum(in.response_code, out.ResponseCode);
340 +
341 + 6 cb_convert_enum(in.processing, out.EVSEProcessing);
342 +
343 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 6 times.
+
+
+
6 CPP2CB_ASSIGN_IF_USED(in.go_to_pause, out.GoToPause);
344 +
345 +
+ 1/2 +
+
✓ Branch 2 taken 6 times.
+
✗ Branch 3 not taken.
+
+
+
6 std::visit(ModeResponseVisitor(out), in.control_mode);
346 + 6}
347 +
348 + 4template <> void insert_type(VariantAccess& va, const struct iso20_ScheduleExchangeReqType& in) {
349 + 4 va.insert_type<ScheduleExchangeRequest>(in);
350 + 4};
351 +
352 + 6template <> int serialize_to_exi(const ScheduleExchangeResponse& in, exi_bitstream_t& out) {
353 + iso20_exiDocument doc;
354 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 init_iso20_exiDocument(&doc);
355 +
356 + 6 CB_SET_USED(doc.ScheduleExchangeRes);
357 +
358 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 convert(in, doc.ScheduleExchangeRes);
359 +
360 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
12 return encode_iso20_exiDocument(&out, &doc);
361 + }
362 +
363 + 6template <> size_t serialize(const ScheduleExchangeResponse& in, const io::StreamOutputView& out) {
364 + 6 return serialize_helper(in, out);
365 + }
366 +
367 + } // namespace iso15118::message_20
368 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.cpp.66409cde6ff3c9c53bdd20c4a115c795.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.cpp.66409cde6ff3c9c53bdd20c4a115c795.html new file mode 100644 index 000000000..5651ca080 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.cpp.66409cde6ff3c9c53bdd20c4a115c795.html @@ -0,0 +1,574 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/sdp_packet.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0290.0%
Functions:040.0%
Branches:0230.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/sdp_packet.hpp>
4 +
5 + #include <cstdio>
6 + #include <cstring>
7 +
8 + #include <endian.h>
9 +
10 + namespace iso15118::io {
11 +
12 + v2gtp::PayloadType SdpPacket::get_payload_type() const {
13 + uint16_t tmp;
14 + std::memcpy(&tmp, buffer + 2, sizeof(tmp));
15 +
16 + return static_cast<v2gtp::PayloadType>(be16toh(tmp));
17 + }
18 +
19 + size_t SdpPacket::get_remaining_bytes_to_read() const {
20 + switch (state) {
21 + case State::EMPTY:
22 + return V2GTP_HEADER_SIZE - bytes_read;
23 + case State::HEADER_READ:
24 + return length - bytes_read;
25 + default:
26 + return 0;
27 + }
28 + }
29 +
30 + void SdpPacket::update_read_bytes(size_t len) {
31 + if ((state == State::COMPLETE) or (state == State::INVALID_HEADER) or (state == State::PAYLOAD_TO_LONG)) {
32 + // nothing to do here - should also not happen, right?
33 + return;
34 + }
35 +
36 + bytes_read += len;
37 +
38 + if ((state == State::EMPTY) and (bytes_read == V2GTP_HEADER_SIZE)) {
39 + parse_header();
40 + }
41 +
42 + if ((state == State::HEADER_READ) and (bytes_read == length)) {
43 + state = State::COMPLETE;
44 + }
45 + }
46 +
47 + void SdpPacket::parse_header() {
48 + if ((buffer[0] != SDP_PROTOCOL_VERSION) or (buffer[1] != SDP_INVERSE_PROTOCOL_VERSION)) {
49 + state = State::INVALID_HEADER;
50 + return;
51 + }
52 +
53 + uint32_t tmp;
54 + std::memcpy(&tmp, buffer + 4, sizeof(tmp));
55 +
56 + // FIXME (aw): check for ill-formed header!
57 + length = be32toh(tmp) + V2GTP_HEADER_SIZE;
58 +
59 + if (length > sizeof(buffer)) {
60 + state = State::PAYLOAD_TO_LONG;
61 + return;
62 + }
63 +
64 + state = State::HEADER_READ;
65 + }
66 +
67 + } // namespace iso15118::io
68 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.hpp.4a2d799666e9e5f6a5b671fb71e627b1.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.hpp.4a2d799666e9e5f6a5b671fb71e627b1.html new file mode 100644 index 000000000..92eb9d9a8 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_packet.hpp.4a2d799666e9e5f6a5b671fb71e627b1.html @@ -0,0 +1,617 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/io/sdp_packet.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0100.0%
Functions:050.0%
Branches:020.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cstddef>
6 + #include <cstdint>
7 +
8 + #include "sdp.hpp"
9 +
10 + namespace iso15118::io {
11 +
12 + // FIXME (aw): these shouldn't be necessary public - but nice to have
13 + static constexpr uint8_t SDP_PROTOCOL_VERSION = 0x01;
14 + static constexpr uint8_t SDP_INVERSE_PROTOCOL_VERSION = 0xFE;
15 +
16 + // FIXME (aw): should be called V2GTP or SDP buffer
17 + class SdpPacket {
18 + public:
19 + static constexpr auto V2GTP_HEADER_SIZE = 8;
20 + enum class State {
21 + EMPTY, // FIXME (aw): misnomer
22 + HEADER_READ,
23 + COMPLETE,
24 +
25 + // failed states
26 + INVALID_HEADER,
27 + PAYLOAD_TO_LONG,
28 + };
29 +
30 + auto get_state() const {
31 + return state;
32 + }
33 +
34 + auto is_complete() const {
35 + return state == State::COMPLETE;
36 + }
37 +
38 + auto get_payload_length() const {
39 + return (state == State::COMPLETE) ? (length - V2GTP_HEADER_SIZE) : 0;
40 + }
41 +
42 + v2gtp::PayloadType get_payload_type() const;
43 +
44 + uint8_t const* get_payload_buffer() const {
45 + return buffer + V2GTP_HEADER_SIZE;
46 + }
47 +
48 + uint8_t const* get_buffer() const {
49 + return buffer;
50 + }
51 +
52 + uint8_t* get_current_buffer_pos() {
53 + return buffer + bytes_read;
54 + }
55 +
56 + size_t get_remaining_buffer_capacity() const {
57 + return sizeof(buffer) - bytes_read;
58 + }
59 +
60 + size_t get_remaining_bytes_to_read() const;
61 +
62 + void update_read_bytes(size_t len);
63 +
64 + private:
65 + void parse_header();
66 +
67 + State state{State::EMPTY};
68 + uint8_t buffer[2048];
69 + size_t bytes_read{0};
70 + size_t length; // length includes V2GTP_HEADER_SIZE
71 + };
72 +
73 + } // namespace iso15118::io
74 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.cpp.50d67d7ac694fdd49ba893a76940bcd9.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.cpp.50d67d7ac694fdd49ba893a76940bcd9.html new file mode 100644 index 000000000..638ed23f0 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.cpp.50d67d7ac694fdd49ba893a76940bcd9.html @@ -0,0 +1,1950 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/sdp_server.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:01230.0%
Functions:080.0%
Branches:01260.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/io/sdp_server.hpp>
4 +
5 + #include <cstring>
6 +
7 + #include <endian.h>
8 + #include <netdb.h>
9 + #include <unistd.h>
10 +
11 + #include <arpa/inet.h>
12 + #include <net/if.h>
13 +
14 + #include <cbv2g/exi_v2gtp.h>
15 +
16 + #include <iso15118/detail/helper.hpp>
17 +
18 + // FIXME(Sl): Not sure with define
19 + /* link-local multicast address ff02::1 aka ip6-allnodes */
20 + #define IN6ADDR_ALLNODES \
21 + { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01 }
22 +
23 + namespace iso15118 {
24 +
25 + static void log_peer_hostname(const struct sockaddr_in6& address) {
26 + char hostname[128];
27 + socklen_t hostname_len = sizeof(hostname);
28 +
29 + const auto get_if_name_result = getnameinfo(reinterpret_cast<const struct sockaddr*>(&address), sizeof(address),
30 + hostname, hostname_len, nullptr, 0, NI_NUMERICHOST);
31 +
32 + if (0 == get_if_name_result) {
33 + logf_info("Got SDP request from %s", hostname);
34 + } else {
35 + logf_warning("Got SDP request, but failed to get the address");
36 + }
37 + }
38 +
39 + namespace io {
40 +
41 + SdpServer::SdpServer(const std::string& interface_name) {
42 + fd = socket(AF_INET6, SOCK_DGRAM, 0);
43 +
44 + if (fd == -1) {
45 + log_and_throw("Failed to open socket");
46 + }
47 +
48 + // initialize socket address, leave scope_id and flowinfo at 0
49 + struct sockaddr_in6 socket_address;
50 + bzero(&socket_address, sizeof(socket_address));
51 + socket_address.sin6_family = AF_INET6;
52 + socket_address.sin6_port = htobe16(v2gtp::SDP_SERVER_PORT);
53 + memcpy(&socket_address.sin6_addr, &in6addr_any, sizeof(socket_address.sin6_addr));
54 +
55 + int enable = 1;
56 + auto result = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(enable));
57 + if (result == -1) {
58 + const auto error_msg = adding_err_msg("Setsockopt(SO_REUSEPORT) failed");
59 + log_and_throw(error_msg.c_str());
60 + }
61 +
62 + const auto bind_result =
63 + bind(fd, reinterpret_cast<const struct sockaddr*>(&socket_address), sizeof(socket_address));
64 + if (bind_result == -1) {
65 + log_and_throw("Failed to bind to socket");
66 + }
67 +
68 + // Bind only to specified device
69 + result = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, interface_name.c_str(), interface_name.length());
70 + if (result == -1) {
71 + const auto error_msg = adding_err_msg("Setsockopt(SO_BINDTODEVICE) failed");
72 + log_and_throw(error_msg.c_str());
73 + }
74 +
75 + // Join multicast group
76 + struct ipv6_mreq mreq {};
77 + mreq.ipv6mr_multiaddr = IN6ADDR_ALLNODES;
78 + mreq.ipv6mr_interface = if_nametoindex(interface_name.c_str());
79 +
80 + result = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq));
81 + if (result == -1) {
82 + const auto error_msg = adding_err_msg("Setsockopt(IPV6_JOIN_GROUP) failed");
83 + log_and_throw(error_msg.c_str());
84 + }
85 + }
86 +
87 + SdpServer::~SdpServer() {
88 + // FIXME (aw): rather use some RAII class for this!
89 + logf_info("Shutting down SDP server!");
90 + if (fd != -1) {
91 + close(fd);
92 + }
93 + }
94 +
95 + PeerRequestContext SdpServer::get_peer_request() {
96 + decltype(PeerRequestContext::address) peer_address;
97 + socklen_t peer_addr_len = sizeof(peer_address);
98 +
99 + const auto read_result = recvfrom(fd, udp_buffer, sizeof(udp_buffer), 0,
100 + reinterpret_cast<struct sockaddr*>(&peer_address), &peer_addr_len);
101 + if (read_result <= 0) {
102 + log_and_throw("Read on sdp server socket failed");
103 + }
104 +
105 + if (peer_addr_len > sizeof(peer_address)) {
106 + log_and_throw("Unexpected address length during read on sdp server socket");
107 + }
108 +
109 + log_peer_hostname(peer_address);
110 +
111 + if (read_result == sizeof(udp_buffer)) {
112 + logf_warning("Read on sdp server socket succeeded, but message is to big for the buffer");
113 + return PeerRequestContext{false};
114 + }
115 +
116 + uint32_t sdp_payload_len;
117 + const auto parse_sdp_result = V2GTP20_ReadHeader(udp_buffer, &sdp_payload_len, V2GTP20_SDP_REQUEST_PAYLOAD_ID);
118 +
119 + if (parse_sdp_result != V2GTP_ERROR__NO_ERROR) {
120 + // FIXME (aw): we should not die here immediately
121 + logf_warning("Sdp server received an unexpected payload");
122 + return PeerRequestContext{false};
123 + }
124 +
125 + PeerRequestContext peer_request{true};
126 +
127 + // NOTE (aw): this could be moved into a constructor
128 + const uint8_t sdp_request_byte1 = udp_buffer[8];
129 + const uint8_t sdp_request_byte2 = udp_buffer[9];
130 + peer_request.security = static_cast<v2gtp::Security>(sdp_request_byte1);
131 + peer_request.transport_protocol = static_cast<v2gtp::TransportProtocol>(sdp_request_byte2);
132 + memcpy(&peer_request.address, &peer_address, sizeof(peer_address));
133 +
134 + return peer_request;
135 + }
136 +
137 + void SdpServer::send_response(const PeerRequestContext& request, const Ipv6EndPoint& ipv6_endpoint) {
138 + // that worked, now response
139 + uint8_t v2g_packet[28];
140 + uint8_t* sdp_response = v2g_packet + 8;
141 + memcpy(sdp_response, ipv6_endpoint.address, sizeof(ipv6_endpoint.address));
142 +
143 + uint16_t port = htobe16(ipv6_endpoint.port);
144 + memcpy(sdp_response + 16, &port, sizeof(port));
145 +
146 + // FIXME (aw): which values to take here?
147 + sdp_response[18] = static_cast<std::underlying_type_t<v2gtp::Security>>(request.security);
148 + sdp_response[19] = static_cast<std::underlying_type_t<v2gtp::TransportProtocol>>(request.transport_protocol);
149 +
150 + V2GTP20_WriteHeader(v2g_packet, 20, V2GTP20_SDP_RESPONSE_PAYLOAD_ID);
151 +
152 + const auto peer_addr_len = sizeof(request.address);
153 +
154 + sendto(fd, v2g_packet, sizeof(v2g_packet), 0, reinterpret_cast<const sockaddr*>(&request.address), peer_addr_len);
155 + }
156 + TlsKeyLoggingServer::TlsKeyLoggingServer(const std::string& interface_name, uint16_t port) {
157 + static constexpr auto LINK_LOCAL_MULTICAST = "ff02::1";
158 +
159 + fd = socket(AF_INET6, SOCK_DGRAM, 0);
160 + if (fd < 0) {
161 + const auto error_msg = adding_err_msg("Could not create socket");
162 + log_and_throw(error_msg.c_str()); // FIXME(sl): Find better handling
163 + }
164 +
165 + // source setup
166 +
167 + // find port between 49152-65535
168 + auto could_bind = false;
169 + auto source_port = 49152;
170 + for (; source_port < 65535; source_port++) {
171 + sockaddr_in6 source_address = {AF_INET6, htons(source_port), 0, {}, 0};
172 + if (bind(fd, reinterpret_cast<sockaddr*>(&source_address), sizeof(sockaddr_in6)) == 0) {
173 + could_bind = true;
174 + break;
175 + }
176 + }
177 +
178 + if (!could_bind) {
179 + const auto error_msg = adding_err_msg("Could not bind");
180 + log_and_throw(error_msg.c_str());
181 + }
182 +
183 + logf_info("UDP socket bound to source port: %u", source_port);
184 +
185 + const auto index = if_nametoindex(interface_name.c_str());
186 + auto mreq = ipv6_mreq{};
187 + mreq.ipv6mr_interface = index;
188 + if (inet_pton(AF_INET6, LINK_LOCAL_MULTICAST, &mreq.ipv6mr_multiaddr) <= 0) {
189 + const auto error_msg = adding_err_msg("Failed to setup multicast address");
190 + log_and_throw(error_msg.c_str());
191 + }
192 + if (setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
193 + const auto error_msg = adding_err_msg("Could not add multicast group membership");
194 + log_and_throw(error_msg.c_str());
195 + }
196 +
197 + if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, &index, sizeof(index)) < 0) {
198 + const auto error_msg = adding_err_msg("Could not set interface name:" + std::string(interface_name));
199 + log_and_throw(error_msg.c_str());
200 + }
201 +
202 + destination_address = {AF_INET6, htons(port), 0, {}, 0};
203 + if (inet_pton(AF_INET6, LINK_LOCAL_MULTICAST, &destination_address.sin6_addr) <= 0) {
204 + const auto error_msg = adding_err_msg("Failed to setup server address, reset key_log_fd");
205 + log_and_throw(error_msg.c_str());
206 + }
207 + }
208 +
209 + TlsKeyLoggingServer::~TlsKeyLoggingServer() {
210 + logf_info("Shutting down TlsKeyLoggingServer server!");
211 + if (fd != -1) {
212 + close(fd);
213 + }
214 + }
215 +
216 + ssize_t TlsKeyLoggingServer::send(const char* line) {
217 + return sendto(fd, line, strlen(line), 0, reinterpret_cast<const sockaddr*>(&destination_address),
218 + sizeof(destination_address));
219 + }
220 +
221 + #if 0
222 +
223 + void parse_sdp_request(uint8_t* packet) {
224 + // check sdp header
225 + uint32_t sdp_payload_len;
226 + const auto parse_sdp_result = V2GTP20_ReadHeader(packet, &sdp_payload_len, V2GTP20_SDP_REQUEST_PAYLOAD_ID);
227 +
228 + if (parse_sdp_result != V2GTP_ERROR__NO_ERROR) {
229 + log_and_throw("Failed to parse sdp header");
230 + }
231 +
232 + logf_info("Got sdp payload of %d bytes", sdp_payload_len);
233 + const uint8_t sdp_request_byte1 = packet[8];
234 +
235 + switch (static_cast<v2gtp::Security>(sdp_request_byte1)) {
236 + case v2gtp::Security::TLS:
237 + logf_info(" -> TLS requested");
238 + break;
239 + case v2gtp::Security::NO_TRANSPORT_SECURITY:
240 + logf_info(" -> no security");
241 + break;
242 + default:
243 + logf_info(" -> EXCEPTION: reserved value");
244 + break;
245 + }
246 +
247 + const uint8_t sdp_request_byte2 = packet[9];
248 + switch (static_cast<v2gtp::TransportProtocol>(sdp_request_byte2)) {
249 + case v2gtp::TransportProtocol::TCP:
250 + logf_info(" -> TCP requested");
251 + break;
252 + case v2gtp::TransportProtocol::RESERVED_FOR_UDP:
253 + logf_info(" -> reserved for UDP");
254 + break;
255 + default:
256 + logf_info(" -> EXCEPTION: reserved value");
257 + break;
258 + }
259 + }
260 + #endif
261 + } // namespace io
262 +
263 + } // namespace iso15118
264 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.hpp.784e270a91c2a20ac4c3a06e6507cc0c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.hpp.784e270a91c2a20ac4c3a06e6507cc0c.html new file mode 100644 index 000000000..fd5bce0fa --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.sdp_server.hpp.784e270a91c2a20ac4c3a06e6507cc0c.html @@ -0,0 +1,532 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/io/sdp_server.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:070.0%
Functions:040.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cstdint>
6 + #include <string>
7 +
8 + #include <netinet/in.h>
9 +
10 + #include "ipv6_endpoint.hpp"
11 + #include "sdp.hpp"
12 +
13 + namespace iso15118::io {
14 +
15 + struct PeerRequestContext {
16 + explicit PeerRequestContext(bool valid_) : valid(valid_){};
17 + v2gtp::Security security;
18 + v2gtp::TransportProtocol transport_protocol;
19 + struct sockaddr_in6 address;
20 +
21 + operator bool() const {
22 + return valid;
23 + }
24 +
25 + private:
26 + const bool valid;
27 + };
28 +
29 + class SdpServer {
30 + public:
31 + explicit SdpServer(const std::string& interface_name);
32 + ~SdpServer();
33 + PeerRequestContext get_peer_request();
34 + void send_response(const PeerRequestContext&, const Ipv6EndPoint&);
35 +
36 + auto get_fd() const {
37 + return fd;
38 + }
39 +
40 + private:
41 + int fd{-1};
42 + uint8_t udp_buffer[2048];
43 + };
44 +
45 + class TlsKeyLoggingServer {
46 + public:
47 + TlsKeyLoggingServer(const std::string& interface_name, uint16_t port);
48 + ~TlsKeyLoggingServer();
49 +
50 + ssize_t send(const char* line);
51 +
52 + auto get_fd() const {
53 + return fd;
54 + }
55 +
56 + private:
57 + int fd{-1};
58 + sockaddr_in6 destination_address{};
59 + };
60 +
61 + } // namespace iso15118::io
62 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.03c0f56c4688729b60ff8893e5d34c8f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.03c0f56c4688729b60ff8893e5d34c8f.html new file mode 100644 index 000000000..879e49a4b --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.03c0f56c4688729b60ff8893e5d34c8f.html @@ -0,0 +1,1803 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/service_detail.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:10012282.0%
Functions:121770.6%
Branches:5010846.3%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/service_detail.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + namespace datatypes {
14 + // default
15 + 18ParameterSet::ParameterSet() {
16 + 18 id = 0;
17 + 18 parameter.push_back({
18 + "Connector", // name
19 + static_cast<int32_t>(DcConnector::Core) // value
20 + });
21 + 18 parameter.push_back({
22 + "ControlMode", // name
23 + static_cast<int32_t>(ControlMode::Scheduled) // value
24 + });
25 + 18 parameter.push_back({
26 + "MobilityNeedsMode", // name
27 + static_cast<int32_t>(MobilityNeedsMode::ProvidedByEvcc) // value
28 + });
29 + 18 parameter.push_back({
30 + "Pricing", // name
31 + static_cast<int32_t>(Pricing::NoPricing) // value
32 + });
33 +
+ 8/24 +
+
✓ Branch 2 taken 18 times.
+
✗ Branch 3 not taken.
+
✓ Branch 5 taken 18 times.
+
✗ Branch 6 not taken.
+
✓ Branch 10 taken 18 times.
+
✗ Branch 11 not taken.
+
✓ Branch 13 taken 18 times.
+
✗ Branch 14 not taken.
+
✓ Branch 18 taken 18 times.
+
✗ Branch 19 not taken.
+
✓ Branch 21 taken 18 times.
+
✗ Branch 22 not taken.
+
✓ Branch 26 taken 18 times.
+
✗ Branch 27 not taken.
+
✓ Branch 29 taken 18 times.
+
✗ Branch 30 not taken.
+
✗ Branch 32 not taken.
+
✗ Branch 33 not taken.
+
✗ Branch 36 not taken.
+
✗ Branch 37 not taken.
+
✗ Branch 40 not taken.
+
✗ Branch 41 not taken.
+
✗ Branch 44 not taken.
+
✗ Branch 45 not taken.
+
+
+
90}
34 +
35 + 10ParameterSet::ParameterSet(uint16_t _id, const DcParameterList& list) {
36 + 10 id = _id;
37 + // Connector
38 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 auto& connector = parameter.emplace_back();
39 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 connector.name = "Connector";
40 + 10 connector.value = static_cast<int32_t>(list.connector);
41 + // ControlMode
42 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 auto& control_mode = parameter.emplace_back();
43 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 control_mode.name = "ControlMode";
44 + 10 control_mode.value = static_cast<int32_t>(list.control_mode);
45 + // MobilityNeedsMode
46 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 auto& mobility = parameter.emplace_back();
47 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 mobility.name = "MobilityNeedsMode";
48 +
+ 2/2 +
+
✓ Branch 0 taken 8 times.
+
✓ Branch 1 taken 2 times.
+
+
+
10 if (list.control_mode == ControlMode::Scheduled) {
49 + 8 mobility.value = static_cast<int32_t>(MobilityNeedsMode::ProvidedByEvcc);
50 + } else {
51 + 2 mobility.value = static_cast<int32_t>(list.mobility_needs_mode);
52 + }
53 + // Pricing
54 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 auto& pricing = parameter.emplace_back();
55 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 pricing.name = "Pricing";
56 + 10 pricing.value = static_cast<int32_t>(list.pricing);
57 + 10}
58 +
59 + 2ParameterSet::ParameterSet(uint16_t _id, const DcBptParameterList& list) {
60 + 2 id = _id;
61 + // Todo(sl): Refactor because of duplicate code
62 + // Connector
63 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& connector = parameter.emplace_back();
64 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 connector.name = "Connector";
65 + 2 connector.value = static_cast<int32_t>(list.connector);
66 + // ControlMode
67 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& control_mode = parameter.emplace_back();
68 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 control_mode.name = "ControlMode";
69 + 2 control_mode.value = static_cast<int32_t>(list.control_mode);
70 + // MobilityNeedsMode
71 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& mobility = parameter.emplace_back();
72 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 mobility.name = "MobilityNeedsMode";
73 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 if (list.control_mode == ControlMode::Scheduled) {
74 + 2 mobility.value = static_cast<int32_t>(MobilityNeedsMode::ProvidedByEvcc);
75 + } else {
76 + mobility.value = static_cast<int32_t>(list.mobility_needs_mode);
77 + }
78 + // Pricing
79 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& pricing = parameter.emplace_back();
80 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 pricing.name = "Pricing";
81 + 2 pricing.value = static_cast<int32_t>(list.pricing);
82 + // BPTChannel
83 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& channel = parameter.emplace_back();
84 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 channel.name = "BPTChannel";
85 + 2 channel.value = static_cast<int32_t>(list.bpt_channel);
86 + // GeneratorMode
87 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& generator_mode = parameter.emplace_back();
88 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 generator_mode.name = "GeneratorMode";
89 + 2 generator_mode.value = static_cast<int32_t>(list.generator_mode);
90 + 2}
91 +
92 + 2ParameterSet::ParameterSet(uint16_t _id, const InternetParameterList& list) {
93 + 2 id = _id;
94 +
95 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& protocol = parameter.emplace_back();
96 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 protocol.name = "Protocol";
97 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 protocol.value = from_Protocol(list.protocol);
98 +
99 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& port = parameter.emplace_back();
100 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 port.name = "Port";
101 + 2 port.value = static_cast<int32_t>(list.port);
102 + 2}
103 +
104 + 2ParameterSet::ParameterSet(uint16_t _id, const ParkingParameterList& list) {
105 + 2 id = _id;
106 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& intended_service = parameter.emplace_back();
107 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 intended_service.name = "IntendedService";
108 + 2 intended_service.value = static_cast<int32_t>(list.intended_service);
109 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& parking_status = parameter.emplace_back();
110 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 parking_status.name = "ParkingStatusType";
111 + 2 parking_status.value = static_cast<int32_t>(list.parking_status);
112 + 2}
113 +
114 + } // namespace datatypes
115 +
116 + 2template <> void convert(const struct iso20_ServiceDetailReqType& in, ServiceDetailRequest& out) {
117 + 2 convert(in.Header, out.header);
118 + 2 out.service = static_cast<datatypes::ServiceCategory>(in.ServiceID);
119 + 2}
120 +
121 + struct ParamterValueVisitor {
122 + 8 ParamterValueVisitor(iso20_ParameterType& parameter_) : parameter(parameter_){};
123 + void operator()(const bool& in) {
124 + CB_SET_USED(parameter.boolValue);
125 + parameter.boolValue = in;
126 + }
127 + void operator()(const int8_t& in) {
128 + CB_SET_USED(parameter.byteValue);
129 + parameter.byteValue = in;
130 + }
131 + void operator()(const int16_t& in) {
132 + CB_SET_USED(parameter.shortValue);
133 + parameter.shortValue = in;
134 + }
135 + 8 void operator()(const int32_t& in) {
136 + 8 CB_SET_USED(parameter.intValue);
137 + 8 parameter.intValue = in;
138 + 8 }
139 + void operator()(const std::string& in) {
140 + CB_SET_USED(parameter.finiteString);
141 + CPP2CB_STRING(in, parameter.finiteString);
142 + }
143 + void operator()(const message_20::datatypes::RationalNumber& in) {
144 + CB_SET_USED(parameter.rationalNumber);
145 + parameter.rationalNumber.Exponent = in.exponent;
146 + parameter.rationalNumber.Value = in.value;
147 + }
148 +
149 + private:
150 + iso20_ParameterType& parameter;
151 + };
152 +
153 + 2template <> void convert(const ServiceDetailResponse& in, iso20_ServiceDetailResType& out) {
154 + 2 init_iso20_ServiceDetailResType(&out);
155 +
156 + 2 convert(in.header, out.Header);
157 +
158 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
159 +
160 + 2 cb_convert_enum(in.service, out.ServiceID);
161 +
162 + 2 uint8_t index = 0;
163 +
+ 2/2 +
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
+
+
4 for (auto const& in_parameter_set : in.service_parameter_list) {
164 + 2 auto& out_paramater_set = out.ServiceParameterList.ParameterSet.array[index++];
165 + 2 out_paramater_set.ParameterSetID = in_parameter_set.id;
166 +
167 + 2 uint8_t t = 0;
168 +
+ 2/2 +
+
✓ Branch 4 taken 8 times.
+
✓ Branch 5 taken 2 times.
+
+
+
10 for (auto const& in_parameter : in_parameter_set.parameter) {
169 + 8 auto& out_parameter = out_paramater_set.Parameter.array[t++];
170 +
+ 2/6 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 8 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
✓ Branch 10 taken 8 times.
+
✗ Branch 11 not taken.
+
+
+
8 CPP2CB_STRING(in_parameter.name, out_parameter.Name);
171 +
+ 1/2 +
+
✓ Branch 2 taken 8 times.
+
✗ Branch 3 not taken.
+
+
+
8 std::visit(ParamterValueVisitor(out_parameter), in_parameter.value);
172 + }
173 + 2 out_paramater_set.Parameter.arrayLen = in_parameter_set.parameter.size();
174 + }
175 +
176 + 2 out.ServiceParameterList.ParameterSet.arrayLen = in.service_parameter_list.size();
177 + 2}
178 +
179 + 2template <> void insert_type(VariantAccess& va, const struct iso20_ServiceDetailReqType& in) {
180 + 2 va.insert_type<ServiceDetailRequest>(in);
181 + 2}
182 +
183 + 2template <> int serialize_to_exi(const ServiceDetailResponse& in, exi_bitstream_t& out) {
184 + iso20_exiDocument doc;
185 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
186 +
187 + 2 CB_SET_USED(doc.ServiceDetailRes);
188 +
189 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.ServiceDetailRes);
190 +
191 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
192 + }
193 +
194 + 2template <> size_t serialize(const ServiceDetailResponse& in, const io::StreamOutputView& out) {
195 + 2 return serialize_helper(in, out);
196 + }
197 +
198 + } // namespace iso15118::message_20
199 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.bfd3425545a2c3cb75477d0d910e258f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.bfd3425545a2c3cb75477d0d910e258f.html new file mode 100644 index 000000000..db780042e --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_detail.cpp.bfd3425545a2c3cb75477d0d910e258f.html @@ -0,0 +1,1321 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/service_detail.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:488060.0%
Functions:1333.3%
Branches:4310142.6%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/service_detail.hpp>
4 + #include <iso15118/d20/state/service_selection.hpp>
5 +
6 + #include <iso15118/detail/d20/context_helper.hpp>
7 + #include <iso15118/detail/d20/state/service_detail.hpp>
8 + #include <iso15118/detail/d20/state/session_stop.hpp>
9 +
10 + #include <iso15118/detail/helper.hpp>
11 +
12 + namespace iso15118::d20::state {
13 +
14 + namespace dt = message_20::datatypes;
15 +
16 + 16message_20::ServiceDetailResponse handle_request(const message_20::ServiceDetailRequest& req, d20::Session& session,
17 + const d20::SessionConfig& config) {
18 +
19 +
+ 1/2 +
+
✓ Branch 1 taken 16 times.
+
✗ Branch 2 not taken.
+
+
+
16 message_20::ServiceDetailResponse res;
20 +
21 +
+ 3/4 +
+
✓ Branch 1 taken 16 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 14 times.
+
+
+
16 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
22 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
23 + }
24 +
25 + 14 bool service_found = false;
26 +
27 +
+ 2/2 +
+
✓ Branch 5 taken 14 times.
+
✓ Branch 6 taken 6 times.
+
+
+
20 for (auto& energy_service : session.offered_services.energy_services) {
28 +
+ 2/2 +
+
✓ Branch 0 taken 8 times.
+
✓ Branch 1 taken 6 times.
+
+
+
14 if (energy_service == req.service) {
29 + 8 service_found = true;
30 + 8 break;
31 + }
32 + }
33 +
34 +
+ 2/2 +
+
✓ Branch 5 taken 4 times.
+
✓ Branch 6 taken 10 times.
+
+
+
14 for (auto& vas_service : session.offered_services.vas_services) {
35 +
+ 1/2 +
+
✓ Branch 0 taken 4 times.
+
✗ Branch 1 not taken.
+
+
+
4 if (vas_service == req.service) {
36 + 4 service_found = true;
37 + 4 break;
38 + }
39 + }
40 +
41 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 12 times.
+
+
+
14 if (!service_found) {
42 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_ServiceIDInvalid);
43 + }
44 +
45 + 12 res.service_parameter_list.clear(); // reset default values
46 +
47 + 12 uint8_t id = 0;
48 +
49 +
+ 4/5 +
+
✓ Branch 0 taken 6 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
✓ Branch 3 taken 2 times.
+
✗ Branch 4 not taken.
+
+
+
12 switch (req.service) {
50 + 6 case dt::ServiceCategory::DC:
51 + 6 res.service = dt::ServiceCategory::DC;
52 +
+ 2/2 +
+
✓ Branch 4 taken 8 times.
+
✓ Branch 5 taken 6 times.
+
+
+
14 for (auto& parameter_set : config.dc_parameter_list) {
53 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 session.offered_services.dc_parameter_list[id] = parameter_set;
54 +
+ 2/4 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 8 times.
+
✗ Branch 5 not taken.
+
+
+
8 res.service_parameter_list.push_back(dt::ParameterSet(id++, parameter_set));
55 + }
56 + 6 break;
57 + 2 case dt::ServiceCategory::DC_BPT:
58 + 2 res.service = dt::ServiceCategory::DC_BPT;
59 +
+ 2/2 +
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
+
+
4 for (auto& parameter_set : config.dc_bpt_parameter_list) {
60 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 session.offered_services.dc_bpt_parameter_list[id] = parameter_set;
61 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 res.service_parameter_list.push_back(dt::ParameterSet(id++, parameter_set));
62 + }
63 + 2 break;
64 +
65 + 2 case dt::ServiceCategory::Internet:
66 + 2 res.service = dt::ServiceCategory::Internet;
67 +
68 +
+ 2/2 +
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
+
+
4 for (auto& parameter_set : config.internet_parameter_list) {
69 + // TODO(sl): Possibly refactor, define const
70 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (parameter_set.port == dt::Port::Port20) {
71 + id = 1;
72 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 } else if (parameter_set.port == dt::Port::Port21) {
73 + id = 2;
74 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (parameter_set.port == dt::Port::Port80) {
75 + 2 id = 3;
76 + } else if (parameter_set.port == dt::Port::Port443) {
77 + id = 4;
78 + }
79 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 session.offered_services.internet_parameter_list[id] = parameter_set;
80 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 res.service_parameter_list.push_back(dt::ParameterSet(id, parameter_set));
81 + }
82 +
83 + 2 break;
84 +
85 + 2 case dt::ServiceCategory::ParkingStatus:
86 + 2 res.service = dt::ServiceCategory::ParkingStatus;
87 +
88 +
+ 2/2 +
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 2 times.
+
+
+
4 for (auto& parameter_set : config.parking_parameter_list) {
89 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 session.offered_services.parking_parameter_list[id] = parameter_set;
90 +
+ 2/4 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
+
+
2 res.service_parameter_list.push_back(dt::ParameterSet(id++, parameter_set));
91 + }
92 + 2 break;
93 +
94 + default:
95 + // Todo(sl): fill not supported
96 + break;
97 + }
98 +
99 +
+ 1/2 +
+
✓ Branch 2 taken 12 times.
+
✗ Branch 3 not taken.
+
+
+
12 return response_with_code(res, dt::ResponseCode::OK);
100 + 16}
101 +
102 + void ServiceDetail::enter() {
103 + ctx.log.enter_state("ServiceDetail");
104 + }
105 +
106 + FsmSimpleState::HandleEventReturnType ServiceDetail::handle_event(AllocatorType& sa, FsmEvent ev) {
107 +
108 + if (ev != FsmEvent::V2GTP_MESSAGE) {
109 + return sa.PASS_ON;
110 + }
111 +
112 + const auto variant = ctx.pull_request();
113 +
114 + if (const auto req = variant->get_if<message_20::ServiceDetailRequest>()) {
115 + logf_info("Requested info about ServiceID: %d", req->service);
116 +
117 + const auto res = handle_request(*req, ctx.session, ctx.session_config);
118 +
119 + ctx.respond(res);
120 +
121 + if (res.response_code >= dt::ResponseCode::FAILED) {
122 + ctx.session_stopped = true;
123 + return sa.PASS_ON;
124 + }
125 +
126 + return sa.create_simple<ServiceSelection>(ctx);
127 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
128 + const auto res = handle_request(*req, ctx.session);
129 +
130 + ctx.respond(res);
131 + ctx.session_stopped = true;
132 +
133 + return sa.PASS_ON;
134 + } else {
135 + ctx.log("expected ServiceDetailReq! But code type id: %d", variant->get_type());
136 +
137 + // Sequence Error
138 + const message_20::Type req_type = variant->get_type();
139 + send_sequence_error(req_type, ctx);
140 +
141 + ctx.session_stopped = true;
142 + return sa.PASS_ON;
143 + }
144 + }
145 +
146 + } // namespace iso15118::d20::state
147 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.764b98bff39ccb44191e7876cd816174.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.764b98bff39ccb44191e7876cd816174.html new file mode 100644 index 000000000..6836494cb --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.764b98bff39ccb44191e7876cd816174.html @@ -0,0 +1,638 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/service_discovery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:273773.0%
Functions:55100.0%
Branches:71643.8%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/service_discovery.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + 2template <> void convert(const struct iso20_ServiceDiscoveryReqType& in, ServiceDiscoveryRequest& out) {
14 + 2 convert(in.Header, out.header);
15 +
16 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.SupportedServiceIDs_isUsed == true) {
17 + auto& temp = out.supported_service_ids.emplace();
18 + temp.insert(temp.end(), in.SupportedServiceIDs.ServiceID.array,
19 + in.SupportedServiceIDs.ServiceID.array + in.SupportedServiceIDs.ServiceID.arrayLen);
20 + }
21 + 2}
22 +
23 + 2template <> void convert(const ServiceDiscoveryResponse& in, iso20_ServiceDiscoveryResType& out) {
24 + 2 init_iso20_ServiceDiscoveryResType(&out);
25 +
26 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
27 + 2 out.ServiceRenegotiationSupported = in.service_renegotiation_supported;
28 +
29 + 2 uint8_t index = 0;
30 +
+ 2/2 +
+
✓ Branch 4 taken 4 times.
+
✓ Branch 5 taken 2 times.
+
+
+
6 for (auto const& service : in.energy_transfer_service_list) {
31 + 4 auto& out_service = out.EnergyTransferServiceList.Service.array[index++];
32 + 4 cb_convert_enum(service.service_id, out_service.ServiceID);
33 + 4 out_service.FreeService = service.free_service;
34 + }
35 + 2 out.EnergyTransferServiceList.Service.arrayLen = in.energy_transfer_service_list.size();
36 +
37 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (in.vas_list) {
38 + index = 0;
39 + for (auto const& service : *in.vas_list) {
40 + auto& out_service = out.VASList.Service.array[index++];
41 + cb_convert_enum(service.service_id, out_service.ServiceID);
42 + out_service.FreeService = service.free_service;
43 + }
44 + out.VASList.Service.arrayLen = in.vas_list.value().size();
45 + CB_SET_USED(out.VASList);
46 + }
47 +
48 + 2 convert(in.header, out.Header);
49 + 2}
50 +
51 + 2template <> void insert_type(VariantAccess& va, const struct iso20_ServiceDiscoveryReqType& in) {
52 + 2 va.insert_type<ServiceDiscoveryRequest>(in);
53 + 2};
54 +
55 + 2template <> int serialize_to_exi(const ServiceDiscoveryResponse& in, exi_bitstream_t& out) {
56 + iso20_exiDocument doc;
57 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
58 +
59 + 2 CB_SET_USED(doc.ServiceDiscoveryRes);
60 +
61 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.ServiceDiscoveryRes);
62 +
63 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
64 + }
65 +
66 + 2template <> size_t serialize(const ServiceDiscoveryResponse& in, const io::StreamOutputView& out) {
67 + 2 return serialize_helper(in, out);
68 + }
69 +
70 + } // namespace iso15118::message_20
71 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.d1968dcbeb5c6889be60d69278a7b64c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.d1968dcbeb5c6889be60d69278a7b64c.html new file mode 100644 index 000000000..d251cfb7f --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_discovery.cpp.d1968dcbeb5c6889be60d69278a7b64c.html @@ -0,0 +1,1200 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/service_discovery.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:346552.3%
Functions:2450.0%
Branches:3810038.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <algorithm>
4 +
5 + #include <iso15118/d20/state/service_detail.hpp>
6 + #include <iso15118/d20/state/service_discovery.hpp>
7 +
8 + #include <iso15118/detail/helper.hpp>
9 +
10 + #include <iso15118/detail/d20/context_helper.hpp>
11 + #include <iso15118/detail/d20/state/service_discovery.hpp>
12 + #include <iso15118/detail/d20/state/session_stop.hpp>
13 +
14 + namespace iso15118::d20::state {
15 +
16 + namespace dt = message_20::datatypes;
17 +
18 + 6static bool find_service_id(const std::vector<uint16_t>& req_service_ids, const uint16_t service) {
19 +
+ 1/2 +
+
✓ Branch 4 taken 6 times.
+
✗ Branch 5 not taken.
+
+
+
6 return std::find(req_service_ids.begin(), req_service_ids.end(), service) != req_service_ids.end();
20 + }
21 +
22 + 8message_20::ServiceDiscoveryResponse handle_request(const message_20::ServiceDiscoveryRequest& req,
23 + d20::Session& session,
24 + const std::vector<dt::ServiceCategory>& energy_services,
25 + const std::vector<dt::ServiceCategory>& vas_services) {
26 +
27 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 message_20::ServiceDiscoveryResponse res;
28 +
29 +
+ 3/4 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 6 times.
+
+
+
8 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
30 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
31 + }
32 +
33 + // Service renegotiation is not yet supported
34 + 6 res.service_renegotiation_supported = false;
35 + 6 session.service_renegotiation_supported = false;
36 +
37 + // Reset default value
38 + 6 res.energy_transfer_service_list.clear();
39 +
40 + 6 std::vector<dt::Service> energy_services_list;
41 + 6 std::vector<dt::Service> vas_services_list;
42 +
43 + // EV supported service ID's
44 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 4 times.
+
+
+
6 if (req.supported_service_ids.has_value() == true) {
45 +
+ 2/2 +
+
✓ Branch 5 taken 4 times.
+
✓ Branch 6 taken 2 times.
+
+
+
6 for (auto& energy_service : energy_services) {
46 +
+ 4/6 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 4 times.
+
✗ Branch 5 not taken.
+
✓ Branch 6 taken 2 times.
+
✓ Branch 7 taken 2 times.
+
+
+
4 if (find_service_id(req.supported_service_ids.value(), static_cast<uint16_t>(energy_service))) {
47 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 energy_services_list.push_back({energy_service, false});
48 + }
49 + }
50 +
+ 2/2 +
+
✓ Branch 5 taken 2 times.
+
✓ Branch 6 taken 2 times.
+
+
+
4 for (auto& vas_service : vas_services) {
51 +
+ 3/6 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
✓ Branch 7 taken 2 times.
+
+
+
2 if (find_service_id(req.supported_service_ids.value(), static_cast<uint16_t>(vas_service))) {
52 + vas_services_list.push_back({vas_service, false});
53 + }
54 + }
55 + } else {
56 +
+ 2/2 +
+
✓ Branch 4 taken 8 times.
+
✓ Branch 5 taken 4 times.
+
+
+
12 for (auto& energy_service : energy_services) {
57 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 energy_services_list.push_back({energy_service, false});
58 + }
59 +
+ 2/2 +
+
✓ Branch 4 taken 2 times.
+
✓ Branch 5 taken 4 times.
+
+
+
6 for (auto& vas_service : vas_services) {
60 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 vas_services_list.push_back({vas_service, false});
61 + }
62 + }
63 +
64 +
+ 2/2 +
+
✓ Branch 5 taken 10 times.
+
✓ Branch 6 taken 6 times.
+
+
+
16 for (auto& conf_energy_service : energy_services_list) {
65 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 auto& energy_service = res.energy_transfer_service_list.emplace_back();
66 + 10 energy_service = conf_energy_service;
67 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 session.offered_services.energy_services.push_back(conf_energy_service.service_id);
68 + }
69 +
70 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 4 times.
+
+
+
6 if (vas_services_list.empty() == false) {
71 + 2 auto& vas_service_list = res.vas_list.emplace();
72 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 vas_service_list.reserve(vas_services_list.size());
73 +
+ 2/2 +
+
✓ Branch 5 taken 2 times.
+
✓ Branch 6 taken 2 times.
+
+
+
4 for (auto& conf_vas_service : vas_services_list) {
74 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& vas_service = vas_service_list.emplace_back();
75 + 2 vas_service = conf_vas_service;
76 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 session.offered_services.vas_services.push_back(conf_vas_service.service_id);
77 + }
78 + }
79 +
80 +
+ 1/2 +
+
✓ Branch 2 taken 6 times.
+
✗ Branch 3 not taken.
+
+
+
6 return response_with_code(res, dt::ResponseCode::OK);
81 + 8}
82 +
83 + void ServiceDiscovery::enter() {
84 + ctx.log.enter_state("ServiceDiscovery");
85 + }
86 +
87 + FsmSimpleState::HandleEventReturnType ServiceDiscovery::handle_event(AllocatorType& sa, FsmEvent ev) {
88 + if (ev != FsmEvent::V2GTP_MESSAGE) {
89 + return sa.PASS_ON;
90 + }
91 +
92 + const auto variant = ctx.pull_request();
93 +
94 + if (const auto req = variant->get_if<message_20::ServiceDiscoveryRequest>()) {
95 + if (req->supported_service_ids) {
96 + logf_info("Possible ids");
97 + for (auto id : req->supported_service_ids.value()) {
98 + logf_info(" %d", id);
99 + }
100 + }
101 +
102 + const auto res = handle_request(*req, ctx.session, ctx.session_config.supported_energy_transfer_services,
103 + ctx.session_config.supported_vas_services);
104 +
105 + ctx.respond(res);
106 +
107 + if (res.response_code >= dt::ResponseCode::FAILED) {
108 + ctx.session_stopped = true;
109 + return sa.PASS_ON;
110 + }
111 +
112 + return sa.create_simple<ServiceDetail>(ctx);
113 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
114 + const auto res = handle_request(*req, ctx.session);
115 +
116 + ctx.respond(res);
117 + ctx.session_stopped = true;
118 +
119 + return sa.PASS_ON;
120 + } else {
121 + ctx.log("expected ServiceDiscoveryReq! But code type id: %d", variant->get_type());
122 +
123 + // Sequence Error
124 + const message_20::Type req_type = variant->get_type();
125 + send_sequence_error(req_type, ctx);
126 +
127 + ctx.session_stopped = true;
128 + return sa.PASS_ON;
129 + }
130 + }
131 +
132 + } // namespace iso15118::d20::state
133 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.4497fb73fdde99ee31cebb93f89880a5.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.4497fb73fdde99ee31cebb93f89880a5.html new file mode 100644 index 000000000..b8368df62 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.4497fb73fdde99ee31cebb93f89880a5.html @@ -0,0 +1,554 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/service_selection.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:212875.0%
Functions:55100.0%
Branches:41040.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/service_selection.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + 2template <> void convert(const struct iso20_ServiceSelectionReqType& in, ServiceSelectionRequest& out) {
14 + 2 convert(in.Header, out.header);
15 +
16 + 2 cb_convert_enum(in.SelectedEnergyTransferService.ServiceID, out.selected_energy_transfer_service.service_id);
17 + 2 out.selected_energy_transfer_service.parameter_set_id = in.SelectedEnergyTransferService.ParameterSetID;
18 +
19 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.SelectedVASList_isUsed == true) {
20 + out.selected_vas_list.value().reserve(in.SelectedVASList.SelectedService.arrayLen);
21 + auto& vas_list_out = *out.selected_vas_list;
22 +
23 + for (size_t i = 0; i < in.SelectedVASList.SelectedService.arrayLen; i++) {
24 + const auto& item_in = in.SelectedVASList.SelectedService.array[i];
25 + auto& item_out = vas_list_out.emplace_back();
26 +
27 + cb_convert_enum(item_in.ServiceID, item_out.service_id);
28 + item_out.parameter_set_id = item_in.ParameterSetID;
29 + }
30 + }
31 + 2}
32 +
33 + 2template <> void convert(const ServiceSelectionResponse& in, iso20_ServiceSelectionResType& out) {
34 + 2 init_iso20_ServiceSelectionResType(&out);
35 +
36 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
37 +
38 + 2 convert(in.header, out.Header);
39 + 2}
40 +
41 + 2template <> void insert_type(VariantAccess& va, const struct iso20_ServiceSelectionReqType& in) {
42 + 2 va.insert_type<ServiceSelectionRequest>(in);
43 + 2}
44 +
45 + 2template <> int serialize_to_exi(const ServiceSelectionResponse& in, exi_bitstream_t& out) {
46 + iso20_exiDocument doc;
47 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
48 +
49 + 2 CB_SET_USED(doc.ServiceSelectionRes);
50 +
51 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.ServiceSelectionRes);
52 +
53 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
54 + }
55 +
56 + 2template <> size_t serialize(const ServiceSelectionResponse& in, const io::StreamOutputView& out) {
57 + 2 return serialize_helper(in, out);
58 + }
59 +
60 + } // namespace iso15118::message_20
61 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.a706e45f633032e0c5e83aed31b41fc0.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.a706e45f633032e0c5e83aed31b41fc0.html new file mode 100644 index 000000000..e26935afd --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.service_selection.cpp.a706e45f633032e0c5e83aed31b41fc0.html @@ -0,0 +1,1179 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/service_selection.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:346750.7%
Functions:1333.3%
Branches:328239.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/dc_charge_parameter_discovery.hpp>
4 + #include <iso15118/d20/state/service_selection.hpp>
5 +
6 + #include <algorithm>
7 +
8 + #include <iso15118/detail/d20/context_helper.hpp>
9 + #include <iso15118/detail/d20/state/service_detail.hpp>
10 + #include <iso15118/detail/d20/state/service_selection.hpp>
11 + #include <iso15118/detail/d20/state/session_stop.hpp>
12 + #include <iso15118/detail/helper.hpp>
13 +
14 + namespace iso15118::d20::state {
15 +
16 + namespace dt = message_20::datatypes;
17 +
18 + 18message_20::ServiceSelectionResponse handle_request(const message_20::ServiceSelectionRequest& req,
19 + d20::Session& session) {
20 +
21 + 18 message_20::ServiceSelectionResponse res;
22 +
23 +
+ 3/4 +
+
✓ Branch 1 taken 18 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 16 times.
+
+
+
18 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
24 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
25 + }
26 +
27 + 16 bool energy_service_found = false;
28 + 16 bool vas_services_found = false;
29 +
30 +
+ 2/2 +
+
✓ Branch 5 taken 16 times.
+
✓ Branch 6 taken 2 times.
+
+
+
18 for (auto& energy_service : session.offered_services.energy_services) {
31 +
+ 2/2 +
+
✓ Branch 0 taken 14 times.
+
✓ Branch 1 taken 2 times.
+
+
+
16 if (energy_service == req.selected_energy_transfer_service.service_id) {
32 + 14 energy_service_found = true;
33 + 14 break;
34 + }
35 + }
36 +
37 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 14 times.
+
+
+
16 if (!energy_service_found) {
38 + 2 return response_with_code(res, dt::ResponseCode::FAILED_NoEnergyTransferServiceSelected);
39 + }
40 +
41 +
+ 2/2 +
+
✓ Branch 1 taken 6 times.
+
✓ Branch 2 taken 8 times.
+
+
+
14 if (req.selected_vas_list.has_value()) {
42 +
+ 1/2 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
+
+
6 auto& selected_vas_list = req.selected_vas_list.value();
43 +
44 +
+ 2/2 +
+
✓ Branch 4 taken 8 times.
+
✓ Branch 5 taken 4 times.
+
+
+
12 for (auto& vas_service : selected_vas_list) {
45 +
+ 1/2 +
+
✓ Branch 2 taken 8 times.
+
✗ Branch 3 not taken.
+
+
+
8 if (std::find(session.offered_services.vas_services.begin(), session.offered_services.vas_services.end(),
46 +
+ 2/2 +
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 6 times.
+
+
+
16 vas_service.service_id) == session.offered_services.vas_services.end()) {
47 + 2 vas_services_found = false;
48 + 2 break;
49 + }
50 + 6 vas_services_found = true;
51 + }
52 +
53 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 4 times.
+
+
+
6 if (not vas_services_found) {
54 + 2 return response_with_code(res, dt::ResponseCode::FAILED_ServiceSelectionInvalid);
55 + }
56 + }
57 +
58 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 10 times.
+
+
+
12 if (not session.find_parameter_set_id(req.selected_energy_transfer_service.service_id,
59 +
+ 1/2 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
+
+
12 req.selected_energy_transfer_service.parameter_set_id)) {
60 + 2 return response_with_code(res, dt::ResponseCode::FAILED_ServiceSelectionInvalid);
61 + }
62 +
63 + 10 session.selected_service_parameters(req.selected_energy_transfer_service.service_id,
64 +
+ 1/2 +
+
✓ Branch 1 taken 10 times.
+
✗ Branch 2 not taken.
+
+
+
10 req.selected_energy_transfer_service.parameter_set_id);
65 +
66 +
+ 2/2 +
+
✓ Branch 1 taken 4 times.
+
✓ Branch 2 taken 6 times.
+
+
+
10 if (req.selected_vas_list.has_value()) {
67 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 auto& selected_vas_list = req.selected_vas_list.value();
68 +
69 +
+ 2/2 +
+
✓ Branch 5 taken 6 times.
+
✓ Branch 6 taken 2 times.
+
+
+
8 for (auto& vas_service : selected_vas_list) {
70 +
+ 3/4 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 4 times.
+
+
+
6 if (not session.find_parameter_set_id(vas_service.service_id, vas_service.parameter_set_id)) {
71 + 2 return response_with_code(res, dt::ResponseCode::FAILED_ServiceSelectionInvalid);
72 + }
73 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 session.selected_service_parameters(vas_service.service_id, vas_service.parameter_set_id);
74 + }
75 + }
76 +
77 + 8 return response_with_code(res, dt::ResponseCode::OK);
78 + }
79 +
80 + void ServiceSelection::enter() {
81 + ctx.log.enter_state("ServiceSelection");
82 + }
83 +
84 + FsmSimpleState::HandleEventReturnType ServiceSelection::handle_event(AllocatorType& sa, FsmEvent ev) {
85 +
86 + if (ev != FsmEvent::V2GTP_MESSAGE) {
87 + return sa.PASS_ON;
88 + }
89 +
90 + const auto variant = ctx.pull_request();
91 +
92 + if (const auto req = variant->get_if<message_20::ServiceDetailRequest>()) {
93 + logf_info("Requested info about ServiceID: %d", req->service);
94 +
95 + const auto res = handle_request(*req, ctx.session, ctx.session_config);
96 +
97 + ctx.respond(res);
98 +
99 + if (res.response_code >= dt::ResponseCode::FAILED) {
100 + ctx.session_stopped = true;
101 + return sa.PASS_ON;
102 + }
103 +
104 + return sa.HANDLED_INTERNALLY;
105 + } else if (const auto req = variant->get_if<message_20::ServiceSelectionRequest>()) {
106 + const auto res = handle_request(*req, ctx.session);
107 +
108 + ctx.respond(res);
109 +
110 + if (res.response_code >= dt::ResponseCode::FAILED) {
111 + ctx.session_stopped = true;
112 + return sa.PASS_ON;
113 + }
114 +
115 + return sa.create_simple<DC_ChargeParameterDiscovery>(ctx);
116 + } else if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
117 + const auto res = handle_request(*req, ctx.session);
118 +
119 + ctx.respond(res);
120 + ctx.session_stopped = true;
121 +
122 + return sa.PASS_ON;
123 + } else {
124 + ctx.log("expected ServiceDetailReq! But code type id: %d", variant->get_type());
125 +
126 + // Sequence Error
127 + const message_20::Type req_type = variant->get_type();
128 + send_sequence_error(req_type, ctx);
129 +
130 + ctx.session_stopped = true;
131 + return sa.PASS_ON;
132 + }
133 + }
134 +
135 + } // namespace iso15118::d20::state
136 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.cpp.9632d6c8410e7ed1dda8e96b4e0c804e.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.cpp.9632d6c8410e7ed1dda8e96b4e0c804e.html new file mode 100644 index 000000000..7a4fa47b6 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.cpp.9632d6c8410e7ed1dda8e96b4e0c804e.html @@ -0,0 +1,1416 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/session.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:728386.7%
Functions:5683.3%
Branches:5410650.9%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/session.hpp>
4 +
5 + #include <random>
6 +
7 + #include <iso15118/detail/helper.hpp>
8 +
9 + namespace iso15118::d20 {
10 +
11 + namespace dt = message_20::datatypes;
12 +
13 + 118Session::Session() {
14 +
+ 1/2 +
+
✓ Branch 1 taken 118 times.
+
✗ Branch 2 not taken.
+
+
+
118 std::random_device rd;
15 +
+ 2/4 +
+
✓ Branch 1 taken 118 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 118 times.
+
✗ Branch 5 not taken.
+
+
+
118 std::mt19937 generator(rd());
16 +
+ 1/2 +
+
✓ Branch 1 taken 118 times.
+
✗ Branch 2 not taken.
+
+
+
118 std::uniform_int_distribution<uint8_t> distribution(0x00, 0xff);
17 +
18 +
+ 2/2 +
+
✓ Branch 0 taken 944 times.
+
✓ Branch 1 taken 118 times.
+
+
+
1062 for (auto& item : id) {
19 +
+ 1/2 +
+
✓ Branch 1 taken 944 times.
+
✗ Branch 2 not taken.
+
+
+
944 item = distribution(generator);
20 + }
21 + 118}
22 +
23 + 32Session::Session(SelectedServiceParameters service_parameters_) : selected_services(service_parameters_) {
24 +
+ 1/2 +
+
✓ Branch 1 taken 32 times.
+
✗ Branch 2 not taken.
+
+
+
32 std::random_device rd;
25 +
+ 2/4 +
+
✓ Branch 1 taken 32 times.
+
✗ Branch 2 not taken.
+
✓ Branch 4 taken 32 times.
+
✗ Branch 5 not taken.
+
+
+
32 std::mt19937 generator(rd());
26 +
+ 1/2 +
+
✓ Branch 1 taken 32 times.
+
✗ Branch 2 not taken.
+
+
+
32 std::uniform_int_distribution<uint8_t> distribution(0x00, 0xff);
27 +
28 +
+ 2/2 +
+
✓ Branch 0 taken 256 times.
+
✓ Branch 1 taken 32 times.
+
+
+
288 for (auto& item : id) {
29 +
+ 1/2 +
+
✓ Branch 1 taken 256 times.
+
✗ Branch 2 not taken.
+
+
+
256 item = distribution(generator);
30 + }
31 + 32}
32 + Session::Session(OfferedServices services_) : offered_services(services_) {
33 + std::random_device rd;
34 + std::mt19937 generator(rd());
35 + std::uniform_int_distribution<uint8_t> distribution(0x00, 0xff);
36 +
37 + for (auto& item : id) {
38 + item = distribution(generator);
39 + }
40 + }
41 +
42 + 150Session::~Session() = default;
43 +
44 + 18bool Session::find_parameter_set_id(const dt::ServiceCategory service, int16_t id) {
45 +
46 +
+ 4/5 +
+
✓ Branch 0 taken 10 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 4 times.
+
✓ Branch 3 taken 2 times.
+
✗ Branch 4 not taken.
+
+
+
18 switch (service) {
47 + 10 case dt::ServiceCategory::DC:
48 +
49 +
+ 3/4 +
+
✓ Branch 2 taken 10 times.
+
✗ Branch 3 not taken.
+
✓ Branch 5 taken 8 times.
+
✓ Branch 6 taken 2 times.
+
+
+
10 if (this->offered_services.dc_parameter_list.find(id) != this->offered_services.dc_parameter_list.end()) {
50 + 8 return true;
51 + }
52 + 2 break;
53 +
54 + 2 case dt::ServiceCategory::DC_BPT:
55 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (this->offered_services.dc_bpt_parameter_list.find(id) !=
56 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 this->offered_services.dc_bpt_parameter_list.end()) {
57 + 2 return true;
58 + }
59 + break;
60 +
61 + 4 case dt::ServiceCategory::Internet:
62 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 if (this->offered_services.internet_parameter_list.find(id) !=
63 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
+
+
8 this->offered_services.internet_parameter_list.end()) {
64 + 2 return true;
65 + }
66 + 2 break;
67 +
68 + 2 case dt::ServiceCategory::ParkingStatus:
69 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (this->offered_services.parking_parameter_list.find(id) !=
70 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 this->offered_services.parking_parameter_list.end()) {
71 + 2 return true;
72 + }
73 +
74 + default:
75 + // Todo(sl): logf AC, WPT, ACDP is not supported
76 + break;
77 + }
78 +
79 + 4 return false;
80 + }
81 +
82 + 14void Session::selected_service_parameters(const dt::ServiceCategory service, const uint16_t id) {
83 +
84 +
+ 4/5 +
+
✓ Branch 0 taken 8 times.
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
✓ Branch 3 taken 2 times.
+
✗ Branch 4 not taken.
+
+
+
14 switch (service) {
85 + 8 case dt::ServiceCategory::DC:
86 +
87 +
+ 2/4 +
+
✓ Branch 2 taken 8 times.
+
✗ Branch 3 not taken.
+
✓ Branch 5 taken 8 times.
+
✗ Branch 6 not taken.
+
+
+
8 if (this->offered_services.dc_parameter_list.find(id) != this->offered_services.dc_parameter_list.end()) {
88 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 auto& parameters = this->offered_services.dc_parameter_list.at(id);
89 + 8 this->selected_services =
90 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
8 SelectedServiceParameters(dt::ServiceCategory::DC, parameters.connector, parameters.control_mode,
91 + parameters.mobility_needs_mode, parameters.pricing);
92 +
93 +
+ 1/2 +
+
✓ Branch 3 taken 8 times.
+
✗ Branch 4 not taken.
+
+
+
16 logf_info("Selected DC service parameters: control mode: %s, mobility needs mode: %s",
94 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
16 dt::from_control_mode(parameters.control_mode).c_str(),
95 +
+ 1/2 +
+
✓ Branch 1 taken 8 times.
+
✗ Branch 2 not taken.
+
+
+
16 dt::from_mobility_needs_mode(parameters.mobility_needs_mode).c_str());
96 + } else {
97 + // Todo(sl): Should be not the case -> Raise Error?
98 + }
99 + 8 break;
100 +
101 + 2 case dt::ServiceCategory::DC_BPT:
102 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (this->offered_services.dc_bpt_parameter_list.find(id) !=
103 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 this->offered_services.dc_bpt_parameter_list.end()) {
104 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& parameters = this->offered_services.dc_bpt_parameter_list.at(id);
105 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 this->selected_services = SelectedServiceParameters(
106 + dt::ServiceCategory::DC_BPT, parameters.connector, parameters.control_mode,
107 + parameters.mobility_needs_mode, parameters.pricing, parameters.bpt_channel, parameters.generator_mode);
108 +
109 +
+ 1/2 +
+
✓ Branch 3 taken 2 times.
+
✗ Branch 4 not taken.
+
+
+
4 logf_info("Selected DC_BPT service parameters: control mode: %s, mobility needs mode: %s",
110 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 dt::from_control_mode(parameters.control_mode).c_str(),
111 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 dt::from_mobility_needs_mode(parameters.mobility_needs_mode).c_str());
112 + } else {
113 + // Todo(sl): Should be not the case -> Raise Error?
114 + }
115 + 2 break;
116 +
117 + 2 case dt::ServiceCategory::Internet:
118 +
119 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (this->offered_services.internet_parameter_list.find(id) !=
120 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 this->offered_services.internet_parameter_list.end()) {
121 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 this->selected_vas_services.vas_services.push_back(dt::ServiceCategory::Internet);
122 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& parameters = this->offered_services.internet_parameter_list.at(id);
123 + 2 this->selected_vas_services.internet_port = parameters.port;
124 + 2 this->selected_vas_services.internet_protocol = parameters.protocol;
125 + }
126 + 2 break;
127 +
128 + 2 case dt::ServiceCategory::ParkingStatus:
129 +
130 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 if (this->offered_services.parking_parameter_list.find(id) !=
131 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 this->offered_services.parking_parameter_list.end()) {
132 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 this->selected_vas_services.vas_services.push_back(dt::ServiceCategory::ParkingStatus);
133 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto& parameters = this->offered_services.parking_parameter_list.at(id);
134 + 2 this->selected_vas_services.parking_intended_service = parameters.intended_service;
135 + 2 this->selected_vas_services.parking_status = parameters.parking_status;
136 + }
137 + 2 break;
138 +
139 + default:
140 + // Todo(sl): logf AC, WPT, ACDP is not supported
141 + break;
142 + }
143 + 14}
144 +
145 + } // namespace iso15118::d20
146 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.hpp.965312f541611d2c59c62940edd7b84e.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.hpp.965312f541611d2c59c62940edd7b84e.html new file mode 100644 index 000000000..6dec931d7 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session.hpp.965312f541611d2c59c62940edd7b84e.html @@ -0,0 +1,918 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/d20/session.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:212391.3%
Functions:4580.0%
Branches:00-%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <array>
6 + #include <cstdint>
7 + #include <map>
8 + #include <variant>
9 + #include <vector>
10 +
11 + #include <iso15118/message/common_types.hpp>
12 +
13 + namespace iso15118::d20 {
14 +
15 + struct OfferedServices {
16 +
17 + std::vector<message_20::datatypes::Authorization> auth_services;
18 + std::vector<message_20::datatypes::ServiceCategory> energy_services;
19 + std::vector<message_20::datatypes::ServiceCategory> vas_services;
20 +
21 + std::map<uint8_t, message_20::datatypes::DcParameterList> dc_parameter_list;
22 + std::map<uint8_t, message_20::datatypes::DcBptParameterList> dc_bpt_parameter_list;
23 + std::map<uint8_t, message_20::datatypes::InternetParameterList> internet_parameter_list;
24 + std::map<uint8_t, message_20::datatypes::ParkingParameterList> parking_parameter_list;
25 + };
26 +
27 + struct SelectedServiceParameters {
28 +
29 + message_20::datatypes::ServiceCategory selected_energy_service;
30 +
31 + std::variant<message_20::datatypes::AcConnector, message_20::datatypes::DcConnector> selected_connector;
32 + message_20::datatypes::ControlMode selected_control_mode;
33 + message_20::datatypes::MobilityNeedsMode selected_mobility_needs_mode;
34 + message_20::datatypes::Pricing selected_pricing;
35 +
36 + message_20::datatypes::BptChannel selected_bpt_channel;
37 + message_20::datatypes::GeneratorMode selected_generator_mode;
38 +
39 + 118 SelectedServiceParameters(){}; // TODO(sl): What to do here?
40 + // Constructor for DC
41 + 8 SelectedServiceParameters(message_20::datatypes::ServiceCategory energy_service_,
42 + message_20::datatypes::DcConnector dc_connector_,
43 + message_20::datatypes::ControlMode control_mode_,
44 + message_20::datatypes::MobilityNeedsMode mobility_,
45 + 8 message_20::datatypes::Pricing pricing_) :
46 + 8 selected_energy_service(energy_service_),
47 + 8 selected_control_mode(control_mode_),
48 + 8 selected_mobility_needs_mode(mobility_),
49 + 8 selected_pricing(pricing_) {
50 + 8 selected_connector.emplace<message_20::datatypes::DcConnector>(dc_connector_);
51 + 8 };
52 +
53 + // Constructor for DC_BPT
54 + 2 SelectedServiceParameters(message_20::datatypes::ServiceCategory energy_service_,
55 + message_20::datatypes::DcConnector dc_connector_,
56 + message_20::datatypes::ControlMode control_mode_,
57 + message_20::datatypes::MobilityNeedsMode mobility_,
58 + message_20::datatypes::Pricing pricing_, message_20::datatypes::BptChannel channel_,
59 + 2 message_20::datatypes::GeneratorMode generator_) :
60 + 2 selected_energy_service(energy_service_),
61 + 2 selected_control_mode(control_mode_),
62 + 2 selected_mobility_needs_mode(mobility_),
63 + 2 selected_pricing(pricing_),
64 + 2 selected_bpt_channel(channel_),
65 + 2 selected_generator_mode(generator_) {
66 + 2 selected_connector.emplace<message_20::datatypes::DcConnector>(dc_connector_);
67 + 2 };
68 + };
69 +
70 + struct SelectedVasParameter {
71 + std::vector<message_20::datatypes::ServiceCategory> vas_services;
72 +
73 + message_20::datatypes::Protocol internet_protocol;
74 + message_20::datatypes::Port internet_port;
75 +
76 + message_20::datatypes::IntendedService parking_intended_service;
77 + message_20::datatypes::ParkingStatus parking_status;
78 + };
79 +
80 + class Session {
81 +
82 + // todo(sl): move to a common defs file
83 + static constexpr auto ID_LENGTH = 8;
84 +
85 + public:
86 + Session();
87 + Session(SelectedServiceParameters);
88 + Session(OfferedServices);
89 +
90 + std::array<uint8_t, ID_LENGTH> get_id() const {
91 + return id;
92 + }
93 +
94 + bool find_parameter_set_id(const message_20::datatypes::ServiceCategory service, int16_t id);
95 +
96 + void selected_service_parameters(const message_20::datatypes::ServiceCategory service, const uint16_t id);
97 +
98 + 32 auto get_selected_services() const& {
99 + 32 return selected_services;
100 + }
101 +
102 + ~Session();
103 +
104 + OfferedServices offered_services;
105 +
106 + bool service_renegotiation_supported{false};
107 +
108 + private:
109 + // NOTE (aw): could be const
110 + std::array<uint8_t, ID_LENGTH> id{};
111 +
112 + SelectedServiceParameters selected_services;
113 + SelectedVasParameter selected_vas_services;
114 + };
115 +
116 + } // namespace iso15118::d20
117 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.a9b0b9ecd6120cd5aefbfa1852c2ad67.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.a9b0b9ecd6120cd5aefbfa1852c2ad67.html new file mode 100644 index 000000000..8eac75249 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.a9b0b9ecd6120cd5aefbfa1852c2ad67.html @@ -0,0 +1,493 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/session_setup.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:2020100.0%
Functions:55100.0%
Branches:51241.7%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/session_setup.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Datatypes.h>
10 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + //
15 + // conversions
16 + //
17 + 2template <> void convert(const struct iso20_SessionSetupReqType& in, SessionSetupRequest& out) {
18 + 2 convert(in.Header, out.header);
19 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 out.evccid = CB2CPP_STRING(in.EVCCID);
20 + 2}
21 +
22 + 2template <> void convert(const SessionSetupResponse& in, iso20_SessionSetupResType& out) {
23 + 2 init_iso20_SessionSetupResType(&out);
24 +
25 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
26 +
27 +
+ 1/4 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
+
+
2 CPP2CB_STRING(in.evseid, out.EVSEID);
28 +
29 + 2 convert(in.header, out.Header);
30 + 2}
31 +
32 + 2template <> void insert_type(VariantAccess& va, const struct iso20_SessionSetupReqType& in) {
33 + 2 va.insert_type<SessionSetupRequest>(in);
34 + 2};
35 +
36 + 2template <> int serialize_to_exi(const SessionSetupResponse& in, exi_bitstream_t& out) {
37 + iso20_exiDocument doc;
38 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
39 + 2 CB_SET_USED(doc.SessionSetupRes);
40 +
41 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.SessionSetupRes);
42 +
43 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
44 + }
45 +
46 + 2template <> size_t serialize(const SessionSetupResponse& in, const io::StreamOutputView& out) {
47 + 2 return serialize_helper(in, out);
48 + }
49 +
50 + } // namespace iso15118::message_20
51 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.d64c55f2c033bd841d1e6911ad5297f8.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.d64c55f2c033bd841d1e6911ad5297f8.html new file mode 100644 index 000000000..dbbf5292e --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_setup.cpp.d64c55f2c033bd841d1e6911ad5297f8.html @@ -0,0 +1,708 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/session_setup.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0370.0%
Functions:050.0%
Branches:0560.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <algorithm>
4 +
5 + #include <iso15118/d20/state/authorization_setup.hpp>
6 + #include <iso15118/d20/state/session_setup.hpp>
7 +
8 + #include <iso15118/detail/d20/context_helper.hpp>
9 + #include <iso15118/detail/d20/state/session_setup.hpp>
10 + #include <iso15118/detail/helper.hpp>
11 +
12 + static bool session_is_zero(const iso15118::message_20::Header& header) {
13 + return std::all_of(header.session_id.begin(), header.session_id.end(), [](int i) { return i == 0; });
14 + }
15 +
16 + namespace iso15118::d20::state {
17 +
18 + namespace dt = message_20::datatypes;
19 +
20 + message_20::SessionSetupResponse handle_request([[maybe_unused]] const message_20::SessionSetupRequest& req,
21 + const d20::Session& session, const std::string& evse_id,
22 + bool new_session) {
23 +
24 + message_20::SessionSetupResponse res;
25 + // FIXME(sl): Check req
26 + setup_header(res.header, session);
27 +
28 + res.evseid = evse_id;
29 +
30 + if (new_session) {
31 + return response_with_code(res, dt::ResponseCode::OK_NewSessionEstablished);
32 + } else {
33 + return response_with_code(res, dt::ResponseCode::OK_OldSessionJoined);
34 + }
35 + }
36 +
37 + void SessionSetup::enter() {
38 + ctx.log.enter_state("SessionSetup");
39 + }
40 +
41 + FsmSimpleState::HandleEventReturnType SessionSetup::handle_event(AllocatorType& sa, FsmEvent ev) {
42 +
43 + if (ev != FsmEvent::V2GTP_MESSAGE) {
44 + return sa.PASS_ON;
45 + }
46 +
47 + const auto variant = ctx.pull_request();
48 +
49 + if (const auto req = variant->get_if<message_20::SessionSetupRequest>()) {
50 +
51 + logf_info("Received session setup with evccid: %s", req->evccid.c_str());
52 + ctx.feedback.evcc_id(req->evccid);
53 +
54 + bool new_session{true};
55 +
56 + if (session_is_zero(req->header)) {
57 + ctx.session = Session();
58 + } else if (req->header.session_id == ctx.session.get_id()) {
59 + new_session = false;
60 + } else {
61 + ctx.session = Session();
62 + }
63 +
64 + evse_id = ctx.session_config.evse_id;
65 +
66 + const auto res = handle_request(*req, ctx.session, evse_id, new_session);
67 +
68 + ctx.respond(res);
69 +
70 + return sa.create_simple<AuthorizationSetup>(ctx);
71 +
72 + // Todo(sl): Going straight to ChargeParameterDiscovery?
73 +
74 + } else {
75 + ctx.log("expected SessionSetupReq! But code type id: %d", variant->get_type());
76 +
77 + // Sequence Error
78 + const message_20::Type req_type = variant->get_type();
79 + send_sequence_error(req_type, ctx);
80 +
81 + ctx.session_stopped = true;
82 + return sa.PASS_ON;
83 + }
84 + }
85 +
86 + } // namespace iso15118::d20::state
87 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.2452f54117a25a4c8891f2611dc56828.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.2452f54117a25a4c8891f2611dc56828.html new file mode 100644 index 000000000..60b653a99 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.2452f54117a25a4c8891f2611dc56828.html @@ -0,0 +1,638 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/session_stop.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:103033.3%
Functions:1333.3%
Branches:84219.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/session_stop.hpp>
4 +
5 + #include <iso15118/detail/d20/context_helper.hpp>
6 + #include <iso15118/detail/d20/state/session_stop.hpp>
7 + #include <iso15118/detail/helper.hpp>
8 +
9 + namespace iso15118::d20::state {
10 +
11 + namespace dt = message_20::datatypes;
12 +
13 + 6message_20::SessionStopResponse handle_request(const message_20::SessionStopRequest& req, const d20::Session& session) {
14 +
15 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 6 times.
+
+
+
6 if (req.ev_termination_code.has_value()) {
16 + logf_info("EV termination code: %s", req.ev_termination_code.value().c_str());
17 + }
18 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 6 times.
+
+
+
6 if (req.ev_termination_explanation.has_value()) {
19 + logf_info("EV Termination explanation: %s", req.ev_termination_explanation.value().c_str());
20 + }
21 +
22 + 6 message_20::SessionStopResponse res;
23 +
24 +
+ 3/4 +
+
✓ Branch 1 taken 6 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 2 times.
+
✓ Branch 4 taken 4 times.
+
+
+
6 if (validate_and_setup_header(res.header, session, req.header.session_id) == false) {
25 + 2 return response_with_code(res, dt::ResponseCode::FAILED_UnknownSession);
26 + }
27 +
28 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 if (req.charging_session == dt::ChargingSession::ServiceRenegotiation &&
29 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 session.service_renegotiation_supported == false) {
30 + 2 return response_with_code(res, dt::ResponseCode::FAILED_NoServiceRenegotiationSupported);
31 + }
32 +
33 + // Todo(sl): Check req.charging_session
34 +
35 + 2 return response_with_code(res, dt::ResponseCode::OK);
36 + }
37 +
38 + void SessionStop::enter() {
39 + ctx.log.enter_state("SessionStop");
40 + }
41 +
42 + FsmSimpleState::HandleEventReturnType SessionStop::handle_event(AllocatorType& sa, FsmEvent ev) {
43 +
44 + if (ev != FsmEvent::V2GTP_MESSAGE) {
45 + return sa.PASS_ON;
46 + }
47 +
48 + const auto variant = ctx.pull_request();
49 +
50 + if (const auto req = variant->get_if<message_20::SessionStopRequest>()) {
51 + const auto res = handle_request(*req, ctx.session);
52 +
53 + ctx.respond(res);
54 +
55 + // Todo(sl): Tell the reason why the charger is stopping. Shutdown, Error, etc.
56 + ctx.session_stopped = true;
57 +
58 + return sa.PASS_ON;
59 + } else {
60 + ctx.log("expected SessionStop! But code type id: %d", variant->get_type());
61 +
62 + // Sequence Error
63 + const message_20::Type req_type = variant->get_type();
64 + send_sequence_error(req_type, ctx);
65 +
66 + ctx.session_stopped = true;
67 + return sa.PASS_ON;
68 + }
69 + }
70 +
71 + } // namespace iso15118::d20::state
72 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.8196559bab5822c197b34c98bed0da2e.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.8196559bab5822c197b34c98bed0da2e.html new file mode 100644 index 000000000..cab27192b --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.session_stop.cpp.8196559bab5822c197b34c98bed0da2e.html @@ -0,0 +1,491 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/session_stop.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:212391.3%
Functions:55100.0%
Branches:51435.7%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/session_stop.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/variant_access.hpp>
8 +
9 + #include <cbv2g/iso_20/iso20_CommonMessages_Encoder.h>
10 +
11 + namespace iso15118::message_20 {
12 +
13 + 2template <> void convert(const struct iso20_SessionStopReqType& in, SessionStopRequest& out) {
14 + 2 convert(in.Header, out.header);
15 +
16 + 2 cb_convert_enum(in.ChargingSession, out.charging_session);
17 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.EVTerminationCode_isUsed) {
18 + out.ev_termination_code = CB2CPP_STRING(in.EVTerminationCode);
19 + }
20 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (in.EVTerminationExplanation_isUsed) {
21 + out.ev_termination_explanation = CB2CPP_STRING(in.EVTerminationExplanation);
22 + }
23 + 2}
24 +
25 + 2template <> void insert_type(VariantAccess& va, const struct iso20_SessionStopReqType& in) {
26 + 2 va.insert_type<SessionStopRequest>(in);
27 + 2}
28 +
29 + 2template <> void convert(const SessionStopResponse& in, struct iso20_SessionStopResType& out) {
30 + 2 init_iso20_SessionStopResType(&out);
31 + 2 convert(in.header, out.Header);
32 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
33 + 2}
34 +
35 + 2template <> int serialize_to_exi(const SessionStopResponse& in, exi_bitstream_t& out) {
36 + iso20_exiDocument doc;
37 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_iso20_exiDocument(&doc);
38 +
39 + 2 CB_SET_USED(doc.SessionStopRes);
40 +
41 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.SessionStopRes);
42 +
43 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_iso20_exiDocument(&out, &doc);
44 + }
45 +
46 + 2template <> size_t serialize(const SessionStopResponse& in, const io::StreamOutputView& out) {
47 + 2 return serialize_helper(in, out);
48 + }
49 +
50 + } // namespace iso15118::message_20
51 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.socket_helper.cpp.f87f24b157efa97e663d931e63eb07a6.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.socket_helper.cpp.f87f24b157efa97e663d931e63eb07a6.html new file mode 100644 index 000000000..d9533d9a8 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.socket_helper.cpp.f87f24b157efa97e663d931e63eb07a6.html @@ -0,0 +1,1015 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/io/socket_helper.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0560.0%
Functions:040.0%
Branches:0580.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/detail/io/socket_helper.hpp>
4 +
5 + #include <cstring>
6 +
7 + #include <arpa/inet.h>
8 + #include <ifaddrs.h>
9 + #include <net/if.h>
10 + #include <netdb.h>
11 + #include <netinet/in.h>
12 +
13 + #include <iso15118/detail/helper.hpp>
14 +
15 + namespace iso15118::io {
16 +
17 + namespace {
18 +
19 + auto choose_first_ipv6_interface() {
20 + std::string interface_name{};
21 + struct ifaddrs* if_list_head;
22 + const auto get_if_addrs_result = getifaddrs(&if_list_head);
23 +
24 + if (get_if_addrs_result == -1) {
25 + logf_error("Failed to call getifaddrs");
26 + return std::string("");
27 + }
28 +
29 + for (auto current_if = if_list_head; current_if != nullptr; current_if = current_if->ifa_next) {
30 + if (current_if->ifa_addr == nullptr or current_if->ifa_addr->sa_family != AF_INET6) {
31 + continue;
32 + }
33 +
34 + // NOTE (aw): because we did the check for AF_INET6, we can assume that ifa_addr is indeed an sockaddr_in6
35 + const auto current_addr = reinterpret_cast<const sockaddr_in6*>(current_if->ifa_addr);
36 + if (not IN6_IS_ADDR_LINKLOCAL(&(current_addr->sin6_addr))) {
37 + continue;
38 + }
39 + interface_name = current_if->ifa_name;
40 + break; // Stop the loop if a interface is found
41 + }
42 + freeifaddrs(if_list_head);
43 +
44 + return interface_name;
45 + }
46 +
47 + } // namespace
48 +
49 + bool check_and_update_interface(std::string& interface_name) {
50 +
51 + if (interface_name == "auto") {
52 + logf_info("Search for the first available ipv6 interface");
53 + interface_name = choose_first_ipv6_interface();
54 + }
55 +
56 + struct ipv6_mreq mreq {};
57 + mreq.ipv6mr_interface = if_nametoindex(interface_name.c_str());
58 + if (!mreq.ipv6mr_interface) {
59 + logf_error("No such interface: %s", interface_name.c_str());
60 + return false;
61 + }
62 + return not interface_name.empty();
63 + }
64 +
65 + bool get_first_sockaddr_in6_for_interface(const std::string& interface_name, sockaddr_in6& address) {
66 + struct ifaddrs* if_list_head;
67 + const auto get_if_addrs_result = getifaddrs(&if_list_head);
68 +
69 + if (get_if_addrs_result == -1) {
70 + log_and_throw("Failed to call getifaddrs");
71 + }
72 +
73 + bool found_interface = false;
74 +
75 + for (auto current_if = if_list_head; current_if != nullptr; current_if = current_if->ifa_next) {
76 + if (current_if->ifa_addr == nullptr) {
77 + continue;
78 + }
79 +
80 + if (current_if->ifa_addr->sa_family != AF_INET6) {
81 + continue;
82 + }
83 +
84 + if (interface_name.compare("auto") != 0 && interface_name.compare(current_if->ifa_name) != 0) {
85 + continue;
86 + }
87 +
88 + // NOTE (aw): because we did the check for AF_INET6, we can assume that ifa_addr is indeed an sockaddr_in6
89 + const auto current_addr = reinterpret_cast<const sockaddr_in6*>(current_if->ifa_addr);
90 +
91 + // NOTE (sl): If using loopback device, accept any address. Loopback usually does not have a link local address
92 + if (interface_name.compare("lo") != 0 and not IN6_IS_ADDR_LINKLOCAL(&(current_addr->sin6_addr))) {
93 + continue;
94 + }
95 +
96 + if (interface_name == "auto") {
97 + logf_info("Found an ipv6 link local address for interface: %s", current_if->ifa_name);
98 + }
99 +
100 + memcpy(&address, current_addr, sizeof(address));
101 + found_interface = true;
102 + break; // Stop the loop if a interface is found
103 + }
104 +
105 + freeifaddrs(if_list_head);
106 +
107 + // Todo(sl): What to do if interface was not found?
108 + return found_interface;
109 + }
110 +
111 + std::unique_ptr<char[]> sockaddr_in6_to_name(const sockaddr_in6& address) {
112 + // account for ipv6 address string length plus possible scope/zone
113 + // identifier which seems to be an interface name, as both constants
114 + // (INET6_ADDRSTRLEN and IFNAMSIZ) include the terminating NULL, we
115 + // have one extra character that can account for the separating '%'
116 + // between the ipv6 address and the scope/zone identifier
117 + static constexpr auto MAX_NUMERIC_NAME_LENGTH = INET6_ADDRSTRLEN + IFNAMSIZ;
118 + auto name = std::make_unique<char[]>(MAX_NUMERIC_NAME_LENGTH);
119 +
120 + // FIXME (aw): what about alignment issues here between casting from sockaddr_in6 to sockaddr?
121 + const auto result = getnameinfo(reinterpret_cast<const sockaddr*>(&address), sizeof(address), name.get(),
122 + MAX_NUMERIC_NAME_LENGTH, nullptr, 0, NI_NUMERICHOST);
123 +
124 + if (result == 0) {
125 + return name;
126 + } else {
127 + return nullptr;
128 + }
129 + }
130 + } // namespace iso15118::io
131 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.5c75155236c2e51a5114968661fc18a2.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.5c75155236c2e51a5114968661fc18a2.html new file mode 100644 index 000000000..970aae84d --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.5c75155236c2e51a5114968661fc18a2.html @@ -0,0 +1,846 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/supported_app_protocol.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:454991.8%
Functions:7887.5%
Branches:132454.2%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/supported_app_protocol.hpp>
4 +
5 + #include <type_traits>
6 +
7 + #include <iso15118/detail/cb_exi.hpp>
8 + #include <iso15118/detail/variant_access.hpp>
9 +
10 + #include <cbv2g/app_handshake/appHand_Encoder.h>
11 +
12 + namespace iso15118::message_20 {
13 +
14 + 4template <> void convert(const struct appHand_supportedAppProtocolReq& in, SupportedAppProtocolRequest& out) {
15 + 4 const auto& ap_in = in.AppProtocol;
16 + 4 out.app_protocol.reserve(ap_in.arrayLen);
17 +
18 +
+ 2/2 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 4 times.
+
+
+
8 for (size_t i = 0; i < ap_in.arrayLen; ++i) {
19 + 4 const auto& item_in = ap_in.array[i];
20 + 4 auto& item_out = out.app_protocol.emplace_back();
21 +
22 +
+ 1/2 +
+
✓ Branch 2 taken 4 times.
+
✗ Branch 3 not taken.
+
+
+
4 item_out.protocol_namespace = CB2CPP_STRING(item_in.ProtocolNamespace);
23 + 4 item_out.version_number_major = item_in.VersionNumberMajor;
24 + 4 item_out.version_number_minor = item_in.VersionNumberMinor;
25 + 4 item_out.schema_id = item_in.SchemaID;
26 + 4 item_out.priority = item_in.Priority;
27 + }
28 + 4}
29 +
30 + 2template <> void convert(const SupportedAppProtocolRequest& in, struct appHand_supportedAppProtocolReq& out) {
31 + 2 init_appHand_supportedAppProtocolReq(&out);
32 +
33 + 2 auto& ap_out = out.AppProtocol;
34 + // FIXME (aw): check size constraints
35 + 2 ap_out.arrayLen = in.app_protocol.size();
36 +
37 +
+ 2/2 +
+
✓ Branch 1 taken 2 times.
+
✓ Branch 2 taken 2 times.
+
+
+
4 for (size_t i = 0; i < in.app_protocol.size(); ++i) {
38 + 2 const auto& item_in = in.app_protocol[i];
39 + 2 auto& item_out = ap_out.array[i];
40 +
41 +
+ 1/4 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
✗ Branch 5 not taken.
+
✗ Branch 6 not taken.
+
+
+
2 CPP2CB_STRING(item_in.protocol_namespace, item_out.ProtocolNamespace);
42 + 2 item_out.VersionNumberMajor = item_in.version_number_major;
43 + 2 item_out.VersionNumberMinor = item_in.version_number_minor;
44 + 2 item_out.SchemaID = item_in.schema_id;
45 + 2 item_out.Priority = item_in.priority;
46 + }
47 + 2}
48 +
49 + 2template <> void convert(const SupportedAppProtocolResponse& in, struct appHand_supportedAppProtocolRes& out) {
50 + 2 init_appHand_supportedAppProtocolRes(&out);
51 +
52 + 2 cb_convert_enum(in.response_code, out.ResponseCode);
53 +
54 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (in.schema_id) {
55 + out.SchemaID = *in.schema_id;
56 + CB_SET_USED(out.SchemaID);
57 + }
58 + 2}
59 +
60 + 4template <> void insert_type(VariantAccess& va, const struct appHand_supportedAppProtocolReq& in) {
61 + 4 va.insert_type<SupportedAppProtocolRequest>(in);
62 + 4};
63 +
64 + 2template <> int serialize_to_exi(const SupportedAppProtocolResponse& in, exi_bitstream_t& out) {
65 + appHand_exiDocument doc;
66 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_appHand_exiDocument(&doc);
67 +
68 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.supportedAppProtocolRes);
69 +
70 + 2 CB_SET_USED(doc.supportedAppProtocolRes);
71 +
72 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_appHand_exiDocument(&out, &doc);
73 + }
74 +
75 + 2template <> int serialize_to_exi(const SupportedAppProtocolRequest& in, exi_bitstream_t& out) {
76 + appHand_exiDocument doc;
77 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 init_appHand_exiDocument(&doc);
78 +
79 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 convert(in, doc.supportedAppProtocolReq);
80 +
81 + 2 CB_SET_USED(doc.supportedAppProtocolReq);
82 +
83 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
4 return encode_appHand_exiDocument(&out, &doc);
84 + }
85 +
86 + 2template <> size_t serialize(const SupportedAppProtocolResponse& in, const io::StreamOutputView& out) {
87 + 2 return serialize_helper(in, out);
88 + }
89 +
90 + template <> size_t serialize(const SupportedAppProtocolRequest& in, const io::StreamOutputView& out) {
91 + return serialize_helper(in, out);
92 + }
93 +
94 + } // namespace iso15118::message_20
95 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.7848f76a2421b621882ce18640c2e40c.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.7848f76a2421b621882ce18640c2e40c.html new file mode 100644 index 000000000..12050252e --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.supported_app_protocol.cpp.7848f76a2421b621882ce18640c2e40c.html @@ -0,0 +1,636 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/d20/state/supported_app_protocol.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:172860.7%
Functions:2366.7%
Branches:113432.4%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/d20/state/supported_app_protocol.hpp>
4 +
5 + #include <optional>
6 + #include <tuple>
7 +
8 + #include <iso15118/d20/state/session_setup.hpp>
9 +
10 + #include <iso15118/message/supported_app_protocol.hpp>
11 +
12 + #include <iso15118/detail/d20/context_helper.hpp>
13 +
14 + namespace iso15118::d20::state {
15 +
16 + static std::tuple<message_20::SupportedAppProtocolResponse, std::optional<std::string>>
17 + 2handle_request(const message_20::SupportedAppProtocolRequest& req) {
18 + 2 message_20::SupportedAppProtocolResponse res;
19 + 2 std::optional<std::string> selected_protocol{std::nullopt};
20 +
21 +
+ 2/2 +
+
✓ Branch 5 taken 2 times.
+
✓ Branch 6 taken 2 times.
+
+
+
4 for (const auto& protocol : req.app_protocol) {
22 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (protocol.protocol_namespace.compare("urn:iso:std:iso:15118:-20:DC") == 0) {
23 + res.schema_id = protocol.schema_id;
24 + selected_protocol = "ISO15118-20:DC";
25 + return {response_with_code(
26 + res, message_20::SupportedAppProtocolResponse::ResponseCode::OK_SuccessfulNegotiation),
27 + selected_protocol};
28 + }
29 + }
30 +
31 + return {response_with_code(res, message_20::SupportedAppProtocolResponse::ResponseCode::Failed_NoNegotiation),
32 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 selected_protocol};
33 + 2}
34 +
35 + void SupportedAppProtocol::enter() {
36 + ctx.log.enter_state("SupportedAppProtocol");
37 + }
38 +
39 + 2FsmSimpleState::HandleEventReturnType SupportedAppProtocol::handle_event(AllocatorType& sa, FsmEvent ev) {
40 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (ev != FsmEvent::V2GTP_MESSAGE) {
41 + return sa.PASS_ON;
42 + }
43 +
44 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 auto variant = ctx.pull_request();
45 +
46 +
+ 1/2 +
+
✓ Branch 2 taken 2 times.
+
✗ Branch 3 not taken.
+
+
+
2 if (const auto req = variant->get_if<message_20::SupportedAppProtocolRequest>()) {
47 +
48 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 const auto [res, selected_protocol] = handle_request(*req);
49 +
50 +
+ 1/2 +
+
✗ Branch 1 not taken.
+
✓ Branch 2 taken 2 times.
+
+
+
2 if (selected_protocol.has_value()) {
51 + ctx.feedback.selected_protocol(*selected_protocol);
52 + }
53 +
54 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 ctx.respond(res);
55 +
56 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 return sa.create_simple<SessionSetup>(ctx);
57 +
58 + 2 } else {
59 + ctx.log("expected SupportedAppProtocolReq! But code type id: %d", variant->get_type());
60 +
61 + ctx.session_stopped = true;
62 + return sa.PASS_ON;
63 + }
64 + 2}
65 +
66 + } // namespace iso15118::d20::state
67 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.tbd_controller.cpp.ecc5dc16823604dadcf1869a4c0aa05b.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.tbd_controller.cpp.ecc5dc16823604dadcf1869a4c0aa05b.html new file mode 100644 index 000000000..1e2458fcb --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.tbd_controller.cpp.ecc5dc16823604dadcf1869a4c0aa05b.html @@ -0,0 +1,1019 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/tbd_controller.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0690.0%
Functions:080.0%
Branches:0840.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/tbd_controller.hpp>
4 +
5 + #include <algorithm>
6 + #include <chrono>
7 + #include <cstdio>
8 +
9 + #include <iso15118/io/connection_plain.hpp>
10 + #include <iso15118/io/connection_ssl.hpp>
11 + #include <iso15118/session/iso.hpp>
12 +
13 + #include <iso15118/detail/helper.hpp>
14 + #include <iso15118/detail/io/socket_helper.hpp>
15 +
16 + namespace iso15118 {
17 +
18 + TbdController::TbdController(TbdConfig config_, session::feedback::Callbacks callbacks_, d20::EvseSetupConfig setup_) :
19 + config(std::move(config_)),
20 + callbacks(std::move(callbacks_)),
21 + evse_setup(std::move(setup_)),
22 + interface_name(config.interface_name) {
23 +
24 + const auto result_interface_check = io::check_and_update_interface(interface_name);
25 + if (result_interface_check) {
26 + logf_info("Using ethernet interface: %s", interface_name.c_str());
27 + } else {
28 + throw std::runtime_error("Ethernet interface was not found!");
29 + }
30 +
31 + if (config.enable_sdp_server) {
32 + sdp_server = std::make_unique<io::SdpServer>(interface_name);
33 + poll_manager.register_fd(sdp_server->get_fd(), [this]() { handle_sdp_server_input(); });
34 + }
35 + }
36 +
37 + void TbdController::loop() {
38 + static constexpr auto POLL_MANAGER_TIMEOUT_MS = 50;
39 +
40 + if (not config.enable_sdp_server) {
41 + auto connection = std::make_unique<io::ConnectionPlain>(poll_manager, interface_name);
42 + session = std::make_unique<Session>(std::move(connection), d20::SessionConfig(evse_setup), callbacks);
43 + }
44 +
45 + auto next_event = get_current_time_point();
46 +
47 + while (true) {
48 + const auto poll_timeout_ms = get_timeout_ms_until(next_event, POLL_MANAGER_TIMEOUT_MS);
49 + poll_manager.poll(poll_timeout_ms);
50 +
51 + next_event = offset_time_point_by_ms(get_current_time_point(), POLL_MANAGER_TIMEOUT_MS);
52 +
53 + if (session) {
54 + const auto next_session_event = session->poll();
55 + next_event = std::min(next_event, next_session_event);
56 + if (session->is_finished()) {
57 + session.reset();
58 +
59 + if (not config.enable_sdp_server) {
60 + auto connection = std::make_unique<io::ConnectionPlain>(poll_manager, interface_name);
61 + session =
62 + std::make_unique<Session>(std::move(connection), d20::SessionConfig(evse_setup), callbacks);
63 + }
64 + }
65 + }
66 + }
67 + }
68 +
69 + void TbdController::send_control_event(const d20::ControlEvent& event) {
70 + if (session) {
71 + session->push_control_event(event);
72 + }
73 + }
74 +
75 + void TbdController::update_authorization_services(const std::vector<message_20::datatypes::Authorization>& services,
76 + bool cert_install_service) {
77 +
78 + evse_setup.enable_certificate_install_service = cert_install_service;
79 +
80 + if (services.empty()) {
81 + logf_warning("The authorization services are not updated because services are empty!");
82 + return;
83 + }
84 + evse_setup.authorization_services = services;
85 + }
86 +
87 + void TbdController::update_dc_limits(const d20::DcTransferLimits& limits) {
88 +
89 + evse_setup.dc_limits = limits;
90 +
91 + if (session) {
92 + session->push_control_event(limits);
93 + }
94 + }
95 +
96 + void TbdController::handle_sdp_server_input() {
97 + auto request = sdp_server->get_peer_request();
98 +
99 + if (not request) {
100 + return;
101 + }
102 +
103 + switch (config.tls_negotiation_strategy) {
104 + case config::TlsNegotiationStrategy::ACCEPT_CLIENT_OFFER:
105 + // nothing to change
106 + break;
107 + case config::TlsNegotiationStrategy::ENFORCE_TLS:
108 + request.security = io::v2gtp::Security::TLS;
109 + break;
110 + case config::TlsNegotiationStrategy::ENFORCE_NO_TLS:
111 + request.security = io::v2gtp::Security::NO_TRANSPORT_SECURITY;
112 + break;
113 + }
114 +
115 + auto connection = [this](bool secure_connection) -> std::unique_ptr<io::IConnection> {
116 + if (secure_connection) {
117 + return std::make_unique<io::ConnectionSSL>(poll_manager, interface_name, config.ssl);
118 + } else {
119 + return std::make_unique<io::ConnectionPlain>(poll_manager, interface_name);
120 + }
121 + }(request.security == io::v2gtp::Security::TLS);
122 +
123 + const auto ipv6_endpoint = connection->get_public_endpoint();
124 +
125 + session = std::make_unique<Session>(std::move(connection), d20::SessionConfig(evse_setup), callbacks);
126 +
127 + sdp_server->send_response(request, ipv6_endpoint);
128 + }
129 +
130 + } // namespace iso15118
131 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.time.hpp.e783a5e80684898da96ecf49cd2bfb9f.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.time.hpp.e783a5e80684898da96ecf49cd2bfb9f.html new file mode 100644 index 000000000..832d0c8b2 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.time.hpp.e783a5e80684898da96ecf49cd2bfb9f.html @@ -0,0 +1,321 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/io/time.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:0100.0%
Functions:030.0%
Branches:080.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <chrono>
6 +
7 + namespace iso15118 {
8 +
9 + using TimePoint = std::chrono::steady_clock::time_point;
10 +
11 + inline TimePoint get_current_time_point() {
12 + return std::chrono::steady_clock::now();
13 + }
14 +
15 + inline TimePoint offset_time_point_by_ms(const TimePoint& time_point, int32_t offset) {
16 + return time_point + std::chrono::milliseconds(offset);
17 + }
18 +
19 + inline int32_t get_timeout_ms_until(const TimePoint& until, int32_t max_timeout_ms) {
20 + const auto duration =
21 + std::chrono::duration_cast<std::chrono::duration<int32_t, std::milli>>(until - get_current_time_point());
22 + const auto timeout_ms = duration.count();
23 +
24 + if (timeout_ms < max_timeout_ms) {
25 + return timeout_ms;
26 + } else {
27 + return max_timeout_ms;
28 + }
29 + }
30 +
31 + } // namespace iso15118
32 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.cpp.b7f9fafab74266b0574c9458017b27e7.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.cpp.b7f9fafab74266b0574c9458017b27e7.html new file mode 100644 index 000000000..c0074e5f1 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.cpp.b7f9fafab74266b0574c9458017b27e7.html @@ -0,0 +1,1523 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:src/iso15118/message/variant.cpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:588369.9%
Functions:6875.0%
Branches:6113046.9%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #include <iso15118/message/variant.hpp>
4 +
5 + #include <cassert>
6 + #include <string>
7 +
8 + #include <iso15118/detail/helper.hpp>
9 + #include <iso15118/detail/variant_access.hpp>
10 +
11 + #include <cbv2g/app_handshake/appHand_Decoder.h>
12 + #include <cbv2g/iso_20/iso20_AC_Decoder.h>
13 + #include <cbv2g/iso_20/iso20_CommonMessages_Decoder.h>
14 + #include <cbv2g/iso_20/iso20_DC_Decoder.h>
15 +
16 + using PayloadType = iso15118::io::v2gtp::PayloadType;
17 +
18 + namespace iso15118::message_20 {
19 +
20 + 4static void handle_sap(VariantAccess& va) {
21 + appHand_exiDocument doc;
22 +
23 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 const auto decode_status = decode_appHand_exiDocument(&va.input_stream, &doc);
24 +
25 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 4 times.
+
+
+
4 if (decode_status != 0) {
26 + va.error = "decode_appHand_exiDocument failed with " + std::to_string(decode_status);
27 + return;
28 + }
29 +
30 +
+ 1/2 +
+
✓ Branch 0 taken 4 times.
+
✗ Branch 1 not taken.
+
+
+
4 if (doc.supportedAppProtocolReq_isUsed) {
31 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 insert_type(va, doc.supportedAppProtocolReq);
32 + } else {
33 + va.error = "chosen message type unhandled";
34 + }
35 + }
36 +
37 + 20static void handle_main(VariantAccess& va) {
38 + iso20_exiDocument doc;
39 +
40 +
+ 1/2 +
+
✓ Branch 1 taken 20 times.
+
✗ Branch 2 not taken.
+
+
+
20 const auto decode_status = decode_iso20_exiDocument(&va.input_stream, &doc);
41 +
42 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 20 times.
+
+
+
20 if (decode_status != 0) {
43 + va.error = "decode_iso20_exiDocument failed with " + std::to_string(decode_status);
44 + return;
45 + }
46 +
47 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 18 times.
+
+
+
20 if (doc.SessionSetupReq_isUsed) {
48 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.SessionSetupReq);
49 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 16 times.
+
+
+
18 } else if (doc.AuthorizationSetupReq_isUsed) {
50 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.AuthorizationSetupReq);
51 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 14 times.
+
+
+
16 } else if (doc.AuthorizationReq_isUsed) {
52 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.AuthorizationReq);
53 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 12 times.
+
+
+
14 } else if (doc.ServiceDiscoveryReq_isUsed) {
54 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.ServiceDiscoveryReq);
55 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 10 times.
+
+
+
12 } else if (doc.ServiceDetailReq_isUsed) {
56 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.ServiceDetailReq);
57 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 8 times.
+
+
+
10 } else if (doc.ServiceSelectionReq_isUsed) {
58 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.ServiceSelectionReq);
59 +
+ 2/2 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 4 times.
+
+
+
8 } else if (doc.ScheduleExchangeReq_isUsed) {
60 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 insert_type(va, doc.ScheduleExchangeReq);
61 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
+
+
4 } else if (doc.PowerDeliveryReq_isUsed) {
62 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.PowerDeliveryReq);
63 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (doc.SessionStopReq_isUsed) {
64 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.SessionStopReq);
65 + } else {
66 + va.error = "chosen message type unhandled";
67 + }
68 + }
69 +
70 + 12static void handle_dc(VariantAccess& va) {
71 + iso20_dc_exiDocument doc;
72 +
73 +
+ 1/2 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
+
+
12 const auto decode_status = decode_iso20_dc_exiDocument(&va.input_stream, &doc);
74 +
75 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 12 times.
+
+
+
12 if (decode_status != 0) {
76 + va.error = "decode_iso20_dc_exiDocument failed with " + std::to_string(decode_status);
77 + return;
78 + }
79 +
80 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 10 times.
+
+
+
12 if (doc.DC_ChargeParameterDiscoveryReq_isUsed) {
81 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.DC_ChargeParameterDiscoveryReq);
82 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 8 times.
+
+
+
10 } else if (doc.DC_CableCheckReq_isUsed) {
83 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.DC_CableCheckReq);
84 +
+ 2/2 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 6 times.
+
+
+
8 } else if (doc.DC_PreChargeReq_isUsed) {
85 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.DC_PreChargeReq);
86 +
+ 2/2 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 2 times.
+
+
+
6 } else if (doc.DC_ChargeLoopReq_isUsed) {
87 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 insert_type(va, doc.DC_ChargeLoopReq);
88 +
+ 1/2 +
+
✓ Branch 0 taken 2 times.
+
✗ Branch 1 not taken.
+
+
+
2 } else if (doc.DC_WeldingDetectionReq_isUsed) {
89 +
+ 1/2 +
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
+
+
2 insert_type(va, doc.DC_WeldingDetectionReq);
90 + } else {
91 + va.error = "chosen message type unhandled";
92 + }
93 + }
94 +
95 + static void handle_ac(VariantAccess& va) {
96 + iso20_ac_exiDocument doc;
97 +
98 + const auto decode_status = decode_iso20_ac_exiDocument(&va.input_stream, &doc);
99 +
100 + if (decode_status != 0) {
101 + va.error = "decode_iso20_dc_exiDocument failed with " + std::to_string(decode_status);
102 + return;
103 + }
104 +
105 + if (doc.AC_ChargeParameterDiscoveryReq_isUsed) {
106 + insert_type(va, doc.AC_ChargeParameterDiscoveryReq);
107 + } else if (doc.AC_ChargeLoopReq_isUsed) {
108 + insert_type(va, doc.AC_ChargeLoopReq);
109 + } else {
110 + va.error = "chosen message type unhandled";
111 + }
112 + }
113 +
114 + 36Variant::Variant(io::v2gtp::PayloadType payload_type, const io::StreamInputView& buffer_view) {
115 +
116 + VariantAccess va{
117 +
+ 1/2 +
+
✓ Branch 1 taken 36 times.
+
✗ Branch 2 not taken.
+
+
+
36 get_exi_input_stream(buffer_view), this->data, this->type, this->custom_deleter, this->error,
118 + 36 };
119 +
120 +
+ 2/2 +
+
✓ Branch 0 taken 4 times.
+
✓ Branch 1 taken 32 times.
+
+
+
36 if (payload_type == PayloadType::SAP) {
121 +
+ 1/2 +
+
✓ Branch 1 taken 4 times.
+
✗ Branch 2 not taken.
+
+
+
4 handle_sap(va);
122 +
+ 2/2 +
+
✓ Branch 0 taken 20 times.
+
✓ Branch 1 taken 12 times.
+
+
+
32 } else if (payload_type == PayloadType::Part20Main) {
123 +
+ 1/2 +
+
✓ Branch 1 taken 20 times.
+
✗ Branch 2 not taken.
+
+
+
20 handle_main(va);
124 +
+ 1/2 +
+
✓ Branch 0 taken 12 times.
+
✗ Branch 1 not taken.
+
+
+
12 } else if (payload_type == PayloadType::Part20DC) {
125 +
+ 1/2 +
+
✓ Branch 1 taken 12 times.
+
✗ Branch 2 not taken.
+
+
+
12 handle_dc(va);
126 + } else if (payload_type == PayloadType::Part20AC) {
127 + handle_ac(va);
128 + } else {
129 + logf_warning("Unknown type");
130 + }
131 +
132 +
+ 1/2 +
+
✓ Branch 0 taken 36 times.
+
✗ Branch 1 not taken.
+
+
+
36 if (data) {
133 + // in case data was set, make sure the custom deleter and the type were set!
134 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 36 times.
+
+
+
36 assert(custom_deleter != nullptr);
135 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 36 times.
+
+
+
36 assert(type != Type::None);
136 + } else {
137 + logf_error("Failed due to: %s\n", error.c_str());
138 + }
139 + 36}
140 +
141 + 36Variant::~Variant() {
142 +
+ 1/2 +
+
✓ Branch 0 taken 36 times.
+
✗ Branch 1 not taken.
+
+
+
36 if (data) {
143 + 36 custom_deleter(data);
144 + }
145 + 36}
146 +
147 + 34Type Variant::get_type() const {
148 + 34 return type;
149 + }
150 +
151 + const std::string& Variant::get_error() const {
152 + return error;
153 + }
154 +
155 + } // namespace iso15118::message_20
156 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.hpp.6e7c8f2f1c408f519398bf8d6f4bf466.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.hpp.6e7c8f2f1c408f519398bf8d6f4bf466.html new file mode 100644 index 000000000..e4e3bbf1a --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant.hpp.6e7c8f2f1c408f519398bf8d6f4bf466.html @@ -0,0 +1,483 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/message/variant.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:3475.0%
Functions:1425.0%
Branches:1250.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cstddef>
6 + #include <cstdint>
7 + #include <memory>
8 + #include <stdexcept>
9 + #include <string>
10 +
11 + // FIXME (aw): we only need the payload types from sdp.hpp, this could be shared in a separate header file
12 + #include <iso15118/io/sdp.hpp>
13 + #include <iso15118/io/stream_view.hpp>
14 +
15 + #include "type.hpp"
16 +
17 + namespace iso15118::message_20 {
18 +
19 + class Variant {
20 + public:
21 + using CustomDeleter = void (*)(void*);
22 + Variant(io::v2gtp::PayloadType, const io::StreamInputView&);
23 + ~Variant();
24 +
25 + Type get_type() const;
26 +
27 + const std::string& get_error() const;
28 +
29 + template <typename T> const T& get() const {
30 + static_assert(TypeTrait<T>::type != Type::None, "Unhandled type!");
31 + if (TypeTrait<T>::type != type) {
32 + throw std::runtime_error("Illegal message type access");
33 + }
34 +
35 + return *static_cast<T*>(data);
36 + }
37 +
38 + 2 template <typename T> T const* get_if() const {
39 + static_assert(TypeTrait<T>::type != Type::None, "Unhandled type!");
40 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 2 times.
+
+
+
2 if (TypeTrait<T>::type != type) {
41 + return nullptr;
42 + }
43 +
44 + 2 return static_cast<T*>(data);
45 + }
46 +
47 + private:
48 + CustomDeleter custom_deleter{nullptr};
49 + void* data{nullptr};
50 + Type type{Type::None};
51 + std::string error;
52 + };
53 + } // namespace iso15118::message_20
54 +
+
+
+
+ + + diff --git a/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant_access.hpp.205801925e6960dacea5c02b3ab543c7.html b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant_access.hpp.205801925e6960dacea5c02b3ab543c7.html new file mode 100644 index 000000000..291c0d090 --- /dev/null +++ b/docs/ci-artifacts/EVerest/libiso15118/12236600792/coverage-report/index.variant_access.hpp.205801925e6960dacea5c02b3ab543c7.html @@ -0,0 +1,401 @@ + + + + + + GCC Code Coverage Report + + + + + + +
+

GCC Code Coverage Report

+
+
+
+ + + + + + + + + + + + + +
Directory:./
File:include/iso15118/detail/variant_access.hpp
Date:2024-12-09 13:28:44
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:77100.0%
Functions:303488.2%
Branches:2450.0%
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + // SPDX-License-Identifier: Apache-2.0
2 + // Copyright 2023 Pionix GmbH and Contributors to EVerest
3 + #pragma once
4 +
5 + #include <cassert>
6 +
7 + #include <iso15118/message/variant.hpp>
8 +
9 + #include "cb_exi.hpp"
10 +
11 + namespace iso15118::message_20 {
12 +
13 + struct VariantAccess {
14 + // input
15 + exi_bitstream_t input_stream;
16 +
17 + // output
18 + void*& data;
19 + iso15118::message_20::Type& type;
20 + iso15118::message_20::Variant::CustomDeleter& custom_deleter;
21 + std::string& error;
22 +
23 + 36 template <typename MessageType, typename CbExiMessageType> void insert_type(const CbExiMessageType& in) {
24 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 36 times.
+
+
+
36 assert(data == nullptr);
25 +
26 + 36 data = new MessageType;
27 + 36 type = iso15118::message_20::TypeTrait<MessageType>::type;
28 +
+ 1/2 +
+
✓ Branch 1 taken 36 times.
+
✗ Branch 2 not taken.
+
+
+
72 custom_deleter = [](void* ptr) { delete static_cast<MessageType*>(ptr); };
29 +
30 + 36 convert(in, *static_cast<MessageType*>(data));
31 + 36 };
32 + };
33 +
34 + template <typename CbExiMessageType> void insert_type(VariantAccess& va, const CbExiMessageType&);
35 +
36 + } // namespace iso15118::message_20
37 +
+
+
+
+ + +