Skip to content

Commit 7236d87

Browse files
committed
replace em dash with hyphen
keep console output ascii only
1 parent aacde0c commit 7236d87

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/dlms_parser/apdu_handler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool ApduHandler::parse(const uint8_t* buf, size_t len, AxdrPayloadCallback cb)
2424
return parse_ciphered_apdu_(rest, rest_len, tag, cb);
2525
}
2626
if (tag == DLMS_DATA_TYPE_ARRAY || tag == DLMS_DATA_TYPE_STRUCTURE) {
27-
Logger::log(LogLevel::DEBUG, "Found raw AXDR %s (0x%02X) at offset %zu no APDU wrapper",
27+
Logger::log(LogLevel::DEBUG, "Found raw AXDR %s (0x%02X) at offset %zu - no APDU wrapper",
2828
tag == DLMS_DATA_TYPE_ARRAY ? "ARRAY" : "STRUCTURE", tag, pos);
2929
cb(buf + pos, len - pos);
3030
return true;
@@ -50,7 +50,7 @@ bool ApduHandler::parse_data_notification_(const uint8_t* buf, size_t len,
5050
// Date-Time presence flag (1 byte): 0x00 = absent, anything else = 12-byte datetime follows
5151
const uint8_t has_datetime = buf[pos++];
5252
if (has_datetime != 0x00) {
53-
Logger::log(LogLevel::VERBOSE, "Datetime flag 0x%02X skipping 12-byte datetime", has_datetime);
53+
Logger::log(LogLevel::VERBOSE, "Datetime flag 0x%02X - skipping 12-byte datetime", has_datetime);
5454
if (pos + 12 > len) {
5555
Logger::log(LogLevel::WARNING, "Buffer too short to skip datetime object");
5656
return false;
@@ -207,7 +207,7 @@ ApduHandler::UnwrapResult ApduHandler::unwrap_in_place(uint8_t* buf, size_t len)
207207

208208
// --- Raw AXDR (0x01/0x02): done
209209
if (tag == DLMS_DATA_TYPE_ARRAY || tag == DLMS_DATA_TYPE_STRUCTURE) {
210-
Logger::log(LogLevel::DEBUG, "Found raw AXDR %s (0x%02X) no APDU wrapper",
210+
Logger::log(LogLevel::DEBUG, "Found raw AXDR %s (0x%02X) - no APDU wrapper",
211211
tag == DLMS_DATA_TYPE_ARRAY ? "ARRAY" : "STRUCTURE", tag);
212212
return {0, len};
213213
}
@@ -222,7 +222,7 @@ ApduHandler::UnwrapResult ApduHandler::unwrap_in_place(uint8_t* buf, size_t len)
222222
if (pos >= len) return {0, 0};
223223
const uint8_t has_datetime = buf[pos++];
224224
if (has_datetime != 0x00) {
225-
Logger::log(LogLevel::VERBOSE, "Datetime flag 0x%02X skipping 12-byte datetime", has_datetime);
225+
Logger::log(LogLevel::VERBOSE, "Datetime flag 0x%02X - skipping 12-byte datetime", has_datetime);
226226
if (pos + 12 > len) return {0, 0};
227227
pos += 12;
228228
}

src/dlms_parser/axdr_parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ParseResult AxdrParser::parse(const uint8_t* axdr, size_t len,
5252
while (this->pos_ < this->buffer_len_) {
5353
const uint8_t type = this->read_byte_();
5454
if (type != DLMS_DATA_TYPE_STRUCTURE && type != DLMS_DATA_TYPE_ARRAY) {
55-
Logger::log(LogLevel::VERBOSE, "Non-container type 0x%02X at pos %zu stopping", type, this->pos_ - 1);
55+
Logger::log(LogLevel::VERBOSE, "Non-container type 0x%02X at pos %zu - stopping", type, this->pos_ - 1);
5656
this->pos_--; // put it back — not consumed
5757
break;
5858
}
@@ -409,7 +409,7 @@ void AxdrParser::emit_object_(const AxdrDescriptorPattern& pat, const AxdrCaptur
409409
}
410410

411411
const uint16_t cid = effective.class_id ? effective.class_id : pat.default_class_id;
412-
Logger::log(LogLevel::DEBUG, "Pattern '%s' matched at pos %u class_id=%d obis=%s",
412+
Logger::log(LogLevel::DEBUG, "Pattern '%s' matched at pos %u - class_id=%d obis=%s",
413413
pat.name.c_str(), effective.elem_idx, cid, obis_str_buf);
414414

415415
if (effective.has_scaler_unit) {

src/dlms_parser/dlms_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ParseResult DlmsParser::parse(const uint8_t* buf, size_t len,
6262
DlmsDataCallback cooked_cb,
6363
DlmsRawCallback raw_cb) {
6464
if (!this->work_buf_) {
65-
Logger::log(LogLevel::ERROR, "No work buffer set call set_work_buffer() before parse()");
65+
Logger::log(LogLevel::ERROR, "No work buffer set - call set_work_buffer() before parse()");
6666
return {};
6767
}
6868
if (len > this->work_buf_capacity_) {

tools/decode_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ def decode_apdu(apdu: bytes, key: Optional[bytes] = None) -> tuple[list[str], Op
592592
lines.append(f"Decryption: FAILED (wrong key or corrupted)")
593593
else:
594594
if HAS_CRYPTO:
595-
lines.append(f"No key provided place key in .key file or use -k flag")
595+
lines.append(f"No key provided - place key in .key file or use -k flag")
596596
else:
597-
lines.append(f"No 'cryptography' package pip install cryptography")
597+
lines.append(f"No 'cryptography' package - pip install cryptography")
598598
return lines, None
599599

600600
elif tag in (0x01, 0x02):

tools/decode_readout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ int main(int argc, char* argv[]) {
310310
fprintf(stdout, "Status: %s\n\n", status_str);
311311

312312
if (status == dlms_parser::FrameStatus::NEED_MORE) {
313-
fprintf(stderr, "Frame incomplete more data needed. In a real application,\n"
313+
fprintf(stderr, "Frame incomplete - more data needed. In a real application,\n"
314314
"keep reading from UART and call check_frame() again with\n"
315315
"the accumulated buffer.\n");
316316
return 2;
317317
}
318318
if (status == dlms_parser::FrameStatus::ERROR) {
319-
fprintf(stderr, "Frame error invalid data. Discard and resync.\n");
319+
fprintf(stderr, "Frame error - invalid data. Discard and resync.\n");
320320
return 3;
321321
}
322322

0 commit comments

Comments
 (0)