Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
# This script requires clang and g++-13 to be installed:
# This script requires clang to be installed:
# sudo apt-get update && sudo apt-get install -y clang
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# sudo apt-get install -y g++-13

set -o xtrace -o errexit -o nounset -o pipefail

Expand All @@ -23,8 +21,6 @@ build_and_test() {
ctest --test-dir "$buildDir/${target}-$build_type"
}

export CC=gcc-13
export CXX=g++-13
build_and_test Debug linux-gcc
build_and_test Release linux-gcc

Expand Down
9 changes: 4 additions & 5 deletions src/dlms_parser/apdu_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "apdu_handler.h"
#include "log.h"
#include "utils.h"
#include <algorithm>
#include <array>
Expand Down Expand Up @@ -28,8 +27,8 @@ static bool is_known_tag(const uint8_t b) {
case DLMS_APDU_DATA_NOTIFICATION:
case DLMS_APDU_GENERAL_GLO_CIPHERING:
case DLMS_APDU_GENERAL_DED_CIPHERING:
case DLMS_DATA_TYPE_ARRAY:
case DLMS_DATA_TYPE_STRUCTURE:
case static_cast<uint8_t>(DlmsDataType::ARRAY):
case static_cast<uint8_t>(DlmsDataType::STRUCTURE):
return true;
default:
return false;
Expand All @@ -51,9 +50,9 @@ std::span<uint8_t> parse_apdu_in_place(std::span<uint8_t> buf, Aes128GcmDecrypto
const uint8_t tag = buf[0];

// --- Raw AXDR (0x01/0x02): done
if (tag == DLMS_DATA_TYPE_ARRAY || tag == DLMS_DATA_TYPE_STRUCTURE) {
if (tag == static_cast<uint8_t>(DlmsDataType::ARRAY) || tag == static_cast<uint8_t>(DlmsDataType::STRUCTURE)) {
Logger::log(LogLevel::VERBOSE, "Found raw AXDR %s (0x%02X) - no APDU wrapper",
tag == DLMS_DATA_TYPE_ARRAY ? "ARRAY" : "STRUCTURE", tag);
tag == static_cast<uint8_t>(DlmsDataType::ARRAY) ? "ARRAY" : "STRUCTURE", tag);
return buf;
}

Expand Down
Loading
Loading